SmartStasis -- a complex script for a simple CCS

slyz

Developer
I would have felt bad if I had been wrong - I didn't even check batbrain.ash before posting ^^

It just happened that this kind of error has cropped up already, and using skill names instead of numbers was the cause.
 

tragus

Member
Thanks muchly for the quick fix. A little Mafia restart after the new versions shows that the item/skill/int/name works now. Of course, I'll have to wait until tomorrow for BB (via zlib's check_ver()) to recognize that I'd rather not "upgrade BatBrain from 0.8.4 to 0.8.3" (even though I *tried* to edit my _prefs.txt file).
 

tragus

Member
vars_tragus is the file you need to edit for that, not tragus_prefs. :)

Ummm, which zlib var in vars_tragus should I edit to let the world know I actually have the most current BatBrain? I note that the _version in tragus_prefs appears to get overwritten with "0.8.3" sometime after I try *that* edit.
 

Bale

Minion
@Bale: I'd missed your post earlier. SS will skip items in your custom list if a) you lack the MP to cast them, or b) your expected damage is likely to be the end of you. However, if these conditions change later in the stasis loop it will still perform the actions. I suspect your MP was simply too low.

That was aftercore so I had plenty of MP -- my restoration settings ensured it. I had even more MP after the burrowgrub was used. MP was not a problem. As for expected damage --- once again I'll plead aftercore.
 

heeheehee

Developer
Staff member
The only automatic updating is that of the datafiles. Which, for BatBrain, is where most of the updating action is, so I guess that's in some sense correct.
 

Theraze

Active member
Sorry tragus, I was wrong. Just checked zlib and it's actually in the prefs file... open it up, look for _version_batbrain=0.8.3 and change either remove it or change it to _version_batbrain=0.8.4 and you should be fixed up... Remember though that editing the prefs file works MUCH better when mafia is closed. Or use set_property (or a relay script) to do it...
 

Bale

Minion
The best way to do that as a CLI command is: set _version_batbrain =
That clears the setting so that BatBrain can realize it is up to date.

===================================

I just found something that SS does in the wrong order.

I set duct tape as a goal because otherwise it would not use rave concentration. Curiously, now it will use Rave Concentration and then use Rave Steal. this is funny because if it gets the duct tape from the Rave Steal then it had no need to use Rave Concentration. Shouldn't that be in the other order so that it can skip Rave Concentration if the steal is successful?

Code:
[1502] Other Back 40
Encounter: greasy duck
Strategy: C:\My Dropbox\KolMafia\ccs\default.ccs [default]
Round 0: zzz loses initiative!
Round 1: zzz executes a macro!
Round 1: zzz casts POP AND LOCK IT!
Round 2: greasy duck takes 5 damage.
Round 2: zzz casts RUN LIKE THE WIND!
Round 3: greasy duck takes 11 damage.
Round 3: zzz casts BREAK IT ON DOWN!
You acquire an effect: Rave Concentration (duration: 1 Adventure)
Round 4: zzz executes a macro!
Round 4: zzz casts RUN LIKE THE WIND!
Round 5: greasy duck takes 8 damage.
Round 5: zzz casts BREAK IT ON DOWN!
Round 6: greasy duck takes 12 damage.
Round 6: zzz casts POP AND LOCK IT!
Round 7: greasy duck takes 15 damage.
You acquire an item: duct tape
Round 7: zzz executes a macro!
Round 7: zzz casts BREAK IT ON DOWN!
Round 8: greasy duck takes 5 damage.
Round 8: zzz casts RUN LIKE THE WIND!
Round 9: greasy duck takes 13 damage.
Round 9: zzz casts POP AND LOCK IT!
Round 10: greasy duck takes 16 damage.
You acquire an effect: Rave Nirvana (duration: 1 Adventure)
Round 10: zzz executes a macro!
Round 10: zzz attacks!
Round 11: greasy duck takes 27 damage.
You lose 19 hit points
Round 11: zzz attacks!
Round 12: greasy duck takes 39 damage.
Round 12: zzz attacks!
Round 13: greasy duck takes 39 damage.
Round 13: zzz wins the fight!
You gain 244 Meat
After Battle: Get Items does a little fairy dance.
You gain 16 Strengthliness
You gain 9 Wizardliness
You gain 21 Roguishness
 
Last edited:

zarqon

Well-known member
You reported this before, Bale. Making Rave Steal account for a 100% chance of an unconditional drop (rather than a normal pickpocket chance) is still on the to do list.

