Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ trigger issue with attacking different MOBs

trigger issue with attacking different MOBs

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Dragonlord   (24 posts)  Bio
Date Sat 27 Feb 2016 06:03 PM (UTC)
Message
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>
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 27 Feb 2016 08:31 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dragonlord   (24 posts)  Bio
Date Reply #2 on Sat 27 Feb 2016 09:11 PM (UTC)
Message
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
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,938 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.