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 ➜ General ➜ Please help me with a variable recognizing trigger, and alias switching for said

Please help me with a variable recognizing trigger, and alias switching for said

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


Posted by Mazzakazza   (2 posts)  Bio
Date Thu 12 Oct 2006 04:27 PM (UTC)

Amended on Thu 12 Oct 2006 04:29 PM (UTC) by Mazzakazza

Message
<edit>
#N.B The title should've been "Please help me with a variable recognizing trigger, and group-leading switching for said...i have no idea where alias came from...heh. </edit>
I need help with variables, basically..
My problem is:
I wish to make a trigger to respond to a line sent from a MUD.
For example:
(Channel) <whoever> says: "WARHAWK SLAY <someone>"
I have to respond to this by checking that <Whoever> is the leader of the group, and then if they -are-, following the order.
To do this...i believe i have to use a variable. Having never used these before, i decided to ask for help.
Firstly: can i set a variable which changes, when the leader of the group changes? This would be announced in a similar way to:
(Channel) <whoever> says: "<someone> is now leading the squadron."
I would then set <someone> as the variable whose orders i would auto follow though:
(Channel) <someone> says: "WARHAWK SLAY <whoever>"
I have never used variables before, as i say. So, any help is much, much appreciated. Thank you very much!
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 12 Oct 2006 11:23 PM (UTC)
Message

<triggers>

  <trigger
   custom_colour="4"
   enabled="y"
   match="(*) &lt;*&gt; says: &quot;&lt;*&gt; is now leading the squadron.&quot;"
   send_to="9"
   sequence="100"
   variable="leader"
  >
  <send>%3</send>
  </trigger>

  <trigger
   custom_colour="7"
   enabled="y"
   expand_variables="y"
   match="(*) &lt;@leader&gt; says: &quot;WARHAWK SLAY &lt;*&gt;&quot;"
   sequence="100"
  >
  <send>slay %2</send>
  </trigger>

</triggers>


The first trigger detects the change of leader and sends %3 (the name of the new leader) to the variable "leader".

The second trigger does "expand_variables" to only match on what the leader says.

- 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.


8,526 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.