Problem with a trigger

Posted by Cyrgon on Wed 13 Jun 2007 10:02 PM — 5 posts, 20,445 views.

#0
Alright, I've been trying this for a day or two now and I just can't get it right.

What I'm trying to do is this:
I want a trigger to react to a part of a line which is:

As a reward, I am giving you 51 quest points

However, I also want it to extract the numerical value, in this case 51.
Essentially react to:
As a reward, I am giving you x quest points

And then be able to use the x value for a command.
Like simply "say x"

Is it impossible or am I just a little too daft? ;)

Help would be much appreciated.
Australia Forum Administrator #1
See http://mushclient.com/faq point 31.
#2
Thanks! That helped a bit.

However, I can't quite get it to work at all.

This is how I configured my trigger:

<triggers>
<trigger
enabled="y"
match="As a reward, I am giving you * quest points"
send_to="12"
sequence="100"
>
<send>
qt = tonumber (GetVariable ("qt")) or 0
qt = qt + %1
SetVariable ("qt", qt)
</send>
</trigger>
</triggers>

And the only result is a scripting error occuring claiming "can't use parenthesis when calling a Sub" at SetVariable ("qt", qt)

I can't quite figure out what I'm doing wrong, since I'm quite new to this stuff.

Once again, help would be much appreciated :)


USA #3
It looks like you're writing Lua code, but the error message you're getting looks like VBScript. Try making sure you have the right script engine enabled for your triggers.
#4
You are correct. I just realized that ;)