| Message |
You are confusing two techniques here. The @variable substitution is done in the "send" text, not in the script file. You also can omit "world." to save typing.
Here is one method of doing it:
sub dualwield (name, line, wildcards)
dim weapon3
dim weaponl
dim weaponr
weapon3 = GetVariable ("weapon3")
weaponl = GetVariable ("weaponl")
weaponr = GetVariable ("weaponr")
Send "relax grip"
DoAfter 4, "Put " & weapon3 & " in pack"
DoAfter 6, "get " & weaponl & " from pack"
DoAfter 8, "get " & weaponr & " from pack"
DoAfter 10, "wield " & weaponl & " left"
DoAfter 14, "wield " & weaponr & " right"
DoAfter 17, "grip"
end sub
You can also make it shorter by getting the variables as you need them:
sub dualwield (name, line, wildcards)
Send "relax grip"
DoAfter 4, "Put " & GetVariable ("weapon3") & " in pack"
DoAfter 6, "get " & GetVariable ("weaponl") & " from pack"
DoAfter 8, "get " & GetVariable ("weaponr") & " from pack"
DoAfter 10, "wield " & GetVariable ("weaponl") & " left"
DoAfter 14, "wield " & GetVariable ("weaponr") & " right"
DoAfter 17, "grip"
end sub
However the simple approach, which lets you use the @weapon3 technique, is to simply do the whole thing inside the alias, with "send to script":
<aliases>
<alias
match="dualwield"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send> world.Send "relax grip"
world.DoAfter 4, "Put @weapon3 in pack"
world.DoAfter 6, "get @weaponl from pack"
world.DoAfter 8, "get @weaponr from pack"
world.DoAfter 10, "wield @weaponl left"
world.DoAfter 14, "wield @weaponr right"
world.DoAfter 17, "grip"
</send>
</alias>
</aliases>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|