Proper Use of %pos to track eqbal from prompt in Zmud?
Damn these questions are a useful means of getting basic scripting info for nubs like me.
[code]
PATTERN:
^H:(%d)%sM:(%d)%sE:(%d)~%%sW:(%d)~%%sB:(%d)~%%s~[(%w)~]
VALUE:
currenthealth=%1
currentmana= %2
currentendurance= %3
currentwillpower= %4
blood= %5
#IF %pos( 'e', %6) {equilibrium = 1} {equilibrium = 0}
#IF %pos( 'b', %6) {balance = 1} {balance = 0}
[/code]
The patterns return the values fine from prompt but the %pos is not updating pre-existing equilibrium/balance variables. This leads me to believe that syntactically there is something wrong with my eq and bal checking #if lines, probably related to my unfamiliarity with the %pos command. What did I do wrong?
0
Answers
Also, thought this was tech-talk. I had that section open when I 'asked a question'. Still getting used to this forum interface. Maybe a mod can move it?
And for the record, adding brackets and changing the single quote to double-quote marks didn't really work. Pattern is still firing, variables aren't being updated when I use secrets to knock myself off EQ.
Lines now look like:
[code]
#IF (%pos( "e", %6)) {equilibrium=1} {equilibrium=0}
#IF (%pos( "b", %6)) {balance = 1} {balance = 0}
[/code]
Final solution to script problem as identified by Edhain:
#TRIGGER {^H:(%d)%sM:(%d)%sE:(%d)~%%sW:(%d)~%%sB:(%d)~%%s~[*~]} {currenthealth=%1;currentmana= %2;currentendurance= %3;currentwillpower= %4;blood= %5;#if (%pos( e, %6)) {equilibrium=1} {equilibrium=0};#if (%pos( b, %6)) {balance=1} {balance=0}} "" {nocr|prompt}
Thanks!
That's mine.