gah--why doesn't this SetVariable bit work?

Posted by SKYY on Wed 02 Apr 2008 04:41 PM — 5 posts, 18,245 views.

#0
<triggers>
<trigger
enabled="y"
group="ReRoll"
match="^Str: (\d{1,2}) Int: (\d{1,2}) Wis: (\d{1,2}) Dex: (\d{1,2}) Con: (\d{1,2}) Cha: (\d{1,2}) Lck: (\d{1,2})$"
regexp="y"
send_to="10"
sequence="100"
>
<send>/SetVariable("stre",%1)
/SetVariable("inte",%2)
/SetVariable("wisd",%3)
/SetVariable("dext",%4)
/SetVariable("cons",%5)
/SetVariable("char",%6)
/SetVariable("luck",%7)</send>
</trigger>
</triggers>

It works GREAT when I only have one /SetVariable line--it copies the captured number to the appropriate variable. However, as soon as I add a second /SetVariable line, it stops working with an error.

I'm sure I'm doing something absolutely dumb here, so can someone tell me the one character I need to put in the right place to make this trigger work? :p
#1
GAHH!!! I figured it out. You only need one / to make the execute happen for multiple lines in the 'Send' box.

This works:

<triggers>
<trigger
enabled="y"
group="ReRoll"
lines_to_match="2"
match="^Str: (\d{1,2}) Int: (\d{1,2}) Wis: (\d{1,2}) Dex: (\d{1,2}) Con: (\d{1,2}) Cha: (\d{1,2}) Lck: (\d{1,2})$"
regexp="y"
send_to="10"
sequence="100"
>
<send>/SetVariable("stre",%1)
SetVariable("inte",%2)
SetVariable("inte",%2)
SetVariable("wisd",%3)
SetVariable("dext",%4)
SetVariable("cons",%5)
SetVariable("char",%6)
SetVariable("luck",%7)</send>
</trigger>
</triggers>
Australia Forum Administrator #2
Rather than "send to: execute" you are better off doing "send to: script" then you can omit the slash altogether.

Your method relies on the scripting prefix being a slash, and if you ever change it, the trigger will stop working. Using "send to script" will always work.
#3
In order to send to script, don't I have to have a script file somewhere?
Australia Forum Administrator #4
No, it just sends the contents of the Send box to the script engine. The only prerequisite is that scripting be enabled (which it needed to be anyway for the way you did it).

The script file is only needed if you put a function name in the Script box - in which case it looks for a function by that name in the script file.