SmartStasis -- a complex script for a simple CCS

zarqon

Well-known member
What? I noticed that earlier, so I already excluded all items that were not multi-usable from stasis_action(). I must have uploaded an older BatBrain. Re-download BatBrain and that problem should evaporate.

PRO TIP: You'll notice a new ZLib setting, BatMan_profitforstasis. This represents the profit needed to justify stasis -- in other words, if (all things considered) you will profit less than this per round by stasising, it won't bother stasising. Configure this to your liking -- higher values will be less likely to stasis. Optimal is theoretically 0.01 (or barely nonzero), since profit is profit, but I think in terms of actual gameplay that would be annoying and would appear to be wasting resources.
 
Last edited:

roippi

Developer
Ah, yeah I believe I messed something up in trying to fix that XOR. Ignore the cracker report for now.

The problem is that ^ (a bitwise operator) doesn't take type boolean:

Code:
> ash boolean a = true; boolean b = false; (a ^ b);

Cannot apply operator ^ to a (boolean) and b (boolean) ()
Returned: void

> ash boolean a = true; boolean b = true; (to_int(a) ^ to_int(b));

Returned: 0

> ash boolean a = true; boolean b = false; (to_int(a) ^ to_int(b));

Returned: 1
 

Veracity

Developer
Staff member
Code:
> ash boolean a = true; boolean b = true; to_boolean(to_int(a) ^ to_int(b));

Returned: false

> ash boolean a = true; boolean b = false; to_boolean(to_int(a) ^ to_int(b));

Returned: true
 

Bale

Minion
After fixing that little problem with the code...

It correctly determines that I have 2 pickpockets available and does a rave steal if they both fail.
It flyers admirably.
It olfacts whenever required.

Unfortunately when I got poisoned by a tomb asp before beginning rave nirvana, it did ran the combo first and used an anti-dote afterwards, allowing me to get hit with the lowered moxie. (It should have used the antidote right away.)

Code:
[895] The Upper Chamber
Encounter: tomb asp
Round 0: bale loses initiative!
You lose 9 hit points
You acquire an effect: Really Quite Poisoned (duration: 10 Adventures)
(unable to macrofy due to action: consult SmartishStasis.ash)
Round 1: bale casts ENTANGLING NOODLES!
Round 2: bale uses the rock band flyers!
Round 3: Your opponenþ€ spartacus! ¬¶Ugh! Eek! Ooh! Eek! Ooh! Oof! You lose 65535 hit po‰© You lose 0 hit points.
Poison level: 3 (set to remove if 5 or lower)
Round 3: bale uses the anti-anti-antidote!
You lose an effect: Really Quite Poisoned
Round 4: bale executes a macro!
Round 4: bale casts POP AND LOCK IT!
Round 5: tomb asp takes 8 damage.
Round 5: $@He transforms into a clammy mist, a flock of bats, and a big black dog in rap)#)Aborted You glance over at spartacus!, who is twitching oddly.
Round 5: bale casts BREAK IT ON DOWN!
Round 6: tomb asp takes 13 damage.
Round 6: bale casts RUN LIKE THE WIND!
Round 7: tomb asp takes 15 damage.
You acquire an item: unidentified jerky
You lose 8 hit points
You acquire an effect: Really Quite Poisoned (duration: 10 Adventures)
Round 7: bale executes a macro!
Round 7: bale casts BREAK IT ON DOWN!
Round 8: tomb asp takes 8 damage.
Round 8: spartacus! //ℵ±entangles your opponent with powerful vines, preventing it from attacking you.
Round 8: bale casts RUN LIKE THE WIND!
Round 9: tomb asp takes 15 damage.
Round 9: spartacus! twitches violently as your opponent charges in for the kiWarning: Parse error in killplayer.php line 7722
Round 9: bale casts POP AND LOCK IT!
Round 10: tomb asp takes 20 damage.
You acquire an effect: Rave Nirvana (duration: 1 Adventure)
Round 10: Your opponenþ€ spartacus! ¬¶Ugh! Eek! Ooh! Eek! Ooh! Oof! You lose 65535 hit po‰© You lose 0 hit points.
Round 10: bale uses the anti-anti-antidote and uses the seal tooth!
You lose an effect: Really Quite Poisoned
Round 11: tomb asp takes 1 damage.
Round 11: spartacus! twitches violently as your opponent charges in for the kiWarning: Parse error in killplayer.php line 7722
Round 11: bale attacks!
Round 12: tomb asp takes 49 damage.
Round 12: Your opponenþ€ spartacus! ¬¶Ugh! Eek! Ooh! Eek! Ooh! Oof! You lose 65535 hit po‰© You lose 0 hit points.
Round 12: bale attacks!
Round 13: tomb asp takes 51 damage.
Round 13: spartacus! //ℵ±entangles your opponent with powerful vines, preventing it from attacking you.
Round 13: bale attacks!
Round 14: tomb asp takes 45 damage.
Round 14: bale attacks!
Round 15: tomb asp takes 50 damage.
Round 15: bale wins the fight!
You gain 202 Meat
After Battle: spartacus! gives you a weird, lopsided grin. What's weird about it is that you can even tell, considering the ski-mask he's wearing.You gain ¤±You gain «You g¢
You gain 19 Strongness
You gain a Muscle point!
You gain 13 Mysteriousness
You gain 35 Smarm
MCD: adjusting to 0...
Resetting mind control device...
Mind control device reset.
Searching for "anti-anti-antidote"...
Purchasing anti-anti-antidote (2 @ 30)...
You acquire anti-anti-antidote (2)
You spent 60 Meat
Purchases complete.

