KolMafia autocombat. Conditioned Combat help

MgDark

New member
Hello all, in my quest to find that nasty ultra rare black box i want to make a little CCS script for combat in Warbear Fortress LVL2

Basically, as pastamancer, i want to cast Ravioli Shurikens at every warbear i fight, but if it finds a hardened (element resistant) warbear, cast weapon of the pastalord. The help file suggested that a CCS script like that should look like:
Code:
[ default ]
skill ravioli shurikens

[ hardened ]
skill weapon of the pastalord

The bracket "hardened" is a part match name of the bear i want to make that exception, as stated in the help file. But oddly even when he finds that kind of bear, he still casts shuriken and kills me right there.
 
Last edited:

lostcalpolydude

Developer
Staff member
You have to match the name mafia uses for the monster. Since mafia uses the same name for all level 3 monsters, the method you tried won't work. You could use KoL combat macro predicates, putting lines inside quotes so mafia sends them unmodified.
 

MgDark

New member
Ok after seeing that my macro doesnt works in mafia, as you said, i made it in the KoL in-game macro scripting (which uses a different syntax), it looks like this:

Code:
if monstername *hardened Warbear Officer
skill weapon of the pastalord
repeat
endif

skill ravioli shurikens
repeat

It works vs non-hardened, but still fails to recognize a hardened bear, you said put it in quotes, doing that makes the macro fail.
 

ereinion

Member
You could try something like:
Code:
if monstername *hardened*
skill weapon of the pastalord
repeat
endif

skill ravioli shurikens
repeat
 

ereinion

Member
Hmm. Is the "H" in hardened uppercase, and does BALLS-macros care about that? And if it isn't too much trouble, do you think you could copy the name of one of the bears into a forum post here?
 

slyz

Developer
Here is my warbear CCS:
Code:
[ default ]
skill pocket crumbs
attack with weapon

[ global prefix ]
scrollwhendone
"abort hppercentbelow 25"

[ officer ]
if match hardened
    if !hasskill shrap
        abort
    endif
    skill shrap
    "repeat"
endif
skill saucegeyser
"repeat"
 

xKiv

Active member
I would expect *hardened* to expand to .*hardened.* in a regex, which requires at least 1 character before the h.
 

ereinion

Member
According to the wiki it always has a character preceding it though?
The Wiki: said:
Names are constructed thusly: <Title> <Name> <Name><suffix><suffix> the <Trait> Warbear Officer:
That is <Trait> is in the middle of the name?
 

MgDark

New member
thanks to all, now the script works.

if match hardened
skill weapon of the pastalord
repeat
endif

skill ravioli shurikens
repeat

Although the name method should have worked, dunno why.
 

Darzil

Developer
Although the name method should have worked, dunno why.

Because they are all recognised as warbear officers or higher-ranking warbear officers (as skeletons from skeleton tower are), not by element as monsters in Dreadsylvania are.

As lost explained in the first reply.
 

slyz

Developer
I think he meant to ask why the "monstername" predicate didn't work.

Another small detail: When turning a CCS into a KoL Macro, Mafia adds some checks and possible actions like MP restoration between each "round" (ie line). This means that things like
Code:
skill weapon of the pastalord
 repeat
can be modified in a way that the "repeat" gets separated from the previous CCS line, with sometimes baffling consequences.

I took the habit of always using repeat like this:
Code:
"skill weapon of the pastalord; repeat"

I should take a look into this. I suspect it only happens if one of the lines is in double quotes, but I haven't tested since there was an easy workaround.
 

xKiv

Active member
I think he meant to ask why the "monstername" predicate didn't work.

This *is* why monstername doesn't work - it matches on the name as displayed in manuel (iirc), which never has the bit about hardened, that's only displayed in actual combat (and thus si visible to match, which sees the entire html):

Because they are all recognised as warbear officers or higher-ranking warbear officers (as skeletons from skeleton tower are), not by element as monsters in Dreadsylvania are.

As lost explained in the first reply.
 
Top