Trigger help

Posted by Talahari on Wed 11 Apr 2007 12:29 AM — 3 posts, 16,103 views.

#0
Alright, Im still learning this whole scriptoing trigger thing...could one of you really smart guys tell me how I need to do this simple task. I am writing a trigger simaler to

You say, test *

then I wish it to print %1 + 1 so when i say "test 1" itll print "test 2".

any ideas?
USA #1
If you are using Lua, then it would be this:
<triggers>
  <trigger
   enabled="y"
   match="You say, test *"
   send_to="12"
   sequence="350"
  >
  <send>print( "test "..tonumber(%1)+1 )
</send>
  </trigger>
</triggers>

I also note that there are no quotes around test 1 in your example. You might have to put them in so the match would be something more similar to:
match="You say, 'test *'"
Amended on Wed 11 Apr 2007 01:05 AM by Shaun Biggs
Australia Forum Administrator #2
In "send to script" the substitution is done literally, so this would also work:


<triggers>
  <trigger
   enabled="y"
   match="You say, test *"
   send_to="12"
   sequence="350"
  >
  <send>print( "test ", %1 + 1 )
</send>
  </trigger>
</triggers>