Then I try to do the Junkyard and run into a serious problem:

Code:
[922] Next to that Barrel with Something Burning in it
Encounter: batwinged gremlin
Round 0: bale wins initiative!
(unable to macrofy due to action: consult SmartishStasis.ash)
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
Monster value: 105.46
Profit per round: ActionProfitDamageOtherbase, Baby Sandworm (0μ)-13.16μ--
Bonus damage to DB skills: 15
You are able to cast 5 possible disco combos.
1 MP costs 8.0 meat.
Round 1: bale tries to steal an item!
You lose 4 hit points
1 MP costs 8.0 meat.
Round 2: bale tries to steal an item!
You lose 5 hit points
1 MP costs 8.0 meat.
Checking for unidentified potions...
Checking for unidentified spheres...
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
gremlin juice (3.6000001 @ +60.0): 395.0 meat * 5.76% = 22.752003
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
gremlin juice (3.8999999 @ +60.0): 395.0 meat * 6.24% = 24.647999
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
gremlin juice (3.0 @ +60.0): 395.0 meat * 4.8% = 18.960001
Round 3: bale executes a macro!
Round 3: bale casts POP AND LOCK IT!
Round 4: batwinged gremlin takes 20 damage.
You lose 4 hit points
Round 4: bale casts BREAK IT ON DOWN!
Round 5: batwinged gremlin takes 29 damage.
You lose 4 hit points
Round 5: bale casts RUN LIKE THE WIND!
Round 6: batwinged gremlin takes 34 damage.
You acquire an item: gremlin juice
You lose 3 hit points
1 MP costs 8.0 meat.
You snatched a gremlin juice (395 μ)!
Revised monster value: 86.5
Round 6: bale casts SAUCY SALVE!
KoLmafia thinks it is round 7 but KoL thinks it is round 6
You gain 12 hit points
1 MP costs 8.0 meat.
Round 7: bale casts LASAGNA BANDAGES!
KoLmafia thinks it is round 8 but KoL thinks it is round 7
You gain 11 hit points
You lose 4 hit points
1 MP costs 8.0 meat.
[COLOR="#808000"]You don't have any stasis items.[/COLOR]
Round 8: bale attacks!
KoLmafia thinks it is round 9 but KoL thinks it is round 8
Round 9: batwinged gremlin takes 73 damage.
You lose 5 hit points
Round 9: bale attacks!
KoLmafia thinks it is round 10 but KoL thinks it is round 9
Round 10: batwinged gremlin takes 100 damage.
Round 10: bale wins the fight!
You gain 89 Meat
After Battle: Enn Reitel smiles a three-lipped smile from beneath the shade of his little sombrero.
You gain 17 Strongness
You gain 20 Wizardliness
You gain 25 Smarm

I have a facsimile dictionary and a seal tooth, so it is clearly wrong about my lack of stasis items.
 

Bale

Minion
Another failure for SmartishStasis. This one seems quite inexplicable. Despite quite happily rave stealing from monsters on the Battlefield (usually after a rave concentration), when I meet up with a filthworm it does not use the rave steal or rave concentration. Big bug!

