OK - I have worked out a replacement for that, I think. :)
MUSHclient doesn't let you put variable names into the trigger match text (however you can use them in the trigger response), so as I see it you have three steps here:
1. Define who the leader is, so the first trigger matches properly.
2. Make a trigger that matches on the leader sending the TEST line
3. Make a trigger that matches when the leader changes targets
First, I made an alias to detect the name of the leader changing:
Alias: LEADER *
Enabled: checked
Label: Leader
Script: OnLeader
Then add the following lines to your script file, or make a new script file with them in it. Language: VBscript.
sub OnAddTarget (strTrigger, strLine, strWildcardsArray)
dim leader
dim target
leader = world.getvariable ("leader")
' flags =
' 1 = enabled
' 32 = regular expression
' 1024 = replace existing trigger of same name
world.AddTrigger "PickUpTarget", _
"^" + leader + " " + _
strWildcardsArray (1) + "(.+)", _
"", 1 + 32 + 1024, -1, 0, "", _
"OnNewTarget" ' function to call
end sub
sub onNewTarget (strTrigger, strLine, strWildcardsArray)
world.setvariable "target", strWildcardsArray (1)
world.note "Target is >> " + strWildcardsArray (1) + " <<"
end sub
sub OnLeader (strAlias, strLine, strWildcardsArray)
world.setvariable "leader", strWildcardsArray (1)
world.AddTrigger "LeaderEmote", _
strWildcardsArray (1) + _
" (.*)TEST(.*)", _
"", 1 + 32 + 1024, -1, 0, "", _
"onAddTarget" ' function to call
world.note "Leader is >> " + strWildcardsArray (1) + " <<"
end sub
There are three subroutines (subs) here, which I have made in bold, although in practice you would not use bold.
OnLeader is called from the alias, and adds the trigger "LeaderEmote" which matches on the name of the leader (wildcard 1) saying (.*)TEST(.*). It also displays the leader name on the output window as confirmation that it matched. Note the alias is case-sensitive.
Thus, you might type:
LEADER Ohio
Then when the leader emotes his line "Ohio will send the TEST to the moon!" this calls the trigger labelled LeaderEmote which calls the sub OnAddTarget.
This sub generates the third trigger, that matches on the target's name.
Have fun with it. :)