Expand variables and Keep evaluating

Posted by Ksajal on Thu 28 Apr 2011 08:50 AM — 6 posts, 26,211 views.

#0
I've been trying to get the actual text (another player's name) that the following trigger matches and add it to a table:

<trigger
   enabled="y"
   expand_variables="y"
   group="System_Tracking"
   keep_evaluating="y"
   match="@!highlight_enemies"
   name="get_toenemy"
   regexp="y"
   repeat="y"
   sequence="1"
  >
  <send>table.insert (to_enemy, "%0")</send>
  </trigger>

Highlight_enemies looks like this "Bob|John|Mark", and the trigger WILL match more than once on the same line.

"%0" stores the pattern, and not the matching text, any suggestions how I can make it work?
Amended on Thu 28 Apr 2011 08:51 AM by Ksajal
Australia Forum Administrator #1
You are not sending to script, so I can't see how that can begin to work.
#2
Yes, sorry, I don't know how that happened
Here it is:

<trigger
   expand_variables="y"
   group="System_Tracking"
   keep_evaluating="y"
   match="@!highlight_enemies"
   name="get_toenemy"
   regexp="y"
   repeat="y"
   send_to="12"
   sequence="1"
  >
  <send>table.insert (to_enemy, "%0")
Note ("%0")</send>
  </trigger>

It only prints the first matching name.
USA #3
Huh. I can reproduce this:

<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   ignore_case="y"
   keep_evaluating="y"
   match="Bob|George|Paul"
   regexp="y"
   repeat="y"
   send_to="12"
   sequence="100"
  >
  <send>Note("%0")</send>
  </trigger>
</triggers>


Simulate("Bob, George, Paul\r\n")


All three names are highlighted, but only Bob is echoed.
Australia Forum Administrator #4
When you check "repeat on same line" that refers to highlighting. It doesn't do the action multiple times (eg. call a script, send a response).

You need to match the entire line, and then in a script work out which ones to add to your table.
#5
Thanks, I did just that.