Does anyone happen to know what the monk stance defense "keepup" variable is for svof? I can't seem to find it. For example, svof's parry variable is "svo.sp_config.parry_shouldbe"
Does anyone happen to know what the monk stance defense "keepup" variable is for svof? I can't seem to find it. For example, svof's parry variable is "svo.sp_config.parry_shouldbe"
You can get it from gmcp.Char.Vitals.charstats, iirc.
Something to that effect, you'll have to change [3] to the right number. No idea about SVO, but that's how you can get what stance you're currently in; can use it to compare to what stance you WANT to be in.
Does anyone happen to know what the monk stance defense "keepup" variable is for svof? I can't seem to find it. For example, svof's parry variable is "svo.sp_config.parry_shouldbe"
Run -- lua svo.defc -- in command line and see if it returns stances as well? If so you can do if not svo.defc.stancename then do stuff.
Stances (and forms) should be normal defenses, that are simply made exclusive to each other. That means they are "svo.defkeepup[svo.defs.mode].<def>", like "svo.defkeepup[svo.defs.mode].eagle".
Your current stance should be in "svo.me.stance" and "svo.me.form" for tekura and shikudo respectively.
to do this (where x.y. is a namespace and subname - the "cure" part works fine, but not the namespace in the beginning)
_G['x.y.eat_'..x.y.cure]()
I've tried it all kinds of ways like _G[x.y.]['eat_'..x.y.cure]() _G[x.y]['.eat_'..x.y.cure]()
Basically I have all my "eat_<herbname>" functions and the way I have it now, it works fine.. but I'm trying to play around with the namespace stuff and it doesn't quite work. It keeps saying something like "field is ?" or "concatenating x.y."
Are x and y actual namespaces or variable that contain namespace names? If the former, x.y["eat_"..x.y.cure] if the latter it's _G[x][y]["eat_".._G[x][y].cure].
Are x and y actual namespaces or variable that contain namespace names? If the former, x.y["eat_"..x.y.cure] if the latter it's _G[x][y]["eat_".._G[x][y].cure].
The actual names. Figured they weren't important so threw in some placeholders.
Still doesn't like it. would it be _G[x.y[".eat cure"..x.y.cure]] ?
Switched it to x.y._G["eat_"..x.y.cure] and it's saying I need an "="?
Maybe it would be easier if you gave your real table names and how they are structured. Then we don't need to guess around.
_G is the global table, the one every variable and function lands in if you normally don't need to prefix it with anything. So _G.echo("something") is the same as echo("something"). You normally only need to access it if you dynamically piece something global together like in your old code.
Assuming (based on your comments) that x is the name of a namespace (within the global scope), y is a namespace within the x namespace (a sub-namespace), and cure is the name of a variable within the scope of your code (that contains a string), then it should probably just be:
x.y["eat_" .. cure]()
As a more general point, the fact that you appear to have a function per herb suggests that the design of your code is... not good. You're going to end up duplicating code and making maintaining the entire thing more difficult than it needs to be.
Assuming (based on your comments) that x is the name of a namespace (within the global scope), y is a namespace within the x namespace (a sub-namespace), and cure is the name of a variable within the scope of your code (that contains a string), then it should probably just be:
x.y["eat_" .. cure]()
As a more general point, the fact that you appear to have a function per herb suggests that the design of your code is... not good. You're going to end up duplicating code and making maintaining the entire thing more difficult than it needs to be.
Meh.. That worked. I had already tried it. But I had the x.y.[ the stupid dot was messing it up. I knew it was something dumb.
Anyway, I am in the process of speeding up and making efficiencies which is why I was doing this. Get it working the way I had in my other script first, then fix so I have a "safe state" saved. As it turns out, I didn't need this chunk of code, but was just curious how to get it working. Though in this instance, it also didn't make it more difficult to maintain - but it did duplicate some code. I was able to remove about 500 lines of code in 10 or 12 functions and condense it down to 2 functions and under 50 lines of code (with one of those functions being sileris so I will modify it shortly, just wasn't top of my list right now)
If I make a table, and later want to change a value in it, is there a way to maintain permanence or would it need to be done on login each time?
I guess a good example would be how SVO lets you do the defense upkeep with an alias. (I don't use SVO so not sure if it has to be continuously done on login)
Or does SVO write it out to a file and import it each time?
@Caelan You probably want table.save and table.load. Though I think newer versions of Mudlet make it a lot easier to persist variables without having to write code to do it.
@Caelan You probably want table.save and table.load. Though I think newer versions of Mudlet make it a lot easier to persist variables without having to write code to do it.
Get requests work by using downloadFile(). Post not out of the box, but can be done after installing luasocket (see http://w3.impa.br/~diego/software/luasocket/ for instructioms)
and then when I want to change to use, say Water instead of Earth, I can hit F10 and it cycles through the options (Clearly echoing to screen) and fills the variable.
Any idea where to start with that, and is that even an efficient way or doing things?
Comments
[ SnB PvP Guide | Link ]
Something to that effect, you'll have to change [3] to the right number. No idea about SVO, but that's how you can get what stance you're currently in; can use it to compare to what stance you WANT to be in.
Your current stance should be in "svo.me.stance" and "svo.me.form" for tekura and shikudo respectively.
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
send("queue addclear eqbal stand~dragoncurse "..target.." paralysis 1~rend " ..target.. " left leg slike~breathgust " ..target)
[ SnB PvP Guide | Link ]
[ SnB PvP Guide | Link ]
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
change the '3' to whatever number you wanna use.
_G['eat_'..cure]()
to do this (where x.y. is a namespace and subname - the "cure" part works fine, but not the namespace in the beginning)
_G['x.y.eat_'..x.y.cure]()
I've tried it all kinds of ways like
_G[x.y.]['eat_'..x.y.cure]()
_G[x.y]['.eat_'..x.y.cure]()
Basically I have all my "eat_<herbname>" functions and the way I have it now, it works fine.. but I'm trying to play around with the namespace stuff and it doesn't quite work. It keeps saying something like "field is ?" or "concatenating x.y."
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
Still doesn't like it. would it be _G[x.y[".eat cure"..x.y.cure]] ?
Switched it to x.y._G["eat_"..x.y.cure] and it's saying I need an "="?
Without knowing what _G and x.y.eat_cure actually are, it's pretty hard to resolve
_G is the global table, the one every variable and function lands in if you normally don't need to prefix it with anything. So _G.echo("something") is the same as echo("something"). You normally only need to access it if you dynamically piece something global together like in your old code.
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
Results of disembowel testing | Knight limb counter | GMCP AB files
Assuming (based on your comments) that x is the name of a namespace (within the global scope), y is a namespace within the x namespace (a sub-namespace), and cure is the name of a variable within the scope of your code (that contains a string), then it should probably just be:
x.y["eat_" .. cure]()
As a more general point, the fact that you appear to have a function per herb suggests that the design of your code is... not good. You're going to end up duplicating code and making maintaining the entire thing more difficult than it needs to be.
Results of disembowel testing | Knight limb counter | GMCP AB files
Anyway, I am in the process of speeding up and making efficiencies which is why I was doing this. Get it working the way I had in my other script first, then fix so I have a "safe state" saved. As it turns out, I didn't need this chunk of code, but was just curious how to get it working. Though in this instance, it also didn't make it more difficult to maintain - but it did duplicate some code. I was able to remove about 500 lines of code in 10 or 12 functions and condense it down to 2 functions and under 50 lines of code (with one of those functions being sileris so I will modify it shortly, just wasn't top of my list right now)
Thanks.
How do I capture:
I don't know how to write the regex for it.
An icewall is here, blocking passage to the (.+?)\.
hmm, didn't really work, might have to pipe some triggers. I'll let other people chime in.
^.*An icewall is here, .*$
local t = matches[1]:split("An icewall")
>> could then parse the split
caveat: I hate dependent triggers
I guess a good example would be how SVO lets you do the defense upkeep with an alias. (I don't use SVO so not sure if it has to be continuously done on login)
Or does SVO write it out to a file and import it each time?
Results of disembowel testing | Knight limb counter | GMCP AB files
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
I'm famliar with lua socket, do I need to do anything in mudlet to load the library?
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
I've like to set a variable for the attack type (Earth, Air, etc) and be able to cycle through those when hitting an F key.
That way I could have:
and then when I want to change to use, say Water instead of Earth, I can hit F10 and it cycles through the options (Clearly echoing to screen) and fills the variable.
Any idea where to start with that, and is that even an efficient way or doing things?