Feature Don't attempt to use skills when you don't have the item equipped which allows it

DoctorRotelle

Developer
When I script a KoL macro, I can put in skills that I cannot actually use like static shock or evil grin. Without the proper item equipped, it ignores it and the macro moves on. I'd like to see mafia use this method for skipping unusable skills, as it is one of the ways the KoL & mafia round counters can deviate. (To see this activity, add "skill static shock" to your ccs and don't equip the red-and-green sweater.)

Additionally, I'd like mafia to create a usable macro when it is given vague stasis data. What I mean by this is when I have "use spices" in a ccs, mafia could create and submit a macro that uses turtle totems or something similar when I've cooked up all my spices vs sending KoL a macro that immediately aborts on the KoL side.

-=DoctorRotelle
 

DoctorRotelle

Developer
Oh, I must not have written that clearly. I don't use KoL macros, mafia makes them on-the-fly. It is the "conversion" I've referred to in both instances I laid out above. When I write up a ccs entry, is what I'm referring to, the proposed macro stuff can be used to create the same logic within mafia's ccs->macro conversion routine.

The main issue I have is that I can't select a macro in mafia in a ccs, and setting KoL's auto-attack to a macro won't allow me to account for misc monster appearances like the FoB monsters (which require some special attention from a scaling monster consult script.), without writing an insanely huge macro to accommodate all the variations I have in my Custom Combat setup...

Hope that helps make it a bit clearer...
-=DoctorRotelle
 

jasonharper

Developer
This seems backwards; if you try to use a skill you don't actually have in a KoL macro, an abort will result unless you put a hasskill check around it. Macrofied CCS's already put that check in for you, to match the old round-by-round CCS behavior of just going on to the next line if a skill use didn't work. The only problem is that it may do MP restoration for the unavailable skill, since there's no current way to distinguish insufficient MP from permanent unavailability. Some recent bug reports seem to indicate that hasskill still isn't working quite right on the server, so that may explain the problems you're seeing.

There is already precedent for interchangeable combat items in mafia - "item dictionary" and "item facsimile dictionary" will automatically use the other form, if that's what you have at the moment. It seems reasonable that spices, turtle totems, and seal teeth could be handled the same way.
 

DoctorRotelle

Developer
Macrofied CCS's already put that check in for you, to match the old round-by-round CCS behavior of just going on to the next line if a skill use didn't work.

Sorry, this behavior seems improper, and is not happening as expected. Ergo, why send an unusable skill in a macro to KoL when mafia could pre-determine it is not available? Along with the spices -> turtle totem conversion thing, this could be handled "pre-macroify".

I have a CCS for the boss bat that reads:
[ boss bat ]
item divine champagne popper
abort

Without a popper in inventory, mafia loops indefinitely as opposed to aborting and throwing out the mini-browser, causing apparent non-stop server hits and filling my mafia gCLI screen with errors. If I have a bogus "skill static shock", mafia sends it to KoL where another error occurs if the sweater is not equipped, each and every combat.

