SmartStasis -- a complex script for a simple CCS

zarqon

Well-known member
News Flash! This just in.

1, II, c!

I've begun migrating the old FTF/SS code over to the new Category 1,2,3 (I like 1,II,c) idea. SS/BB is a mess now, with commented code blocks all over the place. Oddly, it still works.

Once this is done, there will be two advevent[int] maps: opts[] and custom[]. The first is the same as before (all possible regular combat options), but the latter contains Category II (must do sometime) actions. Category II actions include:

  • flyering
  • insults
  • olfaction
  • puttying
  • El Vibrato punchcards
  • pasta guardian summoning
  • cocktail napkin vs. clingy pirate
  • Grin/Stinkeye vs. specified monsters
  • skate decoys for goals
  • meat vortices vs. brigands
It will also include ID'ing unknown:

  • !potions
  • spheres
  • rave combos

Most of this was already being done in FTF/SS (except EV punchcards and learning combos), but will soon be made available in a sortable, modular way.

Macros for a Longer Today

I've also begun more of the macrofication process. There are now four versions of macro():

macro(string mac) -- nothing new here; executes the macro supplied.
macro(advevent act) -- wraps the supplied action in whatever automatic responses are relevant (magnetizing gremlins, attacking megalopolis monsters, yellow-raying specified monsters, etc), then executes it once.
macro(advevent act, string rep) -- wraps the supplied action in auto-responses, then executes it contingent upon the repeat conditions specified in rep.
macro(advevent[int] acts) -- converts the supplied series of actions to a macro, wraps each round (except DB combos) in responses, then executes it.

The stasis loop will soon be submitting macros with repeat conditions rather than individual actions. For starters, there will be plenty of exit conditions (basically, the macro will only continue if nothing happened to you), but these will be reduced where possible. And since responses are now part of the macro, I need to improve act() to detect macros and make sure not to respond if the macro already did. Once that's ready, I'll post a new more server-friendly SishS for everyone to check out.
 

zarqon

Well-known member
1) Jump. Presently, just stealing and special handling for GMoB/Cyrus.
II) Must-do-sometime.
c) Regular combat options.
 

Drkirre

Member
It seems to be spitting out the following error every time now:
Invalid field name 'reusable' (BatBrain.ash, line 673)
Consult script 'smartishstasis.ash' not found.
You're on your own, partner.
Click here to continue in the relay browser.
I have BatBrain and SmartishStasis both in their proper locations. So.. yeah.
 

zarqon

Well-known member
Updates!

Just updated SishS and BB in the first post. LOTS of goodies in this update but here are the big ones:

  • Everything is a macro, wrapped in responses.
  • All Category II actions are performed in a single macro, with preparatory stunners if profitable (accounting for funkslinging).
  • The stasis loop submits a macro with repeat conditions. This speeds up stasis combat considerably, in addition to being much more server-friendly. Double win!
  • Hatrack support.
  • Funkslinging support when executing macros with consecutive item throws.
  • Uses the familiar / CoT information from the data file rather than the script (which I have fleshed out considerably)
  • Learning unknown Rave Combos.
  • El Vibrato punchcards use -- which is semi-goal-aware (completely untested! whee!)

As with any update/change this major, I expect there to be some things that I missed in the transition, clashes between the old way and the new, or other oversights. Please report problems here.

Once we have worked the kinks out of this particular version, I'm satisfied enough to call this the real SmartStasis and do away with the old version (and FTF) once and for all!

@Drkirre: This update requires mafia r9197 or higher. Also, be aware that SmartishStasis, at present, does not have version checking.
 

Theraze

Active member
Combat is aborting for me like this now:
Request 1 of 144 (Manor0: Haunted Wine Cellar (automatic)) in progress...

[2799] Haunted Wine Cellar (Northeast)
Encounter: skeletal sommelier
Strategy: C:\Program Files (x86)\KoLMafia\ccs\default.ccs [default]
Round 0: Theraze loses initiative!
Monster value: 1287.0
Profit per round:
Action Profit Damage Other base; Animated Macaroni Duck (0μ) -2.15μ 6.93 (0 MPD) MP: 6.93
1/2 monsters drop goals here.
This monster is the best source of goals (1)!
CATEGORY II: skill 19 (stun first with use 2678)
Round 1: Theraze executes a macro!
Round 1: Theraze uses the spectre scepter!
Round 2: skeletal sommelier takes 16 damage.
You're on your own, partner.
Click here to continue in the relay browser.

