SmartStasis -- a complex script for a simple CCS

zarqon

Well-known member
BB only includes skills that actually appear in the skill dropdown provided by KoL. If the skill appears there even without Trusty equipped, that's something KoL does which I don't like, but we can work around it in BB. If the skill does not appear there but is being used by a BB-powered script anyway, it should be reported to the author of that script.

Easiest way to figure that out is for someone to tell me if Mighty Axing appears in the dropdown on fight.php even without Trusty equipped. If yes, I'll add the code to skip it to BB.
 

Fluxxdog

Active member
It does. Personal experience taught me that fast. Made me adjust my wardrobe script to make sure I always force Trusty when I'm an AoB.
 

Winterbay

Active member
Yep, WHAM has been updated to work around this for now (there is an ok()-function for a reason after all...).

Edit: I do believe that at first it did actually work without Trusty as well, but that has since been changed but the skill still stays even though you can't use it.
 

Bale

Minion
Edit: I do believe that at first it did actually work without Trusty as well, but that has since been changed but the skill still stays even though you can't use it.

If that was changed, it was changed quickly. I ascended as a Boris a few hours after implementation and on my first day I tried using "Mighty Axing" without Trusty equipped. I'm just that sort of person.

I remember laughing at the failure message. That alone made it worthwhile to have done something silly.
 

Theraze

Active member
Was looking at SmartStasis today and noticed something a bit odd in main(), specifically these two lines:
Code:
   enqueue_custom();
   if (queue[0].id == "pickpocket" && my_class() == $class[disco bandit]) try_custom();
I'm assuming this is so that if you're a disco bandit and you happen to have double-pickpocket through the outfit, it will try to steal, then check again... the problem is that try_custom() does this:
Code:
string try_combos() {
   enqueue_combos();
   if (count(queue) > 0) return macro();
   return page;
}
so that means our actual code does this:
Code:
   enqueue_combos();
   enqueue_combos();
   if (count(queue) > 0) return macro();
   return page;
I'm thinking that the try_combos() is probably supposed to be up a line, so that if you're a disco bandit and you try to steal (and fail), it will re-enqueue more actions with what time and available actions remain, instead of trying to enqueue twice in a row... or did I miss something obvious here?
 

zarqon

Well-known member
I think the code in the current release is wrong if it's what Theraze posted. My SS, which is soon to be everyone's, has this instead:

PHP:
   if (count(queue) > 0 && queue[0].id == "pickpocket" && my_class() == $class[disco bandit]) try_custom();
    else enqueue_custom();
  // combos
   build_combos();
   if (($familiars[hobo monkey, gluttonous green ghost, slimeling] contains my_fam() && !happened("famspent")) || have_equipped($item[crown of thrones])) try_combos();
    else enqueue_combos();

I've made a lot of improvements since implementing Bale's server-hit-saver idea, but those lines may be the most important ones. Honestly, I've been working on this script most every day and trying to get them all to a releasable state, but since I've made changes to BB that break the current SS, I'll need to update them both at the same time. Unfortunately, I also made a lot of promises about what I would fix/include in the "next" release. :)
 

Theraze

Active member
You seem to have mixed up try_custom and try_combo there. Was that intentional?

Heh. Nope. I scrolled up instead of doing a find. Just replace the word combo with custom, and you'll get the proper result. :D Both try_custom and try_combo do the same sorts of thing, enqueue-ing their category and then immediately calling them.

Thanks, zarqon. Okay, I'll put in that else and put it down a line. Should save a tiny bit of calculation for DBs. :)
 

zarqon

Well-known member
New SS fixes everything!

I even added some code to end poverty and reduce both pollution and the income gap.
 

Magus_Prime

Well-known member
The handling of pirate insults, while auto-adventuring, in conjunction with the new versions of SmartStasis, Batbrain and WHAM, is no longer working.
 
Last edited:

zarqon

Well-known member
The handling of pirate insults and flyers, in conjunction with the current versions of BB and SS, is tested working fine on my end. I'd suggest it must be a WHAM problem.

@edge: When I moved the tracking from SS to BB, I accidentally copied it rather than moved it. Actually deleting the code from SS must have solved it. Yay!
 

Bale

Minion
The handling of pirate insults and flyers, in conjunction with the current versions of BB and SS, is tested working fine on my end. I'd suggest it must be a WHAM problem.

