Feature use command, lag & default combat action

It's not a bug, but sometimes it causes trouble:
Wait while there is some lag on server's side->execute use x something (mmj for example)-> start fight while command is still executing (before you see message "Finished using x something" in CLI). Result: fight will be finished with your default combat action (toss in my example). When it's not appropriate for current fight, it may lead to wasted turn & beaten-up effect.
http://195.70.211.9/files/mmj_lag_macro.png


Expected feature: flag "stop executing use command while in fight", that you may set in ini file and that will be checked before executing default combat action while executing use command. If flag is set and you're in fight, just stop executing use command to allow user solve this issue manually.

Maybe it's already implemented. I just can't find anything appropriate in ini file :(

---
NightBird
 

slyz

Developer
You started the fight manually, in the relay browser, and Mafia ran it like if it was an automated combat?
 

Theraze

Active member
What version of mafia? Veracity has been fixing some of the "use an item in the relay browser and adventuring while it's still processing" bugs lately.
 

slyz

Developer
Ok, I was able to reproduce this with r10330:
Code:
> use 1 Dyspepsi-Cola

Searching for "Dyspepsi-Cola"...
Search complete.
Purchasing Dyspepsi-Cola (1 @ 104)...
You acquire an item: Dyspepsi-Cola
Purchases complete.
Using 1 Dyspepsi-Cola...

[19949] Spooky Forest
Encounter: spooky vampire
Strategy: item spices
Round 0: slyz wins initiative!
Round 1: slyz executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
KoLmafia thinks it is round 3 but KoL thinks it is round 1
You're on your own, partner.
Click here to continue in the relay browser.

KoLmafia thinks it is round 4 but KoL thinks it is round 1
The fight stopped with the following message in the relay browser:
Code:
Could not match item(s) for use: use 8You twiddle your thumbs.
but the point is that Mafia did try to automate the relay browser fight.

Timing this wasn't easy, I had to click the adventure link after the purchase was done, but before the using actually began.

Hitting the adventure link during the purchase resulted in a debug log:
Code:
> use 1 Dyspepsi-Cola

Searching for "Dyspepsi-Cola"...

[19948] Spooky Forest
Search complete.
Purchasing Dyspepsi-Cola (1 @ 104)...
Unexpected error, debug log printed.
Purchasing Dyspepsi-Cola (1 @ 104)...
Unexpected error, debug log printed.
Purchasing Dyspepsi-Cola (1 @ 104)...
Encounter: warwelf
Round 0: slyz wins initiative!
Code:
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 net.sourceforge.kolmafia.request.GenericRequest.parseResults(GenericRequest.java:2078)
	at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:1846)
	at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1766)
	at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1500)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1249)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1157)
	at net.sourceforge.kolmafia.request.PurchaseRequest.run(PurchaseRequest.java:288)
	at net.sourceforge.kolmafia.request.MallPurchaseRequest.run(MallPurchaseRequest.java:147)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:122)
	at net.sourceforge.kolmafia.KoLmafia.makePurchases(KoLmafia.java:1649)
	at net.sourceforge.kolmafia.KoLmafia.makePurchases(KoLmafia.java:1573)
	at net.sourceforge.kolmafia.session.InventoryManager.retrieveItem(InventoryManager.java:638)
	at net.sourceforge.kolmafia.session.InventoryManager.retrieveItem(InventoryManager.java:286)
	at net.sourceforge.kolmafia.session.InventoryManager.retrieveItem(InventoryManager.java:281)
	at net.sourceforge.kolmafia.request.UseItemRequest.run(UseItemRequest.java:1060)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:122)
	at net.sourceforge.kolmafia.textui.command.UseItemCommand.use(UseItemCommand.java:203)
	at net.sourceforge.kolmafia.textui.command.UseItemCommand.run(UseItemCommand.java:71)
	at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:532)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:488)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:391)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:174)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:156)
 

Veracity

Developer
Staff member
We lock out adventuring in the Relay Browser while the Mood Manager is executing or we are Recovering HP or MP or burning buffs. We do not lock it out if you happen to be executing something else from within KoLmafia. In particular, in this case, a "use" command from the CLI (which can also do purchases, as slyz demonstrated).

There is another feature request suggesting that we lock out adventuring if KoLmafia is executing a script. That is related to this one.
 
Top