Code:
[953] Hatching Chamber
Encounter: larval filthworm
Strategy: C:\KolMafia\ccs\zarqon.ccs [default]
Round 0: bale wins initiative!
(unable to macrofy due to action: consult SmartishStasis.ash)
Monster value: 86.5
Profit per round: ActionProfitDamageOtherbase, Baby Bugged Bugbear (0μ)-0.48μ--
Bonus damage to DB skills: 15
You are able to cast 3 possible disco combos.
1 MP costs 8.0 meat.
1/1 monsters drop goals here.
This monster is the best source of goals (0.16)!
Round 1: bale tries to steal an item!
1 MP costs 8.0 meat.
Round 2: bale tries to steal an item!
Round 3: As your opponent prepares to attack, spartacus! Error: Unexpected ')' in fight.php line 4492
1 MP costs 8.0 meat.
Checking for unidentified potions...
Checking for unidentified spheres...
This monster is not your huckleberry.
Round 3: bale attacks!
Round 4: larval filthworm takes 98 damage.
Round 4: bale attacks!
You lose 20 hit points
Round 5: bale attacks!
Round 6: larval filthworm takes 96 damage.
Round 6: spartacus! twitches violently as your opponent charges in for the kiWarning: Parse error in killplayer.php line 7722
Round 6: bale attacks!
Round 7: larval filthworm takes 99 damage.
Round 7: bale wins the fight!
You gain 72 Meat
After Battle: spartacus! gives you a weird, lopsided grin. What's weird about it is that you can even tell, considering the ski-mask he's wearing.You gain ¤±You gain «You g¢
You gain 20 Muscleboundness
You gain 10 Wizardliness
You gain 28 Roguishness

At least SmartishStasis did the right thing when fighting the Queen Filthworm by using rave and disco nirvana to maximize meat. Ditto for the Nuns plus a meat vortex.
 
Last edited:

slyz

Developer
That might be because of the autosell price of 0. Did you have the gland as a goal?

Edit: I guess you did. I just noticed this comment in combo_profit():

// TODO: account for rave steal giving 100% for a remaining unconditional item
 
Last edited:

Bale

Minion
// TODO: account for rave steal giving 100% for a remaining unconditional item

LoL! That explains the problem with the filthworms! Well, he did warn us that it was unfinished!

I wonder if that's why it rave steals AFTER rave concentration?
 

zarqon

Well-known member
Haha, the problem with gremlins is one of those DUH! mistakes. It'll require figuring out multi-sort (sort options by min damage first, profit second) to fix. At the moment I'm not even sure ASH can do that, although I'm pretty sure I recall that it can...?

For now I'll move poison removal to act(), which will solve the poisoning problem. Eventually I'll want to be smarter about that and funkslinging.

I doubt I'll have time to work on scripts this weekend. Anyone who would like to beat me to fixing combo_profit() so that it properly handles Rave Steal (I'd been mistakenly treating it like a normal pickpocket), have at it!
 

Winterbay

Active member
There appears to have been some problem with the datafile it loaded. That might've been me having a strange one or whatnot, but it still is odd I feel. Also, that large evaluate table thingie in the middle? Seems to be not working as intended.