I just tested flyering using SS powered DestroyAllMonsters and I was extremely happy with the way it worked. No bug here!
 

illarion

Member
I am having problems with flyering and insults. I updated WHAM, BatBrain and SmartStasis all at once - I haven't worked out where the issue is yet.
 

Winterbay

Active member
Yeah, I deleted a macro()-command too much when I moved the new main-function from SS to WHAM. Fixed in 2.1.1 (not that that still doesn't have other problems...)
 

rlbond86

Member
Can someone help me? SmartStasis has decided to only use the skill LASAGNA BANDAGES, even when I am at full HP. Here's an excerpt from my cli:

Code:
Top of the stasis loop.
Queued: skill 3009
Building options...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating '2.7*(5.5+min(0.07*145.0,15)+min(0.0,25)+3.3333333333333335)'...
Evaluating '2.7*(12+min(0.15*145.0,20)+min(0.0,40)+3.3333333333333335)'...
Evaluating '2.7*(28+min(0.25*145.0,30)+min(0.0,60)+3.3333333333333335)'...
Evaluating '2.7*(2.5+min(0.0,5)+0.0)'...
Options built! (112 actions)
Constructed macro: scrollwhendone; sub batround; endsub; sub finito; skill 3009; call batround; endsub; call finito; repeat hasskill 3009 && (!hpbelow 169.0 && hpbelow 275 && !mpbelow 140.0 && !pastround 26)
Round 15: rlbond86 executes a macro!
Round 15: rlbond86 casts LASAGNA BANDAGES!
You gain 20 hit points
Round 16: Dr. Stompsalot boots him, then re-boots him again, for a total of 28 damage.
Round 16: ninja snowman weaponmaster takes 28 damage.
Round 16: rlbond86 wins the fight!
After Battle: Sheeeeesheeeee looks stronger...
After Battle: Dr. Stompsalot stomps around in a circle, its buckles jingling.
You acquire an item: coal button
After Battle: The merest suggestion of a smile crosses Sheeeeesheeeee's wispy form as he whispers "You have performed... adequately."
You gain 12 Strengthliness
You gain 21 Mysteriousness
You gain 8 Chutzpah
Happened: skill 3009
Parsed round number: 16
Look! You found 1 coal button (50μ)!
Building options...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating '2.7*(5.5+min(0.07*145.0,15)+min(0.0,25)+3.3333333333333335)'...
Evaluating '2.7*(12+min(0.15*145.0,20)+min(0.0,40)+3.3333333333333335)'...
Evaluating '2.7*(28+min(0.25*145.0,30)+min(0.0,60)+3.3333333333333335)'...
Evaluating '2.7*(2.5+min(0.0,5)+0.0)'...
Options built! (112 actions)
Stasis action chosen: skill 3009 (round 16, profit: 81.24)
ridiculously overelaborate ninja weapon (5.0 @ +118.62019348144531): 120μ * 10.931009674072266% = 13.117211608886718
frigid ninja stars (20.0 @ +118.62019348144531): 67μ * 43.724038696289064% = 29.295105926513674
frozen nunchaku (5.0 @ +118.62019348144531): 359μ * 10.931009674072266% = 39.24232472991943
Value of stat gain: 196.88μ
Attack action chosen: attack (round 16, profit: -4.52)
Top of the stasis loop.
Queued: skill 3009
Building options...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating 'loc(vibrato)'...
Evaluating '2.7*(5.5+min(0.07*145.0,15)+min(0.0,25)+3.3333333333333335)'...
Evaluating '2.7*(12+min(0.15*145.0,20)+min(0.0,40)+3.3333333333333335)'...
Evaluating '2.7*(28+min(0.25*145.0,30)+min(0.0,60)+3.3333333333333335)'...
Evaluating '2.7*(2.5+min(0.0,5)+0.0)'...
Options built! (112 actions)
Constructed macro: scrollwhendone; sub batround; endsub; sub finito; skill 3009; call batround; endsub; call finito; repeat hasskill 3009 && (!hpbelow 169.0 && hpbelow 275 && !mpbelow 172.0 && !pastround 24)
Parsed round number: 0
Stasis loop complete.
SmartStasis complete.
 
Top