Gammon Forum
Entire forum
MUSHclient
VBscript
repeat command trigger?
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Grug
(15 posts) 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) | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) 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 | top |
|
Posted by
| Grug
(15 posts) 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
| top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) 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 | top |
|
Posted by
| Grug
(15 posts) bio
|
Date
| Reply #4 on Thu 26 May 2011 10:57 AM (UTC) |
Message
| D'oh... that's... much simpler, thank you. :) | top |
|
Posted by
| Grug
(15 posts) 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? | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) 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 | top |
|
Posted by
| Grug
(15 posts) bio
|
Date
| Reply #7 on Thu 26 May 2011 11:17 PM (UTC) |
Message
| Thank you muchly! | 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.
25,576 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.