trigger issue with attacking different MOBs

Posted by Dragonlord on Sat 27 Feb 2016 06:03 PM — 3 posts, 14,805 views.

#0
I would like to clean this up a little. I know there is a way to set it for each MOB that is listed to be looked at one at a time. I am not sure if I am making sense with what I want, so please look at the two different layout that i have:
(1)

<triggers>
<trigger
enabled="y"
group="PG Combat"
ignore_case="y"
keep_evaluating="y"
match="You sense a hidden life form in the area."
regexp="y"
send_to="10"
sequence="100"
>
<send>k kender
k ass
k imp
k goblin
k fey
k kobold</send>
</trigger>
</triggers>

(2)
This one reads my send command as one line: I.E: k (kenderassimpgoblinfeykobold)

<triggers>
<trigger
enabled="y"
group="PG Combat"
ignore_case="y"
keep_evaluating="y"
match="You sense a hidden life form in the area."
regexp="y"
send_to="10"
sequence="100"
>
<send>k (kender|ass|imp|goblin|fey|kobold)</send>
</trigger>
</triggers>
Australia Forum Administrator #1
You could do it with a bit of scripting:


<triggers>
  <trigger
   enabled="y"
   group="PG Combat"
   ignore_case="y"
   keep_evaluating="y"
   match="You sense a hidden life form in the area."
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>

mobs = "kender|ass|imp|goblin|fey|kobold"
for mob in string.gmatch (mobs, "%a+") do
  Send ("k ", mob)
end -- for

</send>
  </trigger>
</triggers>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


That uses string.gmatch to iterate over a string, pulling out each word. Then in the loop you send "k" followed by the mob name.
#2
Thank you. Once I got it set for script. It started working I think I understand some of the reasons my other trigger isn't working now