Bug - Not A Bug CCS hanging on 'Invalid macro command encountered: "top"'

Arashmin

New member
EDIT: I just need to be more confident I guess.

Code:
[ default ]
scrollwhendone
"abort pastround 28"
while match broke
    while match solid gold || match optimal
        skill sing along
        call hivemind
        "skill saucegeyser; repeat"
    endwhile
    while match untouchable
        skill give your opponent the stinkeye
        skill snokebomb
        skill throw latte on opponent
        skill sing along
        call hivemind
        skill shattering punch
        if hascombatitem exploding cigar
            item exploding cigar
        endif
        if hascombatitem handsome devil
            item Handsome Devil
        endif
        "skill belch the rainbow; repeat"
    endwhile
    while match electrified || match filthy || match foul-mouthed || match haunted || match hot || match wet
        skill give your opponent the stinkeye
        skill snokebomb
        skill throw latte on opponent
        skill sing along
        item Miniborg hiveminder,Miniborg hiveminder
        item Miniborg hiveminder,Rain-Doh indigo cup
        item Miniborg hiveminder,Miniborg hiveminder
        item Miniborg hiveminder,Miniborg hiveminder
        "skill saucegeyser; repeat"
    endwhile
    while match ticking
        skill give your opponent the stinkeye
        skill snokebomb
        skill throw latte on opponent
        "skill saucegeyser; repeat"
    endwhile
    skill give your opponent the stinkeye
    skill snokebomb
    skill throw latte on opponent
    skill sing along
    call hivemind
    "skill saucegeyser; repeat"
endwhile
while match untouchable
    skill sing along
    call hivemind
    skill shattering punch
    if hascombatitem exploding cigar
        item exploding cigar
    endif
    if hascombatitem handsome devil
        item Handsome Devil
    endif
    "skill belch the rainbow; repeat"
endwhile
while match electrified || match filthy || match foul-mouthed || match haunted || match hot || match wet
    skill sing along
    item Miniborg hiveminder,Miniborg hiveminder
    item Miniborg hiveminder,Rain-Doh indigo cup
    item Miniborg hiveminder,Miniborg hiveminder
    item Miniborg hiveminder,Miniborg hiveminder
    "skill saucegeyser; repeat"
endwhile
while match ticking
    "skill saucegeyser; repeat"
endwhile
while match garbage
    skill gallapagosian mating call
    skill transcendent olfaction
    skill sing along
    call hivemind
    "skill saucegeyser; repeat"
endwhile
skill sing along
item Miniborg hiveminder,Miniborg hiveminder
item Miniborg hiveminder,Miniborg hiveminder
item Miniborg hiveminder,Rain-Doh indigo cup
item Miniborg hiveminder,Miniborg hiveminder
item Miniborg hiveminder,Miniborg hiveminder
"skill saucegeyser; repeat"
sub hivemind
    item Miniborg hiveminder,Miniborg hiveminder
    item Miniborg hiveminder,Miniborg hiveminder
    item Miniborg hiveminder,Miniborg hiveminder
    item Miniborg hiveminder,Rain-Doh indigo cup
    item Miniborg hiveminder,Miniborg hiveminder
    item Miniborg hiveminder,Miniborg hiveminder
    item Miniborg hiveminder,Miniborg hiveminder
endsub

This can be closed/ignored. Thanks all!
 
Last edited:

heeheehee

Developer
Staff member
Some thoughts:

Some of these whiles should probably be ifs (namely, the block with olfaction / gallapagosian mating call). It's also a bit redundant to have a while block ending with "skill saucegeyser; repeat"; the while block could just become an if statement in that case.

If you set_property("macroLens", "true"), then you'll be able to copy-paste your combat macro into an actual combat to see if it aborts or anything. Also, there is a mafia relay override for the macro editor in KoL that syntax-checks your macro. Both good options for sanity-checking your macro.

(I personally handle my mindless combat entirely using an autoattack combat macro, since it avoids a pageload and is faster because Mafia doesn't need to process everything to make a decision.)
 

Arashmin

New member
I'll admit I'm only a novice to most coding, and didn't realize the while statements would be constantly checked and would just keep on that path. I've got it to a fairly stable point now, but I am looking to pare it down and make it more efficient, so I'll take your suggestions and continue to retailor it. At least I'm not dying and profiting with the current version :D

That said - the 'Invalid macro command encountered: "top"' message definitely threw me off, since it didn't point to any issues and seemed like part of the macro was submitting the word "top". Could perhaps the part of the macro handling that may end up submitting the "top" command instead throw a bad command that gives more detail, like "hanginccs'?
 

heeheehee

Developer
Staff member
It's perfectly fine (and in fact preferred) to double/triple post on this foru, especially if it's been a while since you last posted. If you edit your post, 1) people who skim the thread but have nothing to contribute may miss your edits, and 2) it's hard to go back and reference your code at a given stage, look for context, etc.

I can't find "top" in Mafia's code used as a string literal, nor can I find the specific error message in the title. I would expect both of those to be KoL error messages, and there's not much we can do to improve those beyond filing a bug report.
 
Top