Code:
[658] Haunted Ballroom
Encounter: tapdancing skeleton
Strategy: D:\Privat\KoL Mafia\ccs\AT.ccs [default]
Round 0: winterbay loses initiative!
(unable to macrofy due to action: consult smartishstasis.ash)
tap shoes (5.0 @ +130.87482): 130.0 meat * 11.54374% = 15.006863
worn tophat (5.0 @ +130.87482): 130.0 meat * 11.54374% = 15.006863
Updating dmg_effects.txt from ''...
[All Covered In Whatsit] does not match anything in the status effect database.
[Jabañero Saucesphere] does not match anything in the status effect database.
[Jalapeño Saucesphere] does not match anything in the status effect database.
map_dmg_effects.txt => 2010-10-31T22:35:51-05:00, checked 20110128
...dmg_effects.txt updated.
Updating dmg_wearables.txt from ''...
map_dmg_wearables.txt => 2010-02-08T01:04:34-06:00, checked 20110128
...dmg_wearables.txt updated.
Updating dmg_throwables.txt from ''...
map_dmg_throwables.txt => 2010-06-11T08:06:16-05:00, checked 20110128
...dmg_throwables.txt updated.
Updating dmg_skills.txt from ''...
map_dmg_skills.txt => 2011-01-19T07:15:52-06:00, checked 20110128
...dmg_skills.txt updated.
New ZLib boolean setting: BatMan_macrofy => false
New ZLib float setting: BatMan_profitforstasis => 15.0
New ZLib float setting: BatMan_baseSubstatValue => 5.0
tap shoes (5.0 @ +130.87482): 130.0 meat * 11.54374% = 15.006863
worn tophat (5.0 @ +130.87482): 130.0 meat * 11.54374% = 15.006863
Monster value: 30.01
Profit per round: ActionProfitDamageOtherbase, Coffee Pixie (0μ)-0.65μ--
Evaluating '-0.102272734'...
Evaluating '0'...
Evaluating '2'...
Evaluating '0'...
Evaluating '2'...
Evaluating '7'...
Evaluating '0'...
Evaluating '2.5'...
Evaluating '0'...
Evaluating '-50/3'...
Evaluating '35'...
Evaluating '0'...
Evaluating '1'...
Evaluating '176.0'...
Evaluating '68.0'...
Evaluating '0'...
Evaluating '11'...
Evaluating '0'...
Evaluating '7'...
Evaluating '0'...
Evaluating '5.5'...
Evaluating '0.5'...
Evaluating '0'...
Evaluating '1.5*L+5'...
Evaluating '40'...
Evaluating '22.5'...
Evaluating '4'...
Evaluating '0.5'...
Evaluating '2.5'...
Evaluating '1'...
Evaluating '6'...
Evaluating '0'...
Evaluating '0.6'...
Evaluating '0'...
Evaluating '-5'...
Evaluating '1'...
1 MP costs 5.0 meat.
Evaluating '0'...
Evaluating '-3'...
Evaluating '3'...
Evaluating 'zone(sea)*floor(min(800,71.0)/4)'...
Evaluating '-30'...
Evaluating '0'...
Evaluating '-6'...
Evaluating '16'...
Evaluating '-8'...
Evaluating '-10'...
Evaluating '2.5'...
Evaluating '-0'...
Evaluating '-3'...
Checking for unidentified potions...
This monster is not your huckleberry.
Round 1: winterbay executes a macro!
Round 1: winterbay attacks!
Round 2: tapdancing skeleton takes 32 damage.
Round 2: winterbay attacks!
Round 3: tapdancing skeleton takes 38 damage.
Round 3: winterbay attacks!
Round 4: tapdancing skeleton takes 40 damage.
Round 4: winterbay attacks!
Round 5: tapdancing skeleton takes 37 damage.
Round 5: winterbay wins the fight!
After Battle: Arog flits around like a hummingbird on crack, helping you pick stuff up.
You acquire an item: tap shoes
You gain 4 Muscleboundness
You gain 9 Wizardliness
You gain 17 Cheek
You gain a Moxie point!
 

zarqon

Well-known member
No I think I've had that message before as well, due to data file encoding issues. The data file needs to be updated. You're welcome to have a shot at fixing it!

Your verbosity is quite high indeed, since it's showing every value-replaced formula being evaluated by eval()! I think 7 is probably high enough for debugging purposes. I'll also edit that bit in ZLib to be 10 rather than 8. I have to upload some other changes for a certain regex anyway.
 

Winterbay

Active member
Yeah, I've had my verbosity set to 10 for quite some time now since I like to see what is happening and before this not much above 5 or 6 have been in there so it has not mattered that much :)
 

StDoodle

Minion
Zarqon; multi-sort is fairly simple. Just run multiple sort commands in a row, in reverse order of importance. Previous order is unaffected for ties.
 

roippi

Developer
So I'm now playing around with BatBrain - not quite at the point where I'm trying to consult it for anything other than stasis, but getting there.

What is the proper way to call build_options() if I just want that output? I'm just trying to capture that without calling do_all() and I'm a bit confused on what to feed it.
 

Bale

Minion
Your verbosity is quite high indeed, since it's showing every value-replaced formula being evaluated by eval()! I think 7 is probably high enough for debugging purposes. I'll also edit that bit in ZLib to be 10 rather than 8. I have to upload some other changes for a certain regex anyway.

Huckleberry information is at 9 (really high!) which I thought would be important for posting information about my Junkyard issue. I edited eval() verbosity up to 10 since that is pure debug stuff and not as interesting for the problem.
 
Last edited:

StDoodle

Minion
Zarqon; last I checked, you were working on a fight.php override. If that's still in progress, you may want a way to check and see if combat is over. I've just uploaded a data file called "combatEndingText.txt" that could help, if you want. It'll be there anyway. ;)
 

zarqon

Well-known member
@Doodle: This is a great trick. Thanks.

@rioppi: after calling build_options(page text), the global advevent[int] variable opts should contain a complete list of all of your possible available combat options. The function itself returns void; it doesn't have useful output.
 
Not sure what's going on here. I was trying some stasis farming with my maxed out stocking mimic and I go to look at what mafia's doing and it's round 18 and batbrain still has me alternating between saucy salve and my facsimile dictionary. Shouldn't it be killing after round 10? Edit: I understand at round 10 stocking mimics, NPZR's, etc. stop dispensing meat.
 
Last edited:
Top