[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]  If statements without scripting?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

If statements without scripting?

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


Posted by Cooldown   (18 posts)  [Biography] 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.
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] 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
[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.


4,466 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]