Bug - Fixed Item listed for use in CCS but not in inventory causes infinite loop when macrofied

tgetgel

Member
Set up a CCS that uses an item you don't have. KoLmafia macrofies it, and loops forever.
CCS:
Code:
[ bottles of beer on a golem ]
item chloroform rag
item love song of smoldering passion
Results with no chloroform rags nor love songs of smoldering passion in inventory:
Code:
[6445] Fernswarthy's Basement (Level 0)
Encounter: 99 Bottles of Beer on a Golem
Round 0: flyingsaucer1 wins initiative!
Round 1: flyingsaucer1 executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: flyingsaucer1 executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
...
(snipped for the sake of boring repetition)
...
Round 127: flyingsaucer1 executes a macro!
KoLmafia thinks it is round 127 but KoL thinks it is round 1
This continued until KoLmafia round 127 (KoL round 1) when I ESC'd.

Verity mentioned
Before macrofication, I think we simply skipped using items we didn't have when executing a CCS. We should probably omit the item usage from the macrofication - or abort it - when the CCS includes a missing item.

Current work around is either to buy the item or change the CCS.


Original post: http://kolmafia.us/showthread.php?3...ement-automation&p=41600&viewfull=1#post41600

Veracity reply post: http://kolmafia.us/showthread.php?3...ement-automation&p=41601&viewfull=1#post41601

Related symptom post based on the KoL round not increasing but under different bug report: http://kolmafia.us/showthread.php?3...ks-it-is-round-1&p=26763&viewfull=1#post26763
 

Winterbay

Active member
Question: What would happen if Mafia did skip the items you don't have and the CCS then comes up empty? Would that lead to an abort or something else? What did it do before in that case? (I have a really bad memory for such details...)
 

Theraze

Active member
If you had attack with weapon as your third line, would it have finished?

Basically, is the issue that you have 2 potential actions and neither of them possible, or is it actually the item portion?
 

Winterbay

Active member
I think the problem is that we have no have_item-check in the macro and Mafia does not recognise the response form KoL when you try to use a Macro without any of the wanted items in your inventory, so I don't think it would've continued even if you had had an attack-command in there. But I might be wrong.
 

tgetgel

Member
When the sync window came up, it thought I was twiddling my thumbs. This is probably because it thought I tried to use the item I did not have.

I am glad KoL does not attack when I twiddled, or the fight might not have lasted long.

How many of scenarios do we consider? Running from a command prompt, running in mafia, running a browser session, a mini-browser session, and a relay session? Are some of these the same?

Abort to user control option with a message - the action "whatever it was" could not be completed, or You don't have any whatevers.

If you skipped the action, you could end up with nothing in the CCS. What would it do then?

Another option is to purchase the item that is needed based on the existing preferences. This could empty your bank quickly.
 
Last edited:

slyz

Developer
This could empty your bank quickly.
That would be your fault for telling Mafia to use the item ^^
Although I agree that a CCS shouldn't buy items: it would surprise people, and Mafia doesn't really interpret KoL Combat Macro written in a CCS, so those would not cause a purchase.

I think the problem here is that Mafia doesn't abort when the KoL Combat Macro aborts. I would prefer Mafia to stop completely and print the macro's abort message in the gCLI.
 

Theraze

Active member
Agreed... if the macro fails, it's failed... sending it another 126 times is unlikely to make it work any better. Question is, does KoL send anything specific that we can detect on for failure?
 

Winterbay

Active member
I just tested this and the result is the following:
Code:
Could not match item(s) for use: use sharpened hubcap, sharpened hubcapYou twiddle your thumbs.
 

Theraze

Active member
Problem with that is that anytime the window fails to load and has to refresh, you get the "You twiddle your thumbs" message.

I think trapping on "Could not match item" would be better.
 
Top