I BELIEVE that it's aborting when the delevel actually triggers, since on checking the relay browser, the skeletal sommelier has been deleveled by the AMD.

Edit: Nope, I was wrong. Here's the abort message:
You don't have or can't use skill #19, macro aborted.
Basically, it's trying to use TO on my bounty mob, without verifying that I have TO. Maybe changing this:
Code:
   if (have_effect($effect[on the trail]) == 0 && should_olfact)
to this:
Code:
   if (have_effect($effect[on the trail]) == 0 && should_olfact && have_skill($skill[olfaction]))
 
Last edited:

zarqon

Well-known member
Okay, two bugs squished with one bug report; excellent. 1) The have_skill() check for Olfaction which mysteriously disappeared in the transition has been reintroduced. And b) there's no reason it should try to stun before Olfacting using an item that doesn't stun multiple rounds. Tweaked that a bit to choose stunners more wisely. That's the part I'm anticipating the most problems with, actually. I'm hoping that with the way stun_action() is coded, it will prefer Noodles as a cheap multi-round stunner if available.

Updates made, thanks Theraze. Grab them both again from the first post for great justice.
 

Theraze

Active member
Exciting new bug... some sort of famgear evaluation error:
Request 1 of 54 (BatHole: Bat Hole Entryway) in progress...
[209] Bat Hole Entryway
Encounter: albino bat
Strategy: C:\Program Files (x86)\KoLMafia\ccs\default.ccs [default]
Round 0: Theraze loses initiative!
Monster value: 92.44
Evaluator syntax error: can't understand famgear
Profit per round: ActionProfitDamageOtherbase; Autonomous Disco Ball (0μ)-1.38μ--
Evaluator syntax error: can't understand famgear
Evaluator syntax error: can't understand famgear
Evaluator syntax error: can't understand famgear
Evaluator syntax error: can't understand famgear
Evaluator syntax error: can't understand famgear
Evaluator syntax error: can't understand famgear
Evaluator syntax error: can't understand famgear
Round 1: Theraze executes a macro!
Round 1: Theraze attacks!
Round 2: albino bat takes 3 damage.
Round 2: "Evaluating target... Target judged: ungroovy" Gog intones solemnly, then blasts your opponent with a laser beam for 16 damage.
Round 2: albino bat takes 16 damage.
Round 2: Theraze wins the fight!
You gain 19 Meat
You gain 2 Muscleboundness
You gain 3 Mysteriousness
 

zarqon

Well-known member
Different names in the data file vs. the script... it's "famspecgear" in the script. I think I like "famgear" better, so I'll change it in the script. If you'd like to do the same, it's line 14. It'll make its way into the script whenever I upload the fix to whatever error you find next. :)
 

EdFox

Member
New error. First, a combat with the same error Theraze got, but with new and different error lines.

Code:
[1008] Fantasy Airship
Encounter: Irritating Series of Random Encounters
Strategy:     C:\Users\Eszetela\Documents\My Dropbox\KoLmafia\.kolmafia\ccs\Farm.ccs     [default]
Round 0: edfox wins initiative!
Checking     for updates (running BatBrain ver. 0.7.8)...
_version_batbrain     => 0.7.8
You have a current version of BatBrain.
map_pluralMonsters.txt     => 2011-02-28T13:05:11-06:00, checked 20110402
You     have the latest pluralMonsters.txt. Will not check again today.
map_batfactors.txt     => 2011-03-28T10:15:46-05:00, checked 20110402
You     have the latest batfactors.txt. Will not check again today.
Evaluator     syntax error: can't understand famgear)*(0.75*20.0+2)
Evaluator syntax     error: expected ), found
Evaluator syntax error: can't understand     famgear)*(20.0/1.5+2)
Evaluator syntax error: expected ), found
Evaluator     syntax error: expected ), found
1/6 monsters drop goals here.
Round     1: edfox executes a macro!
Round 1: edfox attacks!
Round 2: edfox     wins the fight!
You gain 116 Meat
You gain 10 Strongness
You gain     6 Magicalness
You gain a Mysticality point!
You gain 10 Sarcasm
You     can now equip a a butt tuba (and pos

Now, this is after I fixed the famgear thing in batbrain. One bugged line remains:
Code:
[1009] Fantasy Airship
Encounter: Irritating Series of Random Encounters
Strategy:     C:\Users\Eszetela\Documents\My Dropbox\KoLmafia\.kolmafia\ccs\Farm.ccs     [default]
Round 0: edfox loses initiative!
You lose 33 hit points
Evaluator     syntax error: expected ), found
1/6 monsters drop goals here.
Round     1: edfox executes a macro!
Round 1: edfox attacks!
Round 2: edfox     wins the fight!
You gain 135 Meat
You acquire an item: tiny house
You     gain 15 Fortitude
You gain 9 Magicalness
You gain 1 Chutzpah

