Add auto-completion for console commands

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
rutoks
Engineer
Engineer
Posts: 2
Joined: 20 Feb 2024 14:11

Add auto-completion for console commands

Post 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”
rutoks
Engineer
Engineer
Posts: 2
Joined: 20 Feb 2024 14:11

Re: Add auto-completion for console commands

Post by rutoks »

I have created a PR with the basic version of this feature:
https://github.com/OpenTTD/OpenTTD/pull/12163
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Add auto-completion for console commands

Post by agentw4b »

It also lacks some form of loop to repeat.
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
User avatar
jfs
Tycoon
Tycoon
Posts: 1764
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Add auto-completion for console commands

Post by jfs »

The console is not a programming language.
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Add auto-completion for console commands

Post 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...
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Add auto-completion for console commands

Post 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
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: Add auto-completion for console commands

Post 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.
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 19 guests