Feature Abort combat if item in ccs doesn't exist

matt.chugg

Moderator
I'm not quite sure whether this is a macro issue KoL-side or a mafia issue but:

if the last line in your ccs is "item:xxxx" and you don't have any of such an item, kol goes into a loop of repeatedly trying to use a macro.

Code:
KoLmafia thinks it is round 181 but KoL thinks it is round 1
Round 181: mskc executes a macro!
KoLmafia thinks it is round 182 but KoL thinks it is round 1
Round 182: mskc executes a macro!
KoLmafia thinks it is round 183 but KoL thinks it is round 1
Round 183: mskc executes a macro!
KoLmafia thinks it is round 184 but KoL thinks it is round 1
Round 184: mskc executes a macro!
KoLmafia thinks it is round 185 but KoL thinks it is round 1
Round 185: mskc executes a macro!
KoLmafia thinks it is round 186 but KoL thinks it is round 1
Round 186: mskc executes a macro!

I manually aborted and looked in the request sync browser and it says

Code:
Could not match item(s) for use: use 3120You twiddle your thumbs.
(which incidently seems to be missing a line break, or a space!)

obviously i'd run out of divine blowouts!

but if I hadn't switched back to look how I was getting on, i'm not sure how long that would have kept hitting the server.

(yes i'm aware that this is essentially a bug in my brain, but it would be nice if KoLmafia could cope with my level of stupidity! :p )
 

jasonharper

Developer
Item usage in macrofied combat is fundamentally broken, and is going to remain fundamentally broken until such time as KoL's combat macro handling is finished. In particular, there's no way to tell if an item can be safely funkslung - you can only check for a single item in inventory.
 

slyz

Developer
I guess it's safer to add an abort as your last line. What happens if you change the end of your CCS to this:
Code:
"item xxx"
"repeat"
abort
 

Bale

Minion
That'd do the same thing. The macro would never get to the abort command. To fix it you'd need

Code:
mark useblowout
if hascombatitem divine blowout
   use divine blowout
endif
goto useblowout
abort

Anyway, I suspect matt.chugg knows that and just feels that the hascombatitem predicate should always be checked before using an item. Unfortunately KoL's handling of combat items is not finished as jason points out, so he cannot create a complete solution.
 
Last edited:

slyz

Developer
That solves the problem of the KoL Macro not aborting, yes, but I was looking for a simple way to avoid having Mafia endlessly repeat the last line of the CCS if that line causes problems.
With my solution, Mafia simply resubmits the macro generated the first time around, so it doesn't work. I guess the solution lies in making fool-proof CCSs.
 
Top