Total Newb Question on Alias

Posted by Pgolds on Sun 16 Aug 2009 01:13 PM — 4 posts, 20,951 views.

USA #0
Hi.

I have several variables:
MainWeapon
StabWeapon
CurrentWeapon

CurrentWeapon is set with triggers depending on which weapon was wielded last.

I'm trying to set up an alias (stab) that checks if my CurrentWeapon is not equal to my StabWeapon and then wields the StabWeapon.

Similarly, I want to set up an alias (main) that checks if my CurrentWeapon is not equal to my MainWeapon and then wields the MainWeapon.

I can't seem to get the syntax right. The triggers that set CurrentWeapon are working correctly.

Any assistance would be appreciated.
#1
These should work.


<aliases>
  <alias
   match="Stab"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>
if "@CurrentWeapon" ~= "@StabWeapon" then
   SendNoEcho ("wield @StabWeapon")
end
  </send>
  </alias>
</aliases>



<aliases>
  <alias
   match="Main"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>
if "@CurrentWeapon" ~= "@MainWeapon" then
   SendNoEcho ("wield @MainWeapon")
end
  </send>
  </alias>
</aliases>


By the way if you post the aliases that have syntax error we can find out what
was wrong with them. :)

Full cut and paste aliases, triggers and timers instructions can be found here:
http://www.gammon.com.au/forum/?id=4777
Amended on Sun 16 Aug 2009 11:31 PM by Blainer
USA #2
Thanks. I didn't know the ~= syntax. I got it working with the following code:

<aliases>
<alias
match="stab"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>
if not ("@CurrentWeapon" == "@StabWeapon") then
Send "wield @StabWeapon"
end
</send>
</alias>
</aliases>

I need to get more familiar with the 'SendNoEcho' command. Is there a way to make that the default?
#3
I didn't know you could do it that way thanks.

The link below has the following info.

This sends the specified text to the world. It is like typing it into the command window. The command is not echoed in the output window.
http://mushclient.com/scripts/doc.php?function=SendNoEcho

You can set MUSH to not echo your Input in Game > Configure > Commands.