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 ➜ Repeating last command (via alias and SelectCommand/SetCommand)

Repeating last command (via alias and SelectCommand/SetCommand)

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


Posted by Woodspiral   (11 posts)  Bio
Date Wed 21 Jul 2021 04:03 PM (UTC)

Amended on Wed 21 Jul 2021 04:06 PM (UTC) by Woodspiral

Message
Hi,

I'd like to set my command text so that the text is always the last command I typed, and it's all highlighted (so if I type a new command it overwrites the last one).

I tried this:

Alias: ^(.*?)%
Send to: Script
Script:
SelectCommand()
SetCommand(%1)
SelectCommand()

Which generates this:

[string "Alias: "]:2: bad argument #1 to 'SetCommand' (string expected, got nil)
stack traceback:
[C]: in function 'SetCommand'
[string "Alias: "]:2: in main chunk

Also there should be a flag which sends the command on for execution...

Any pointers appreciated!

Thanks,
Woody
Top

Posted by Nick Gammon   Australia  (23,097 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 22 Jul 2021 03:56 AM (UTC)
Message
It's built into the client.

World configuration -> Input -> Commands -> Auto-repeat command.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,097 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 22 Jul 2021 03:59 AM (UTC)
Message

Your problem was:

SetCommand(%1)

should be:

SetCommand("%1")

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Woodspiral   (11 posts)  Bio
Date Reply #3 on Thu 22 Jul 2021 03:32 PM (UTC)
Message
That's brilliant, thank you Nick.
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.


9,107 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.