[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  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] Refresh page


Posted by Woodspiral   (11 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,928 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,928 posts)  [Biography] 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
[Go to top] top

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


6,878 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 HostDash]