Bug - Fixed having both a macro and consult script fails in [default] section of ccs

fxer

Member
For the simple ccs below, candyblast is fired against every monster encountered. but breaking candyblast out into its own [angry tourist] section works fine? It's like the 'if' statements are stripped out of the [default] ccs.

Code:
[ default ]
if monstername angry tourist
    skill candyblast
endif
consult wham.ash
 

lostcalpolydude

Developer
Staff member
Based on the thread title, I assume that removing the consult line means that candyblast only fires against angry tourists? I'm just checking that the thread title is relevant, since my CCS never changes from "abort" (to make sure it can never run if I misclick the script button).
 

Bale

Minion
Try this:

Code:
[ default ]
"if monstername angry tourist"
    "skill candyblast"
"endif"
consult wham.ash

Note the double-quotes I added.
 
Last edited:

Magus_Prime

Well-known member
@Bale - Thank you! This is something that's been puzzling me for some time but I never asked the question fxer did. Is that a typo in the third line of your response or is the double-quote intentionally missing from the beginning of the line?
 
Last edited:

Bale

Minion
That was a typo. Put quotes around each line to pass macro commands in a ccs that uses a consult script.

(Fixed previous post for clarity.)
 

fxer

Member
Hmm didn't work for me, mafia removes the quotes from all the "if/endif" lines just leaving them around the "item" or "skill" lines. Then neither my items or skills are being used, when they have quotes around them, it dumps straight to consult wham.ash
 

fxer

Member
Mafia isn't stripping quotes for you? Here's another example where the ccs fails trying to use a Rain-Doh black box, which I do not have, but I don't understand why it would even attempt it? However if I do:

item Rain-Doh black box, miniborg strangler

Then the code works, just using the strangler not the rain-doh? I really don't get what's happening...


Code:
[ default ]
try to steal an item
special action
if hascombatitem Spooky Putty sheet
    item Spooky Putty sheet
endif
if hascombatitem Rain-Doh black box
    item Rain-Doh black box
endif
if hasskill digitize
    skill digitize
endif
if hasskill fire a badly romantic arrow
    skill fire a badly romantic arrow
endif
if hascombatitem porquoise-handled sixgun
    item porquoise-handled sixgun
endif
consult wham.ash
 
Last edited:

fxer

Member
I'm still having a lot of trouble figuring out when/why certain skills are fired from a CCS. For instance in the CCS below mafia tries to cast entangling noodles and Open the Bag o' Tricks on every combat all day, not just when the Bag o' Tricks is equipped. The server returns "you don't have that skill" and mafia advances a round even though KoL doesn't:

Code:
[ default ]
try to steal an item
special action
if hasskill extract
    skill extract
endif
if hasskill 7081
    skill entangling noodles
    skill open the bag o' tricks
endif
if hasskill release the boots
    skill release the boots
endif
if hasskill 7265
    skill fire the jokester's gun
endif
if hascombatitem porquoise-handled sixgun
    item porquoise-handled sixgun
endif
if hasskill shattering punch
    skill shattering punch
endif
consult wham.ash

[ knob goblin embezzler ]
if hasskill fire a badly romantic arrow
    skill fire a badly romantic arrow
endif
consult consult_digitize.ash
if hasskill extract
    skill extract
endif
if hasskill 7081
    skill entangling noodles
    skill open the bag o' tricks
endif
if hascombatitem porquoise-handled sixgun
    item porquoise-handled sixgun, Miniborg strangler
endif
consult wham.ash
 
Last edited:

Darzil

Developer
That is because mafia support for skills granted from equipment is incomplete. Skills are added when items are put on, but not removed when taken off.
 

fxer

Member
ahhhh ok I can work with that, is there a workaround like a cli command to execute that will reload all available skills for after I unequip something?
 

lostcalpolydude

Developer
Staff member
No. You're already using consult scripts, so another one that checks what you have equipped and relevant settings could handle it, though.
 

Veracity

Developer
Staff member
Well, it IS a defect that we don't recalculate item-granted skills when you unequip something. If we recalculate available skills when you equip an item, why not when you unequip one?
 

Darzil

Developer
Hopefully r17050 does this.

There are also skills granted in other ways we don't currently add or remove (eg when Effects are active).
 

Darzil

Developer
How are you equipping/unequipping it ?

