comparing 2 variables

Posted by Scouse on Fri 16 Sep 2005 07:33 AM — 3 posts, 16,077 views.

#0
what i wish to do , is to capture a variable , and set a variable , then compare the 2 and act upon them if circumstance dictates it .

so , my one is set by thus :-

<aliases>
<alias
name="target"
match="tar *"
enabled="y"
expand_variables="y"
variable="target"
send_to="9"
ignore_case="y"
keep_evaluating="y"
sequence="100"
>
<send>%1</send>
</alias>
</aliases>

my 2nd is set thus :-

<triggers>
<trigger
match="* leaves *"
send_to="9"
sequence="100"
variable="target2"
>
<send>%1</send>
</trigger>
</triggers>

what i wish to do is to compare them and then if they are the same to head in direction %2 and K @target .

it seems like i should be able to use *leaves * to run it but i cant figure out how .

so , a train of action ..

tar paddic. - sets target as Paddic

billy leaves north. - sets target 2 as billy , compares it to target and does nothing.
betty leaves north. - sets target 2 as betty , compares it to target and does nothing.
Paddic leaves west. - sets target2 as Paddic , compares it to target , sees it as a match .
sends :-
west
K @target
#1
This is actually really easy.

This is so easy you're gonna cry when you see it.

Your alias is fine.

Your compaing 2 variables is redundant. Just use this trigger:

<triggers>
<trigger
enabled="y"
expand_variables="y"
ignore_case="y"
match="@target leaves *"
sequence="100"
>
<send>%1
k @target</send>
</trigger>
</triggers>
Amended on Fri 16 Sep 2005 09:33 AM by David Berthiaume
#2
Yep, I just tested it, it works like a charm.