Ok, so im really new to scripting. Im used to "brute force" triggering, which is making many, many triggers to get done what i want done. After looking around on here and figuring out how to use a simple script trigger or two, my gaming has improved immensely. The help files around here have been really great, but im stuck at a point where i think its time i give up searching, and just ask. Hopefully everything comes through clear.
Ok, so, what i want to do is basically get rid of a comma in a wildcard varible.
This is what my prompt looks like:
[Hi: 129][Vi: 238][Ti: 1,087][Exp: -106]>
This is what i changed it to look like, for my trigger:
[Hi: *][Vi: *][Ti: *][Exp: *]>
The third variable (Ti, %3) is what i want to work with. My original script was simple enough, i thought:
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="training stats"
match="[Hi: *][Vi: *][Ti: *][Exp: *]>"
send_to="12"
sequence="100"
>
<send>if %3 > 1000 then
Send "wake"
Send "stand"
Send "train dop"
end -- if
</send>
</trigger>
</triggers>
With that, I get this error message when triggered:
Compile error
World: advent
Immediate execution
[string "Trigger: "]:1: 'then' expected near ','
Im pretty certain the problem is that darn "comma". I tried playing around with string.gsub, but i kept getting error messages stating that i was trying to compare a string with a number. I even tried number.gsub but couldnt get it to work. Right now im using this for the first line as a temporary patchup:
If "%3" == "1,087" then
But the problem with that is, if I advance any further ill have to constantly update the "1,087" bit.
I bet this is extremely simple but im not catching how to do it. Thanks for your time and effort!
Hm, as a separate question, is there a way to send the script only once per trigger? For example in the trigger above, when I "wake" it shows the prompt, which triggers the trigger again, and then when "stand" the prompt is show again, which, again triggers it.
Is there a way to only activate the entire trigger once every few minutes and not delete or deactivate the trigger permanently? |