Page 1 of 1

Add auto-completion for console commands

Posted: 20 Feb 2024 14:15
by rutoks
It would be very convenient if when you type a command in the console, you can press Tab to auto complete it if it is unambiguous and display options if it is ambiguous.

Even cooler if it can use current command as a context. For example auto completion of AI names, so pressing tab will autocomplete “start_ai A” to “start_ai AdmiralAI”

Re: Add auto-completion for console commands

Posted: 22 Feb 2024 22:13
by rutoks
I have created a PR with the basic version of this feature:
https://github.com/OpenTTD/OpenTTD/pull/12163

Re: Add auto-completion for console commands

Posted: 28 Feb 2024 18:19
by agentw4b
It also lacks some form of loop to repeat.

Re: Add auto-completion for console commands

Posted: 28 Feb 2024 21:12
by jfs
The console is not a programming language.

Re: Add auto-completion for console commands

Posted: 29 Feb 2024 17:54
by agentw4b
And that's the problem, neither Gamescripts nor the console can be used to their full potential, each of them lacks some useful functions...

Re: Add auto-completion for console commands

Posted: 08 Mar 2024 23:29
by agentw4b
jfs wrote: 28 Feb 2024 21:12 The console is not a programming language.
I came across this thread, it looks like the console has some hidden features when it can handle the TCL language...but I don't know more about it.... :

viewtopic.php?t=22846

It's from 2006, it probably doesn't work anymore...maybe

Re: Add auto-completion for console commands

Posted: 09 Mar 2024 15:57
by Eddi
"autopilot" was an old method of communicating with a dedicated server, that was very vulnerable to version changes. it has been superceded by the admin port.