I've been thinking that there should be a tweak to item_val() -- prompted specifically by duct tape, in fact. In the case of duct tape, trophies and nice gear aside, at the least it can be made into duct tape wallets, which are quite profitable. However, item_val() evaluates duct tape -- a nontradeable item with no autosell value -- as worth 0. I think if an item can be made into a more valuable item, the ingredient should be considered as worth (createditemvalue/ingredientsnumber - cost of all other ingredients). But this gets into very convoluted territory -- making items sometimes takes adventures, sometimes not, and those are situationally valuable. Plus, knowing whether making something is going to take an adventure is ugly to code and would involve user preferences about using Inigo's or installing servants.

I'm thinking presently to ignore the cost of crafting (leave that to the user to figure out after getting the item, since BatBrain is certainly not going to be actually creating items). More excitingly, the same tweak could be made to ZLib's has_goal() -- if an item is an ingredient of a goal, it should count as 1/goalitemingredientcount of a goal. I'll have to foreach over all items in the game to figure this out though, ugh.

This would also mean -- even more so than currently -- that in order to get the most out of SS you really need to have the "share mall prices" option clicked, since mall_price() is not available in combat and it's unlikely that you would have searched a bunch of items in the mall prior to starting your combats for the day. I'll add something to that effect to the first post.

I also meant to update check_version() with StDoodle's crazy "integer > integer means OK" tweak but haven't gotten around to it yet. In the meantime, you'll need to edit your _prefs file when this happens, as was pointed out above.
 

Bale

Minion
I don't really think there needs to be a change to item_val(). If you set an item as a goal it will get preferential treatment regardless of value and that's all that really needs to be. It's fine if I need to set duct tape as a goal to get Rave Concentration.
 

Bale

Minion
I have a question. I'm a Turtle Tamer with a shield and sufficient muscle to adventure safely. I'm curious why SS is using clobber which costs 1 MP instead of toss which uses 0 MP or a seal-tooth which would stasis better because it does less damage:

Code:
[31] Guano Junction
Encounter: skullbat
Round 0: bale wins initiative!
Round 1: Princess Vina is looking a little thin.
(unable to macrofy due to action: consult SmartStasis.ash)
Round 1: bale executes a macro!
Round 1: bale casts SAUCY SALVE!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
You gain 12 hit points
Round 2: bale executes a macro!
Round 2: bale casts CLOBBER!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 3: skullbat takes 13 damage.
You lose 1 hit point
[COLOR="#808000"]Your slimeling needs sating.[/COLOR]
(unable to macrofy due to action: consult SmartStasis.ash)
[COLOR="#808000"]Your slimeling needs sating.[/COLOR]
Round 3: bale executes a macro!
Round 3: bale attacks!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 4: skullbat takes 25 damage.
Round 4: bale wins the fight!
You gain 42 Meat
After Battle: Princess Vina hops around, dancing a jig accompanied by wet squelching noises.
You acquire an item: loose teeth
You acquire an item: broken skull
You gain 4 Beefiness
You gain 3 Mysteriousness
You gain 2 Sarcasm
You can now equip a Rock and Roll Legend (and possibly other things).
You gain a Moxie point!
 

fronobulax

Developer
Staff member
I also meant to update check_version() with StDoodle's crazy "integer > integer means OK" tweak but haven't gotten around to it yet. In the meantime, you'll need to edit your _prefs file when this happens, as was pointed out above.

This would seem to impose a new version description format on scriptwriters. Unless I am completely misunderstanding the code, it currently would work if I called my version "Beta" and then chose to update it to "1.0". Perhaps rephrasing the message so it says that "You are running version Beta but version 1.0 is hosted at kolmafia.us"? That says nothing about which one is newer.

Since the calling script passes its self identification to check_version I wonder if an alternative might be to compare the passed version to the property. If they are not the same then there is clearly something going on. Under the circumstances I would override the property with the passed value before doing any checking against kolmafia.us. That is because I consider the version information embedded in the script to be more authoritative than the version contained in the property. Indeed, as near as I can tell, the only reason for the property is to limit the version checking to once a day so that it doesn't annoy people who refuse to update (for sometimes valid reasons).
 

zarqon

Well-known member
@frono: If and when I do change check_version(), rest assured no functionality would be removed. In cases like this where one integer simply advanced, it would simply not put up a fuss if the version in the property appears to be older. If the version name changed entirely, the current behavior would remain.

@Bale: Please include the little profit per round table in your CLI results. That is there for all of us.

