[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]  VBscript
. . -> [Subject]  repeat command trigger?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

repeat command trigger?

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


Posted by Grug   (15 posts)  [Biography] bio
Date Wed 25 May 2011 07:06 PM (UTC)
Message
Sorry if this has been covered somewhere else, I couldn't find it.

Can someone help me write up a trigger that repeats the last command?

Like when the world says "you're ready!", it repeats the last command? (in a ctrl+r fashion)
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 25 May 2011 10:16 PM (UTC)
Message
In VBscript?

See:

http://www.gammon.com.au/scripts/doc.php?function=GetCommandList

Near the bottom of that is a suggested way of getting back the last command (send it rather than note it). Just make a trigger that matches what you want, do "send to script", grab the last command and send it.

- Nick Gammon

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

Posted by Grug   (15 posts)  [Biography] bio
Date Reply #2 on Thu 26 May 2011 07:55 AM (UTC)

Amended on Thu 26 May 2011 08:06 AM (UTC) by Grug

Message
Thank you, that's exactly what I needed. Works, but did I get it right?


Quote:

dim commandList
dim iCount

'
' resend last command
'
commandList = world.GetCommandList (1)

If Not IsEmpty (commandList) Then
For Each command In commandList
world.send command
Next
End If
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 26 May 2011 10:37 AM (UTC)

Amended on Thu 26 May 2011 10:38 AM (UTC) by Nick Gammon

Message
The very last entry suggested this:


'
' Get most recent command
'

  Send GetCommandList (1) (0)


That should do it.

- Nick Gammon

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

Posted by Grug   (15 posts)  [Biography] bio
Date Reply #4 on Thu 26 May 2011 10:57 AM (UTC)
Message
D'oh... that's... much simpler, thank you. :)
[Go to top] top

Posted by Grug   (15 posts)  [Biography] bio
Date Reply #5 on Thu 26 May 2011 11:05 AM (UTC)
Message
Oh, one more thing, is there a way to have it send to execute rather than the world?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 26 May 2011 09:54 PM (UTC)
Message
Replace the word Send by world.Execute.

- Nick Gammon

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

Posted by Grug   (15 posts)  [Biography] bio
Date Reply #7 on Thu 26 May 2011 11:17 PM (UTC)
Message
Thank you muchly!
[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.


6,795 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]