Code:
> ash have_skill( $skill[open the Bag o' Tricks] )

Returned: false

> equip bag o' tricks

Holding Bag o' Tricks...
Equipment changed.

> ash have_skill( $skill[open the Bag o' Tricks] )

Returned: true

> unequip bag o' tricks

Taking off Bag o' Tricks...
Equipment changed.

> ash have_skill( $skill[open the Bag o' Tricks] )

Returned: false
 

fxer

Member
ash have_skill( $skill[open the Bag o' Tricks] ) returns false for me as well, but Mafia is still executing the block of my CCS for open the bag o' tricks. Maybe the CCS parsing isn't obeying your new code for adding/removing skills from equip?

Code:
> ash have_skill($skill[open the bag o' tricks])

Returned: false

Visit to Dinseylandfill: Barf Mountain in progress...

[581458] Barf Mountain
Encounter: angry tourist WITH SCIENCE!
Strategy: D:\Dropbox\mafia-fxer\ccs\farmit_barf.ccs [default]
Round 0: fxer wins initiative!
Round 1: You lose 1 hit point
Round 1: fxer tries to steal an item!
Round 2: "Ah yes!" Sarah, Plain and Medium says, "This meat was right where I predicted it would be!" She then hands you some meat.
You gain 14 Meat.
Round 2: fxer casts EXTRACT!
You acquire an item: Source essence (3)
Round 3: "Ah yes!" Sarah, Plain and Medium says, "This meat was right where I predicted it would be!" She then hands you some meat.
You gain 10 Meat.
Round 3: fxer casts ENTANGLING NOODLES!
Round 4: angry tourist drops 10 attack power.
Round 4: angry tourist drops 10 defense.
Round 4: "Ah yes!" Sarah, Plain and Medium says, "This meat was right where I predicted it would be!" She then hands you some meat.
You gain 12 Meat.
Round 4: fxer casts OPEN THE BAG O' TRICKS!
KoLmafia thinks it is round 5 but KoL thinks it is round 4
Round 5: fxer uses the porquoise-handled sixgun!
KoLmafia thinks it is round 6 but KoL thinks it is round 5
Round 6: angry tourist takes 31 damage.
Round 6: You gain 24 Mojo Points
You have Mayflower bouquet equipped: 0 damage, stun 0.065
Base round: 0 (17.6) damage, 0 player damage, -4 attack, -4 defense, 0.07 stun, 0 meat
WHAM: Monster HP is 98.0.
WHAM: Running SmartStasis
Round 6: fxer executes a macro!
Round 6: fxer casts POCKET CRUMBS!
KoLmafia thinks it is round 7 but KoL thinks it is round 6
Round 7: angry tourist drops 12 attack power.
Round 7: angry tourist drops 15 defense.
You gain 52 Meat.
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 1-shot with Zombo's empty eye.
Round 7: fxer executes a macro!
Round 7: fxer uses the Zombo's empty eye!
KoLmafia thinks it is round 8 but KoL thinks it is round 7
WHAM: Current monster HP is calculated to 98.0
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 1-shot with attack with your weapon.
Round 8: fxer executes a macro!
Round 8: fxer attacks!
KoLmafia thinks it is round 9 but KoL thinks it is round 8
Round 9: angry tourist takes 8801 damage.
Round 9: fxer wins the fight!
After Battle: You gain 12 Mojo Points
After Battle: Sarah, Plain and Medium surveys the scene from your back and sighs.
You gain 3949 Meat
After Battle: Win-ged Balloon Knot does a strange, angry-looking stompy sort of dance, while shouting "DEVELOPERS DEVELOPERS DEVELOPERS DEVELOPERS".
You acquire an item: expensive camera
You acquire an item: cheap sunglasses
You acquire an item: How to Avoid Scams
After Battle: Win-ged Balloon Knot says, "Did you know: Salisbury's Fifteenth Law of Frequency says an object at the airport tends to stay at the airport!"
You acquire an item: BACON
After Battle: You gain 9 Strengthliness
After Battle: You gain 8 Magicalness
After Battle: You gain 25 Sarcasm

Code:
[ default ]
try to steal an item
special action
if hasskill extract
    skill extract
endif
if hasskill open the bag o' tricks
    skill entangling noodles
    skill open the bag o' tricks
endif
if hasskill release the boots
    skill release the boots
endif
if hasskill fire the jokester's gun
    skill fire the jokester's gun
endif
if hascombatitem porquoise-handled sixgun
    item porquoise-handled sixgun
endif
if hasskill shattering punch
    skill shattering punch
endif
consult wham.ash

[ knob goblin embezzler ]
if hasskill fire a badly romantic arrow
    skill fire a badly romantic arrow
endif
consult consult_digitize.ash
if hasskill extract
    skill extract
endif
if hasskill 7081
    skill entangling noodles
    skill open the bag o' tricks
endif
if hascombatitem porquoise-handled sixgun
    item porquoise-handled sixgun, Miniborg strangler
endif
consult wham.ash
 

Darzil

Developer
Isn't "if hasskill" a KoL macro, not a Mafia one?

If you are wanting to pass things through to KoL, you just put it in quotes to make sure it goes through unchanged.
 

fxer

Member
I mentioned to Bale earlier in the thread Mafia is stripping quotes out of the CCS box, so lines with "if hasskill" are quote-stripped when hitting save on the ccs editor in mafia.

Whether it's a kol or mafia command I don't know, but I do know from the ccs above "fire the jokester's gun" will *not* execute unless the gun is equipped, the desired behavior. however "open the bag o' tricks" *will* run on every combat. I have no idea what's going on!
 
Last edited:

fxer

Member
Also on the Custom Combat Script page of the mafia wiki the examples of
Code:
if hascombatitem dictionary
don't contain any quotes
 

lostcalpolydude

Developer
Staff member
I mentioned to Bale earlier in the thread Mafia is stripping quotes out of the CCS box, so lines with "if hasskill" are quote-stripped when hitting save on the ccs editor in mafia.

Whether it's a kol or mafia command I don't know, but I do know from the ccs above "fire the jokester's gun" will *not* execute unless the gun is equipped, the desired behavior. however "open the bag o' tricks" *will* run on every combat. I have no idea what's going on!

Testing in a KoL macro seems like it would be a simple way to check. The only thing that makes sense is that there's a KoL bug.
 
Top