Repeating last command (via alias and SelectCommand/SetCommand)

Posted by Woodspiral on Wed 21 Jul 2021 04:03 PM — 4 posts, 14,041 views.

#0
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
Amended on Wed 21 Jul 2021 04:06 PM by Woodspiral
Australia Forum Administrator #1
It's built into the client.

World configuration -> Input -> Commands -> Auto-repeat command.
Australia Forum Administrator #2

Your problem was:

SetCommand(%1)

should be:

SetCommand("%1")
#3
That's brilliant, thank you Nick.