Auto assist trigger

Posted by Graham Hillman on Wed 06 Dec 2023 07:51 AM — 6 posts, 13,974 views.

#0
Hi could someone please help?

Complete noob here,

I am looking to create a trigger that recognises what my group buddies are attacking and automatically attack the same mob

the line it would need to recognise is;

(Person) moves aggressively toward ......

and the send text would need to be something along the lines of;

Kill .....

Could someone please help me complete the dots?

Thank you
USA Global Moderator #1
Nick made a video about how to make triggers https://www.mushclient.com/forum/?id=9626
#2
Thank you but this video doesn't really explain what i am trying to achieve.

i have managed to work out that i can do

trigger - moves aggressively towards *
send - kill %1

issue now is that where the * is, is followed by punctuation (!) and when it is sent back to the MUD it doesnt like it. Any way to remove the punctuation?


<triggers>
  <trigger
   enabled="y"
   match="moves aggressively towards *"
   sequence="100"
  >
  <send>kill %1</send>
  </trigger>
</triggers>


Thankyou
Amended on Sun 10 Dec 2023 07:00 AM by Nick Gammon
Australia Forum Administrator #3
Please copy/paste an example from the MUD of what you are trying to match on.
#4
Nick Gammon said:

Please copy/paste an example from the MUD of what you are trying to match on.


An example of that i am trying to match. (Copy and paste)

moves aggressively towards the cockroach!

where "the cockroach!" could be anything.

I have in the match box - moves aggressively toward *

I have in the send box - kill %1

Sent to the mud is - kill the cockroach!

i need to remove the ! and "the" if possible please

thank you
USA Global Moderator #5

<triggers>
  <trigger
   enabled="y"
   match="moves aggressively towards *"
   sequence="100"
   send_to="12"
  >
  <send>
    target = "%1"
    target = target:gsub("!$", ""):gsub("^the ", "")
    Send("kill " .. target)
  </send>
  </trigger>
</triggers>