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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  IF statements in an alias

IF statements in an alias

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


Posted by Tenzyyy   (2 posts)  [Biography] bio
Date Mon 04 Jan 2010 07:53 AM (UTC)
Message
I am making a alias to attack a target. I have variable shieldup and reboundingup to be set to 1 or 0 (1 means shield/rebounding is up and I have to raze instead of dsl).

I am curious on how I make an if statement to check that these are both 0 then DSL @target or if one is set to 1 or both then RAZE @target.

Thanks!
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #1 on Mon 04 Jan 2010 08:01 AM (UTC)
Message
Assuming you haven't changed the script language setting, your scripting language will probably be Lua. The example below assumes you're using Lua.

Firstly, you want to set the "Send to" dropdown to "Script". This changes where the big Send box's contents are sent. By default, it's World, which means its contents are sent just like you typed them into the command bar and hit enter. But Script is different - you can't put loose commands in, you have to use the scripting functions and statements.

Example script:
if @shieldup == 1 or @reboundingup == 1 then
  Send("raze @target")
else
  Send("dsl @target")
end


Hope that helps! Also, if you want to learn more about Lua, this guide is fantastic [1].

[1] http://www.lua.org/pil/

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Tenzyyy   (2 posts)  [Biography] bio
Date Reply #2 on Mon 04 Jan 2010 08:02 AM (UTC)
Message
thanks a lot for the quick response. I'll give it a shot.
[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.


9,178 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 HostDash]