Trigger wildcards having trouble

Posted by Mudgaming4life on Sat 30 Jan 2016 05:53 PM — 2 posts, 12,048 views.

#0
I'm having trouble with using wild cards in this specific instance of entering a room with 1 mobile vs entering with 2+. A coma gets added if there is more than 1 and it messes up my script.


This is with 1 mobile in it.

Also here: a beastly fido

So my trigger is just:

Quote:
<triggers>
<trigger
enabled="y"
match="Also here: *"
sequence="100"
>
<send>steal %1</send>
</trigger>
</triggers>


But it won't work if there are more than 1 mobile in the room it will send steal <all mobiles listed after Also here:>

So when I make a new trigger to deal with this issue it only works if there are multiple mobiles in the room.

Quote:
<triggers>
<trigger
enabled="y"
match="Also here: *, *"
sequence="100"
>
<send>steal %1</send>
</trigger>
</triggers>


I've been trying to learn more like making variables and using if statements but I'm just not grasping it completely.

also turning groups of triggers on/off is hanging me up so I usually just copy the group manually then delete it when I don't use those triggers and then later to repaste them in my trigger folder when I'm ready to use them again. How do I check to see if a group of triggers is on/off manually?


I've got a ton of questions but I'll stop right here so I won't get confused with answers! Thanks in advance for your time!
Australia Forum Administrator #1
To handle multiple mob names, you can do some post-processing in Lua, like this:


<triggers>
  <trigger
   enabled="y"
   match="Also here: *"
   send_to="12"
   sequence="100"
  >
  <send>

for mobname in string.gmatch ("%1", "%a+") do
  Send ("steal ", mobname)
end -- for loop</send>

  </trigger>
</triggers>


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





Quote:

How do I check to see if a group of triggers is on/off manually?


You loop through the group and see if they are on or off. It sounds bad, but is only a couple of lines of code. I'm sure this has been asked before, try searching for it.