Running 9204, latest Brain, Smartish. CCS is just 1. Smartish 2. Spamattack
Sorry for the ugly report, finding that missing paren sounds like a pain to me. I only deleted the "spec" chars and otherwise BB is exactly what's in your post. :confused:

EDIT: I have more. I kept getting the exact same thing, just that one line but working fine... until it cast TO on a Goth Giant, then I got lots of those lines...
Code:
[1061] Giant's Castle
Encounter: Goth Giant
Strategy:     C:\Users\Eszetela\Documents\My Dropbox\KoLmafia\.kolmafia\ccs\Farm.ccs     [default]
Round 0: edfox loses initiative!
You lose 51 hit points
Evaluator     syntax error: expected ), found
4/6 monsters drop goals here.
Evaluator     syntax error: expected ), found
Evaluator syntax error: expected ),     found
Evaluator syntax error: expected ), found
Evaluator syntax     error: expected ), found
Evaluator syntax error: expected ), found
Evaluator     syntax error: expected ), found
Evaluator syntax error: expected ),     found
Evaluator syntax error: expected ), found
Evaluator syntax     error: expected ), found
Evaluator syntax error: expected ), found
Evaluator     syntax error: expected ), found
Evaluator syntax error: expected ),     found
Evaluator syntax error: expected ), found
Evaluator syntax     error: expected ), found
Evaluator syntax error: expected ), found
Evaluator     syntax error: expected ), found
Evaluator syntax error: expected ),     found
Evaluator syntax error: expected ), found
Evaluator syntax     error: expected ), found
Evaluator syntax error: expected ), found
Evaluator     syntax error: expected ), found
Round 1: edfox executes a macro!
Round     1: edfox casts TRANSCENDENT OLFACTION!
You acquire an effect: On the     Trail (duration: 40 Adventures)
You lose 51 hit points
Round 2:     edfox executes a macro!
Round 2: edfox attacks!
Round 3: edfox wins     the fight!
You gain 149 Meat
You acquire an item: Warm Subject gift     certificate
You acquire an item: awful poetry journal
You gain 16     Beefiness
You gain 5 Magicalness
You gain a Mysticality point!
You     gain 13 Cheek
 
Last edited:

zarqon

Well-known member
Give me another result with your verbosity set to 10. It'll be lengthy, but should help me track down the problem much more easily.
 
Last edited:

Bale

Minion
Tweaked that a bit to choose stunners more wisely.

I was wondering if you had considered the idea that if it is running out of stunners and it is in aftercore, your script might set a property that informs a betweenBattleScript or mood script that it should purchase an item of its choice. That way the character would never have to worry about running out.
 

zarqon

Well-known member
A nifty idea; however, stunners will generally only be profitable a) before flyering/insults/putty, or 2) if the monster will likely do enough damage to you to offset the cost of the stunning item/skill. These are all likely during a run -- but in aftercore, only putty is likely, and that five times a day.

If you can explain other cases where this would be a feature worth adding another ZLib setting for, I'm all ears.
 

Bale

Minion
Ah. A nifty idea, but lacking in application for now. :(

Perhaps if/when the day arrives that you write BatMan, it could recommend purchase of items to make killing monsters more optimal. SmartStasis isn't concerned with defeating monsters so its uses are more limited.
 

jwylot

Member
Adventuring in BM and it seems that smartish is trying to olfact the Quiet Healer guy with the result that the combat aborts and relay browser tells me I don't have skill 19.
 

zarqon

Well-known member
Either you didn't grab the latest SishS (there's no version checking) or mafia mistakenly thinks you have Olfaction in BM (a bug which has been reported before, but probably fixed...?).
 

Theraze

Active member
Can you check if your 'on the trail' line looks like this:
Code:
   if (have_effect($effect[on the trail]) == 0 && should_olfact)
or this:
Code:
   if (have_skill($skill[olfaction]) && have_effect($effect[on the trail]) == 0 && should_olfact)

What you're describing sounds like the first...
 

jwylot

Member
I have the second now but I did download current version so maybe old version had the first. It overwrote so I can't check now. Both are shown as 3.0 in the header but that may be misleading. Thanks for your time. :)
 
Top