Feature How to script switching to gCLI tab

Is there a way to script switching to the gCLI tab?

There are CLI commands "chat", "gear", "item", "mail", etc, to switch to those places. So I can cli_execute("gear"), for instance, to switch to the gear tab. But I can't find one to switch to the gCLI itself.

(One of my scripts uses a user_confirm(), and I'd like to be able to see the gCLI's record when choosing a response to the user_confirm().)
 

lostcalpolydude

Developer
Staff member
Code:
new WindowOpenCommand().register( "chat" ).register( "mail" ).registerPrefix( "opt" ).register( "item" ).register( "gear" ).register( "radio" );
Those are the windows it's set up for. I didn't even know that was a thing.
 
It's not mission-critical in any way, but I'd like to make this a Feature Request, assuming it wouldn't take a ton of development work (copy/paste with minor modifications from the other commands).

maybe cli_execute("gcli")

I don't think I can move it to Bug Reports. Would someone please help me out?
 
Yeah, it does sound pretty absurd at first blush. But it would be just as useful as any of the other CLI focus-switching commands.

(If it's easier to do it by an ASH command rather than a CLI command, that would be just as good. And sound less ridiculous. Heh.)
 
Found myself wanting this feature again, so just bumping the thread.

I made a diff file for getting this to work on my side. Not sure if this is the correct way to do it but it seemed similar to the other Window Open behaviors.

Code:
Index: src/net/sourceforge/kolmafia/textui/command/WindowOpenCommand.java
===================================================================
--- src/net/sourceforge/kolmafia/textui/command/WindowOpenCommand.java	(revision 17270)
+++ src/net/sourceforge/kolmafia/textui/command/WindowOpenCommand.java	(working copy)
@@ -78,6 +78,12 @@
 			return;
 		}
 
+		if ( command.equals( "cli" ) )
+		{
+			KoLmafiaGUI.constructFrame( "CommandDisplayFrame" );
+			return;
+		}
+
 		if ( command.equals( "radio" ) )
 		{
 			RelayLoader.openSystemBrowser( "http://209.9.238.5:8794/listen.pls" );
Index: src/net/sourceforge/kolmafia/KoLmafiaCLI.java
===================================================================
--- src/net/sourceforge/kolmafia/KoLmafiaCLI.java	(revision 17270)
+++ src/net/sourceforge/kolmafia/KoLmafiaCLI.java	(working copy)
@@ -888,7 +895,7 @@
 		new WikiMafiaSearchCommand().register( "ashwiki" );
 		new WikiSearchCommand().register( "wiki" );
 		new WindowOpenCommand().register( "chat" ).register( "mail" ).registerPrefix( "opt" ).register( "item" ).register(
-			"gear" ).register( "radio" );
+			"gear" ).register( "radio" ).register( "cli" );
 		new WinGameCommand().register( "win game" );
 		new WitchessCommand().register( "witchess" );
 		new WumpusCommand().register( "wumpus" );
 
Top