Bug - Waiting for Info Debuglog while entering "x" into the CLI

Winterbay

Active member
So, I got the following debug log when I accidentally entered "x" into the CLI:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v15.9 r11918, Windows XP, Java 1.6.0_37
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Sun Feb 24 21:31:22 CET 2013
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(Unknown Source)
    at java.lang.String.substring(Unknown Source)
    at net.sourceforge.kolmafia.textui.command.CallScriptCommand.call(CallScriptCommand.java:104)
    at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:603)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:546)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:447)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:315)
    at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:190)
    at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:164)

While entering x as the only command may not be very usefulm I don't think it should generate a debug log... Also, it is repeatable (as in it happens every time if you enter x as the only command.
 

fronobulax

Developer
Staff member
r11920

I know I fixed the symptom but I'm not sure I got to the root of the problem. A comment in the code suggests that "x" is a way to run a script or a command multiple times.
 

Winterbay

Active member
The immediate bug is fixed. Should this perhaps be marked as fixed or do we want to find the real underlying cause?
 

Theraze

Active member
NumberX works like the call command multiple times. X by itself (without a leading number) does nothing, as it functions like 0X rather than 1X as people might expect.

It doesn't appear to work with gCLI commands. At least, so suggests the error message...
> 2x inv

Unable to invoke inv

> call inv

Unable to invoke inv
Whereas 2x ideas will run the ideas script twice.
 
Top