Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ General ➜ If statements without scripting?

If statements without scripting?

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


Posted by Cooldown   (18 posts)  Bio
Date Thu 19 Nov 2009 03:07 PM (UTC)
Message
When I try to use an if statement in a trigger, it doesn't work. It either sends it to the mud or just does nothing. Do if statements have to be used in scripts? And if so, how would I later send commands back to the mud? Sorry, I just started using Mushclient.
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #1 on Thu 19 Nov 2009 03:45 PM (UTC)
Message
Yes, any if's or logic would need to be done in a script, or in the trigger's Send field when the Send To field is set to Script.

Syntax depends on what scripting language you prefer to use (which should generally be done in one you know :)). If you're learning how to write scripts in general, I'd recommend Lua for Mushclient. It's the default, it's easy enough to learn, and it's very powerful and flexible once you build upon your understanding of it.


if AtticIsBetter == true then
  Send ("burp")
else
  Send ("fart")
end



There's a tutorial, with outdated screenshots but still relevant steps, located at http://www.mushclient.com/scripting
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.


13,814 views.

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

Go to topic:           Search the forum


[Go to top] top

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