[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Total Newb Question on Alias
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Total Newb Question on Alias

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Pgolds   USA  (5 posts)  [Biography] bio
Date Sun 16 Aug 2009 01:13 PM (UTC)
Message
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.
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #1 on Sun 16 Aug 2009 11:17 PM (UTC)

Amended on Sun 16 Aug 2009 11:31 PM (UTC) by Blainer

Message
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
[Go to top] top

Posted by Pgolds   USA  (5 posts)  [Biography] bio
Date Reply #2 on Sun 16 Aug 2009 11:57 PM (UTC)
Message
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?
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #3 on Mon 17 Aug 2009 12:45 AM (UTC)
Message
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.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


3,121 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]