[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]  Lua
. . -> [Subject]  Sending multiple commands consecutively
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Sending multiple commands consecutively

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


Posted by Atomicoctobot   (19 posts)  [Biography] bio
Date Tue 31 Mar 2009 07:25 PM (UTC)
Message
I need to send "get shield" immediately after "stop", but I can't work out how the second command needs to be added in.

Help?

-- button 2
{
icon = "stopgetshield.png",
tooltip = "STOP/GET SHIELD",
send = "stop",
},
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 31 Mar 2009 08:03 PM (UTC)

Amended on Tue 31 Mar 2009 08:04 PM (UTC) by Nick Gammon

Message
Simplest way is to build in a linebreak:


-- button 2
{
icon = "stopgetshield.png",
tooltip = "STOP/GET SHIELD",
send = "stop\nget shield",
},


The character \n is a "newline" which means it turns the string into multiple lines. Put as many of those in as you need.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 31 Mar 2009 08:06 PM (UTC)
Message
Another way is Lua multiple-line strings:


-- button 2
{
icon = "stopgetshield.png",
tooltip = "STOP/GET SHIELD",
send = [[
stop
get shield]],
},


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Atomicoctobot   (19 posts)  [Biography] bio
Date Reply #3 on Tue 31 Mar 2009 08:21 PM (UTC)
Message
Thank you!
[Go to top] top

Posted by noident   Singapore  (3 posts)  [Biography] bio
Date Reply #4 on Tue 16 Jun 2009 01:36 AM (UTC)
Message
Sorry for dragging up an older post. Referring the code snippet:

-- button 2
{
icon = "stopgetshield.png",
tooltip = "STOP/GET SHIELD",
send = [[
stop
get shield]],
},

How would I add another command after 'get shield' which was already a pre-defined alias please?

I currently use Execute; Does that mean I need to leave the Send and issue the Execute?

Thanks.
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Tue 16 Jun 2009 07:34 AM (UTC)
Message
The commands are sent to Execute, and thus aliases will be captured.

So if your alias was "blah" just change it to:


send = [[
stop
get shield
blah]],


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by noident   Singapore  (3 posts)  [Biography] bio
Date Reply #6 on Tue 16 Jun 2009 11:14 AM (UTC)
Message
Excellent. Thanks for the clarification, Nick.
[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.


5,269 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]