Which one is executed/called first by a trigger? SEND or SCRIPT?

Posted by VBMeireles on Sat 26 Mar 2016 01:41 AM — 3 posts, 15,647 views.

Brazil #0
In my send field (the big box) I have the following:

function_a()


In my script field (the small box below "label" and above "group") I have the following:

function_b


Which one is going to be executed first when the trigger fires?
Australia Forum Administrator #1
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6554

It's probably a lot quicker to do a test trigger than ask here. :)
Australia Forum Administrator #2
I made a test trigger (you could have done that):


<triggers>
  <trigger
   enabled="y"
   match="You do not have that item."
   script="bar"
   send_to="12"
   sequence="100"
  >
  <send>print "foo"</send>
  </trigger>
</triggers>


The function "bar" is:


function bar ()
  print "bar"
end -- bar


Testing printed:


foo
bar