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 ➜ Tips and tricks ➜ Help with a trigger

Help with a trigger

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


Posted by AquaBrother   Brazil  (19 posts)  Bio
Date Sun 07 Oct 2007 09:28 PM (UTC)

Amended on Sun 07 Oct 2007 09:29 PM (UTC) by AquaBrother

Message
hi, i have a trigger like: ^(?P<target>.*) told \'fly\'$
and in the send box: cast fly %<target>
i'd like to make a list of ppl which my trigger would not launch the fly spell, something like this:
if %<target> is not (ppl1|ppl2|and so on)
cast fly %<target>

was i clear? hehe...

hope you can help me, thanks anyway for your supporting will :D
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 07 Oct 2007 11:57 PM (UTC)
Message
Something like this should work - we use scripting to make a decision:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="^(?P&lt;target&gt;[A-Za-z]+) told \'fly\'$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>

target = "%&lt;target&gt;"

-- build exclusions table by key
if not exclusions then

  exclusions = {}

  for k, v in ipairs {

    "person1",
    "person2",
    "person3",  
    -- and so on

    } do
    exclusions [v] = true
  end -- for loop

end -- table not built yet

if not exclusions [target] then
  Send ("cast fly " .. target)
end -- if not in exclusions table

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



- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


11,324 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.