You're asking a question which you're nearly as qualified to answer. To stasis, SS sorts your actions by profit, and then by -damage. So, which actions do the least damage? Then, of those, which one is the most profitable? Is it at least BatMan_profitforstasis profitable? If so, it will perform that action.

If there are superior actions which are skipped, then somehow BatBrain is being misinformed. First, is the action you think to be superior listed correctly in the data file? Second, is the inferior action listed correctly? If it's not in that file, SS won't know it exists. If that checks out, is anything wonky with your meatperhp/mp values? If UR somehow set your meatpermp to 0, for instance, SS thinks all your skills are free to cast!

What I'm saying here is basically that I have far too little information to answer this question.
 

kain

Member
I can't just add "hippy" to the ftf_yellow zlib variable ... can I? I usually (I'm lazy) yray the first *hippy I come to after I open the island for the hippy disguise, and then when I go to start the war, I usually just wanna yray the first hippy I come to in the hippy camp for the war outfit.

I'll test the war hippy outfit once I get there, but I figured I'd ask.
 

tragus

Member
Ahem, with BB 0.8.4 and virtually the same environment as I reported above, I now get gCLI output as:
Code:
[3072] The Ancient Hobo Burial Ground
Encounter: Rufus "Heebie-Jeebies" Wilson, the Eldritch Mist
Strategy: G:\KoLMafia-Otto\ccs\Smart_TT.ccs [hobo]
Round 0: tragus loses initiative!
Round 1: Wibbly-wobbly-timey-wimey lights a cute little string of firecrackers and tosses them on the ground behind your opponent.
Round 1: spooky hobo takes 1 damage.
Round 1: spooky hobo takes 1 damage.
Round 1: spooky hobo takes 5 damage.
You lose 14 hit points
Factoring in Scarysauce: (6) damage, retal
Monster value: 1850
Profit per round: ActionProfitDamageOtherbase; Llama Lama (0μ)-5.25μ--
Round 1: tragus executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
You're on your own, partner.

My minibrowser shows the error:
Code:
>You don't have or can't use skill #7021, macro aborted.

Skill #7021 is, of course, "Ask Richard for a Bandage" -- which is available and usable manually.

I thought things were working for a day or so, but now this is quite repeatable.
 

slyz

Developer
I can't just add "hippy" to the ftf_yellow zlib variable ... can I?
I don't think so, it works the other way around:
PHP:
contains_text(to_lower_case(vars["ftf_yellow"]),to_lower_case(last_monster().to_string()))
The monster you want to YR has to be a substring of the ftf_yellow var.

EDIT:
Code:
>You don't have or can't use skill #7021, macro aborted.
Maybe that's a bug with KoL Macros ? Can you try creating this macro in KoL:
Code:
skill 7021
abort
and use it in combat once you are sure you can use the skill?
 
Last edited:

Bale

Minion
You're asking a question which you're nearly as qualified to answer. To stasis, SS sorts your actions by profit, and then by -damage. So, which actions do the least damage? Then, of those, which one is the most profitable? Is it at least BatMan_profitforstasis profitable? If so, it will perform that action.

If there are superior actions which are skipped, then somehow BatBrain is being misinformed. First, is the action you think to be superior listed correctly in the data file? Second, is the inferior action listed correctly? If it's not in that file, SS won't know it exists. If that checks out, is anything wonky with your meatperhp/mp values? If UR somehow set your meatpermp to 0, for instance, SS thinks all your skills are free to cast!

I found the problem in Batfactors!

Code:
skill	1022	Clobber	0	physical

According to the wiki it deals damage, according to this formula:
[(10% to 20% of Weapon Power + 0 to 1) or 1 if barehanded ] + ceiling(sqrt(Bonus Weapon Damage)) + ceiling(sqrt(Bonus Hot Damage)) + ceiling(sqrt(Bonus Cold Damage)) + ceiling(sqrt(Bonus Stench Damage)) + ceiling(sqrt(Bonus Spooky Damage)) + ceiling(sqrt(Bonus Sleaze Damage))

I haven't figured out how to express that for batfactors yet.
 

Theraze

Active member
Seal Clubbers just get all kinds of love...
skill 1003 Thrust-Smack 0 physical regular
skill 1004 Lunge-Smack 0 physical regular
skill 1005 Lunging Thrust-Smack 0 physical regular
skill 1022 Clobber 0 physical
Though there are a few others that present some... interesting results.
skill 7008 Moxious Maneuver 0 physical regular

Guessing that all of those are going to need updating?
 
Top