My fantasy is to have it behave properly by aborting, or actually, move on before being turned into a macro within mafia and sent to KoL. The hope is to allow the bell (yes, there's more I'd like to add such as a couple of IotM related skills, which aren't yet checked by mafia, as stated above):
[ boss bat ]
item harold's bell
item divine champagne popper
skill Creepy Grin
skill Give Your Opponent the Stinkeye
attack

Sure, I could write a consult script, which forces mafia to not macro-ify, but that's not very fun for others... And the opposite of my intent... When macro's work, they are sheer bliss!

I hope this sparks some fresh ideas,
-=DoctorRotelle
 

slyz

Developer
Could you set the macroDebug property to true and copy here what macro Mafia sends when you try to use static shock without the sweater? If Mafia correctly puts the hasskill predicate, then the problem is with KoL, not Mafia.

EDIT: Doing the same thing with an item you know you don't have could be helpful too.
 

DoctorRotelle

Developer
hasskill is certainly in there. as you say. i'm just thinking it is less server intensive if the request doesn't appear at all (and only after it is fixed).
and the apparently endless server hits aren't a happy thing:
[3276] The Outer Compound
Encounter: guard turtle
Strategy: C:\Documents and Settings\Administrator\My Documents\Mafia\ccs\stasis.ccs [guard turtle]
Round 0: ZoeHarriet loses initiative!
Generated macro:
abort hppercentbelow 25
sub mafiaround
endsub#mafiaround
sub mafiamp
call mafiaround; use 3697
mark mafiampexit
endsub#mafiamp
#mafiaheader
mark mafiafinal
while mpbelow 3
call mafiamp
endwhile
if hasskill 7083
call mafiaround; skill 7083
endif
goto mafiafinal

Round 1: ZoeHarriet executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: ZoeHarriet executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
Round 3: ZoeHarriet executes a macro!
KoLmafia thinks it is round 4 but KoL thinks it is round 1
Round 4: ZoeHarriet executes a macro!
KoLmafia thinks it is round 5 but KoL thinks it is round 1
Round 5: ZoeHarriet executes a macro!
KoLmafia thinks it is round 6 but KoL thinks it is round 1
Round 6: ZoeHarriet executes a macro!
KoLmafia thinks it is round 7 but KoL thinks it is round 1
Round 7: ZoeHarriet executes a macro!
KoLmafia thinks it is round 8 but KoL thinks it is round 1
Round 8: ZoeHarriet executes a macro!
KoLmafia thinks it is round 9 but KoL thinks it is round 1
Round 9: ZoeHarriet executes a macro!
KoLmafia declares world peace.

and for item use, the abort doesn't happen as expected either:
Generated macro:
abort hppercentbelow 25
sub mafiaround
endsub#mafiaround
sub mafiamp
call mafiaround; use 3697
mark mafiampexit
endsub#mafiamp
#mafiaheader
summonspirit
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
mark mafiafinal
call mafiaround; attack
goto mafiafinal

Round 1: ZoeHarriet executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: ZoeHarriet executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
Round 3: ZoeHarriet executes a macro!
KoLmafia thinks it is round 4 but KoL thinks it is round 1
Round 4: ZoeHarriet executes a macro!
KoLmafia thinks it is round 5 but KoL thinks it is round 1
Round 5: ZoeHarriet executes a macro!
KoLmafia thinks it is round 6 but KoL thinks it is round 1
Round 6: ZoeHarriet executes a macro!
KoLmafia thinks it is round 7 but KoL thinks it is round 1
Round 7: ZoeHarriet executes a macro!
KoLmafia thinks it is round 8 but KoL thinks it is round 1
Round 8: ZoeHarriet executes a macro!
KoLmafia thinks it is round 9 but KoL thinks it is round 1
Round 9: ZoeHarriet executes a macro!
KoLmafia thinks it is round 10 but KoL thinks it is round 1
Round 10: ZoeHarriet executes a macro!
KoLmafia thinks it is round 11 but KoL thinks it is round 1
Round 11: ZoeHarriet executes a macro!
KoLmafia thinks it is round 12 but KoL thinks it is round 1
KoLmafia declares world peace.

My concern is what happens when I'm running mafia and miss this looping while answering the door, etc.
-=DoctorRotelle
 

jasonharper

Developer
You appear to be using an outdated version of the macrofication code, somehow. (Evidence: lack of indentation in the macroDebug output.) I'm pretty sure that the problem you're seeing has since been fixed.
 

heeheehee

Developer
Staff member
Code:
[3276] The Outer Compound
Encounter: guard turtle
Strategy: C:\Documents and Settings\Administrator\My Documents\Mafia\ccs\stasis.ccs [guard turtle]
Round 0: ZoeHarriet loses initiative!
Generated macro:
abort hppercentbelow 25
sub mafiaround
endsub#mafiaround
sub mafiamp
    call mafiaround; use 3697
    mark mafiampexit
endsub#mafiamp
#mafiaheader
mark mafiafinal
while mpbelow 3
    call mafiamp
endwhile
if hasskill 7083
    call mafiaround; skill 7083
endif
goto mafiafinal

Round 1: ZoeHarriet executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: ZoeHarriet executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
Round 3: ZoeHarriet executes a macro!
KoLmafia thinks it is round 4 but KoL thinks it is round 1
Round 4: ZoeHarriet executes a macro!
KoLmafia thinks it is round 5 but KoL thinks it is round 1
Round 5: ZoeHarriet executes a macro!
KoLmafia thinks it is round 6 but KoL thinks it is round 1
Round 6: ZoeHarriet executes a macro!
KoLmafia thinks it is round 7 but KoL thinks it is round 1
Round 7: ZoeHarriet executes a macro!
KoLmafia thinks it is round 8 but KoL thinks it is round 1
Round 8: ZoeHarriet executes a macro!
KoLmafia thinks it is round 9 but KoL thinks it is round 1
Round 9: ZoeHarriet executes a macro!
KoLmafia declares world peace.
and for item use, the abort doesn't happen as expected either:
Generated macro:
Code:
abort hppercentbelow 25
sub mafiaround
endsub#mafiaround
sub mafiamp
    call mafiaround; use 3697
    mark mafiampexit
endsub#mafiamp
#mafiaheader
summonspirit
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
call mafiaround; use 4
mark mafiafinal
call mafiaround; attack
goto mafiafinal

Round 1: ZoeHarriet executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: ZoeHarriet executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
Round 3: ZoeHarriet executes a macro!
KoLmafia thinks it is round 4 but KoL thinks it is round 1
Round 4: ZoeHarriet executes a macro!
KoLmafia thinks it is round 5 but KoL thinks it is round 1
Round 5: ZoeHarriet executes a macro!
KoLmafia thinks it is round 6 but KoL thinks it is round 1
Round 6: ZoeHarriet executes a macro!
KoLmafia thinks it is round 7 but KoL thinks it is round 1
Round 7: ZoeHarriet executes a macro!
KoLmafia thinks it is round 8 but KoL thinks it is round 1
Round 8: ZoeHarriet executes a macro!
KoLmafia thinks it is round 9 but KoL thinks it is round 1
Round 9: ZoeHarriet executes a macro!
KoLmafia thinks it is round 10 but KoL thinks it is round 1
Round 10: ZoeHarriet executes a macro!
KoLmafia thinks it is round 11 but KoL thinks it is round 1
Round 11: ZoeHarriet executes a macro!
KoLmafia thinks it is round 12 but KoL thinks it is round 1
KoLmafia declares world peace.
(placed in code tags to indicate that it does, indeed, look like it's indented)
Hmm. The code looks indented (if you quote it), but for some odd reason, it doesn't show up as the asterisks that indicate non-breaking spaces. What?
 

Winterbay

Active member
IF the looping continues for more than 37 turns KoL will abort it for you so that is at least not that much of a problem :)
 

DoctorRotelle

Developer
check out this example:
Code:
KoLmafia thinks it is round 569 but KoL thinks it is round 1
Round 569: Schmoola executes a macro!
KoLmafia thinks it is round 570 but KoL thinks it is round 1
Round 570: Schmoola executes a macro!
KoLmafia thinks it is round 571 but KoL thinks it is round 1
Round 571: Schmoola executes a macro!
KoLmafia declares world peace.
KoLmafia thinks it is round 572 but KoL thinks it is round 1

KoL is actually responding with:
Code:
Could not match item(s) for use: use 3665,4169You twiddle your thumbs.

Note: that typo is in the HTML response.

Code:
Generated macro:
abort hppercentbelow 5
sub mafiaround
endsub#mafiaround
sub mafiamp
    call mafiaround; use 3697
    mark mafiampexit
endsub#mafiamp
#mafiaheader
call mafiaround; use 3665,4169
mark mafiafinal
call mafiaround; attack
goto mafiafinal

The items it is looking for, putty sheet and 4-d camera were both unusable for different reasons. putty sheet: i didn't have one as it was already a monster. 4-d camera: already had one shaking. The error corresponds to the first item only. The 4-d camera gives a completely different error message.

I like having 3 monsters with this configuration so I can acquire one after liberating the king without a Custom Combat reconfigure. When and where appropriate, of course. Mafia's Custom Combat code supports this (by advancing 1 action), while the Custom Combat -> KoL macro does not.

While this isn't a stasis example, it is related to the same issue. KoL is aborting, but mafia retries the same macro. Since we now bypass mafia's Custom Combat code when we make the macros, perhaps having the Custom Combat -> macro routine advance 1 Custom Combat action before attempting to create and send the next macro with the remainder, and abort if we run out of actions?

The macro command "hascombatitem" could also be used in the macro code to pre-validate any combat item like Custom Combat does.

I hope that clarifies why I think this code should be valid: it worked before macros.
Also, I hope this clarifies why I think it is really a bug and needs attention: server hits.

I hope I am totally wrong. It would make me feel a lot better. Especially since I'm also off topic... again.
 
Top