[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  trigger issue with attacking different MOBs
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

trigger issue with attacking different MOBs

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


Posted by Dragonlord   (24 posts)  [Biography] 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>
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by Dragonlord   (24 posts)  [Biography] 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
[Go to top] 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.


1,656 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]