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

Posted by Mazzakazza on Thu 12 Oct 2006 04:27 PM — 2 posts, 10,837 views.

#0
<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!
Amended on Thu 12 Oct 2006 04:29 PM by Mazzakazza
Australia Forum Administrator #1

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