BatBrain -- a central nervous system for consult scripts

Theraze

Active member
Well, my line 544 in BatBrain is this:
Code:
   if (my_fam() != $familiar[frumious bandersnatch]) remove factors["bander"];    // remove irrelevant batfactors to
NOTHING about that would make any sense for casting a value to an aggregate.
 

fxer

Member
So do I need to adjust my local copy of batbrain until the script is updated for the fat stacks change? My combats just hang with:
(Fat Stacks is item 185, btw)

Code:
Base round: 0 damage, 0 player damage, 37.93 meat
Options built! (232 actions)
Stasis action chosen: use 185 (round 3, profit: 37.93)
Attack action chosen: attack (round 3, profit: 37.93)
Top of the stasis loop.
Queued: use 185
Building options...
Events created: attack, (blank)
Events created: use 2, use 8, use 27, use 28, use 145, use 181, use 185, use 208, use 231, use 232, use 233, use 234, use 270, use 344, use 345, use 347, use 353, use 357, use 452, use 464, use 469, use 474, use 546, use 547, use 548, use 549, use 550, use 551, use 559, use 563, use 613, use 615, use 624, use 630, use 747, use 779, use 819, use 820, use 821, use 822, use 823, use 824, use 825, use 826, use 827, use 829, use 910, use 1051, use 1055, use 1067, use 1071, use 1075, use 1079, use 1159, use 1316, use 1334, use 1335, use 1336, use 1389, use 1390, use 1391, use 1394, use 1510, use 1704, use 1705, use 1777, use 1788, use 1907, use 1922, use 1939, use 1958, use 1960, use 1965, use 2040, use 2041, use 2042, use 2043, use 2067, use 2068, use 2091, use 2092, use 2129, use 2131, use 2133, use 2138, use 2237, use 2240, use 2341, use 2348, use 2349, use 2350, use 2351, use 2369, use 2371, use 2374, use 2378, use 2396, use 2397, use 2400, use 2402, use 2437, use 2438, use 2439, use 2492, use 2493, use 2538, use 2575, use 2581, use 2582, use 2606, use 2608, use 2613, use 2617, use 2619, use 2644, use 2645, use 2646, use 2647, use 2648, use 2678, use 2687, use 2696, use 2704, use 2715, use 2947, use 2956, use 2966, use 2992, use 3020, use 3063, use 3065, use 3082, use 3099, use 3111, use 3112, use 3118, use 3146, use 3147, use 3148, use 3149, use 3150, use 3151, use 3152, use 3153, use 3154, use 3155, use 3403, use 3448, use 3462, use 3467, use 3480, use 3594, use 3597, use 3665, use 3726, use 3729, use 3730, use 3734, use 3754, use 3755, use 3756, use 3757, use 3758, use 3759, use 4045, use 4046, use 4084, use 4087, use 4116, use 4118, use 4119, use 4120, use 4121, use 4137, use 4210, use 4231, use 4236, use 4251, use 4256, use 4330, use 4331, use 4582, use 4628, use 4698, use 4699, use 4736, use 4867, use 5048, use 5105, use 5120, use 5308, use 5309, use 5327, use 5433, use 5531, use 5557, use 5560, use 5561, use 5563, use 5678, use 5750, use 5907, use 5983, use 5988, use 5989, use 6278, use 6282, use 6284, use 6864, use 6865, use 6866, use 6871, use 7383
Events created: skill 15, skill 55, skill 2022, skill 2023, skill 3019, skill 3022, skill 3004, skill 3005, skill 3007, skill 4009, skill 6025, skill 7010, skill 7011, skill 7012, skill 7013, skill 7014, skill 7095, skill 7169, skill 7171, runaway; repeat
Events created: companion Adorable Seal Larva
Base round: 0 damage, 0 player damage, 37.93 meat
Options built! (232 actions)
Constructed macro: scrollwhendone; sub finito; use 185; endsub; call finito; repeat hascombatitem 185 && (!hpbelow 9080.0 && !mpbelow 542.0 && !pastround 26 && !match "acquire an item")
Round 64: fxer executes a macro!
Round 64: fxer uses the fat stacks of cash!
 

Bale

Minion
That should be just a batfactors change. I've updated batfactors for you. Delete /data/batfactors.txt and the next combat you're in, BatBrain will download the new versinon.
 

fxer

Member
That should be just a batfactors change. I've updated batfactors for you. Delete /data/batfactors.txt and the next combat you're in, BatBrain will download the new versinon.

Thanks bale that worked, however now it seems to be hanging on using the indigo cup multiple times, any idea what causes that?

Code:
[363870] The Castle in the Clouds in the Sky (Top Floor)
Encounter: Raver Giant
Strategy: D:\Dropbox\KoL Mafia - fxer\ccs\consult.ccs [default]
Round 0: fxer wins initiative!
Base round: 12.87 damage, 0 player damage, 12.87 MP, 38.18 meat
Round 1: fxer executes a macro!
Round 1: fxer tries to steal an item!
Round 2: Party Probe tosses his identity disc at him for 38 damage, then invites you to drink some glowing blue liquid out of the disc. The whole thing's a little more intimate than you're comfortable with, but it's still refreshing.
Round 2: Raver Giant takes 38 damage.
You gain 38 Mojo Points
Round 2: fxer executes a macro!
Round 2: fxer casts POCKET CRUMBS!
Round 3: Raver Giant drops 15 attack power.
Round 3: Raver Giant drops 17 defense.
Round 3: Titty Pinniped tosses you a clump of nuggets. I don't know where they came from, and I'm not going to ask.
You acquire an item: cold nuggets
Round 3: fxer executes a macro!
Round 3: fxer uses the Rain-Doh indigo cup!
You gain 852 hit points
Round 4: Party Probe bounces his disc off of him for 42 damage, and it ricochets into you, giving you quite a shock.
Round 4: Raver Giant takes 42 damage.
You gain 42 Mojo Points
Round 4: fxer uses the Rain-Doh indigo cup!
You're on your own, partner.
Click here to continue in the relay browser.
 

Winterbay

Active member
I know I had trouble with those not working as intended in WHAM for a while but since that code is no longer there I assume that specific problem has been fixed at least :)
 

fxer

Member
What is your CCS? Make sure item 5561 in your batfactors is marked with "once" as a starter.

CCS consults my own script first, which imports the SmartStasis.ash main() function, then passes combat off to WHAM. My script doesn't do any stunning or healing type stuff though so not sure why Indgo Cup would fire twice

part of a combat log verbosity 9, kind of looks like that first macro built says use 5561 repeatedly?

Code:
Base round: 13.37 damage, 0 player damage, 13.37 MP, 0 meat
Options built! (230 actions)
Constructed macro: scrollwhendone; sub finito; use 5561; endsub; call finito; repeat hascombatitem 5561 && (!hpbelow 5773.0 && !mpbelow 337.0 && !pastround 26 && !match "acquire an item")
Round 3: fxer executes a macro!
Round 3: fxer uses the Rain-Doh indigo cup!
You gain 1,154 hit points
Round 4: Party Probe tosses his identity disc at him for 34 damage, then invites you to drink some glowing blue liquid out of the disc. The whole thing's a little more intimate than you're comfortable with, but it's still refreshing.
Round 4: Raver Giant takes 34 damage.
You gain 34 Mojo Points
Round 4: fxer uses the Rain-Doh indigo cup!
Happened: use 5561
Happened: use 5561
Parsed round number: 5
Building options...
Events created: attack, (blank)
Events created: use 2, use 8, use 27, use 28, use 145, use 181, use 185, use 208, use 231, use 232, use 233, use 234, use 270, use 344, use 345, use 347, use 353, use 357, use 452, use 464, use 469, use 474, use 546, use 547, use 548, use 549, use 550, use 551, use 559, use 563, use 613, use 615, use 624, use 630, use 747, use 779, use 819, use 820, use 821, use 822, use 823, use 824, use 825, use 826, use 827, use 829, use 910, use 1051, use 1055, use 1067, use 1071, use 1075, use 1079, use 1159, use 1316, use 1334, use 1335, use 1336, use 1389, use 1390, use 1391, use 1394, use 1510, use 1704, use 1705, use 1777, use 1788, use 1907, use 1922, use 1939, use 1958, use 1960, use 1965, use 2040, use 2041, use 2042, use 2043, use 2067, use 2068, use 2091, use 2092, use 2129, use 2131, use 2133, use 2138, use 2237, use 2240, use 2341, use 2348, use 2349, use 2350, use 2351, use 2369, use 2371, use 2374, use 2378, use 2396, use 2397, use 2400, use 2402, use 2437, use 2438, use 2439, use 2492, use 2493, use 2538, use 2575, use 2581, use 2582, use 2606, use 2608, use 2613, use 2617, use 2619, use 2644, use 2645, use 2646, use 2647, use 2648, use 2678, use 2687, use 2696, use 2704, use 2715, use 2947, use 2956, use 2966, use 2992, use 3020, use 3063, use 3065, use 3082, use 3099, use 3111, use 3112, use 3118, use 3146, use 3147, use 3148, use 3149, use 3150, use 3151, use 3152, use 3153, use 3154, use 3155, use 3388, use 3403, use 3448, use 3462, use 3467, use 3480, use 3594, use 3597, use 3665, use 3726, use 3729, use 3730, use 3734, use 3754, use 3756, use 3757, use 3758, use 3759, use 4045, use 4046, use 4084, use 4087, use 4116, use 4118, use 4119, use 4120, use 4121, use 4137, use 4210, use 4231, use 4236, use 4251, use 4256, use 4330, use 4331, use 4582, use 4628, use 4698, use 4699, use 4736, use 4867, use 5048, use 5105, use 5120, use 5308, use 5309, use 5327, use 5433, use 5531, use 5557, use 5560, use 5678, use 5750, use 5907, use 5983, use 5988, use 5989, use 6278, use 6282, use 6284, use 6864, use 6865, use 6866, use 6871, use 7383
Events created: skill 15, skill 55, skill 2022, skill 2023, skill 3019, skill 3022, skill 3004, skill 3005, skill 3007, skill 4009, skill 6025, skill 7010, skill 7011, skill 7012, skill 7013, skill 7014, skill 7095, skill 7169, skill 7171, runaway; repeat
Events created: Rogue Program, companion Adorable Seal Larva
Base round: 13.37 damage, 0 player damage, 13.37 MP, 0 meat
Options built! (230 actions)
Stasis action chosen: use 2 (round 5, profit: 14.53)
Attack action chosen: attack (round 5, profit: 14.53)
This monster is not your huckleberry.
Stasis loop complete.
This monster is not your huckleberry.
Stun action chosen: use 5560 (round 5, profit: 14.53)
SmartStasis complete.
You're on your own, partner.
Click here to continue in the relay browser.
 
Last edited:

Bale

Minion
So... you're saying that your own script (which none of us have seen) uses the indigo cup twice and you're asking why it would do that since your script doesn't do any stunning or healing. Sigh.

I wouldn't even pretend that I can troubleshoot an unseen script whose purpose is unknown.

part of a combat log verbosity 9, kind of looks like that first macro built says use 5561 repeatedly?

Yup! It clearly does.
 

fxer

Member
So... you're saying that your own script (which none of us have seen) uses the indigo cup twice and you're asking why it would do that since your script doesn't do any stunning or healing. Sigh.

I wouldn't even pretend that I can troubleshoot an unseen script whose purpose is unknown.



Yup! It clearly does.

Nah my script doesn't do anything with the indigo cup, or using any other kind of items. Really it's for firing skills like Creepy Grin & Stinkeye, hence the importing of the SmartStais main() function. It's worked for almost 2 years now so just trying to track down what may have changed, the Fat Stacks change was part of it apparently.
 

Razorsoup

Member
Nah my script doesn't do anything with the indigo cup, or using any other kind of items. Really it's for firing skills like Creepy Grin & Stinkeye, hence the importing of the SmartStais main() function. It's worked for almost 2 years now so just trying to track down what may have changed, the Fat Stacks change was part of it apparently.

The easy way to prove that your script is not the cause of this issue would be to remove your script from the equation. Might I suggest changing your CCS to something like "consult WHAM.ash" and running a battle or three with that and see if you encounter the same errors?
 

Winterbay

Active member
I had some time to play today so I decided to do it. I ran into an interesting issue though that I'm not sure if I should post here or in the zlib-thread but... WHAM evaluated the use of a scroll of unspeakable evil against a fernswarthy's ghost which would do 6670 damage. Along the way that got sent to rnum() to evaluate this value (5*monster_hp) which then returned "6 670," which promptly broke modifier_eval().

The issue appears to be that a floating number (6670.0) was passed to rnum which decided that it should do a rnum(6670.0, 2) (evaluate with two decimal places). The main version of rnum() then matched on the trailing zero and changed it into a comma. Changing rnum to check if floor(n) = ceil(n) stopped it from doing this but it still crashed and after further investigation I found that that was because the integer-version of rnum actually returns a string. Changing that to return int(n) instead of to_string(n,"%,d"); removed the error.
ANyone else had this issue or have I done something odd... :)
 

Winterbay

Active member
Right, now that you mention it I remember reading that. I guess just removing rnum from all those would also work pretty fine...
 

Crowther

Active member
Right, now that you mention it I remember reading that. I guess just removing rnum from all those would also work pretty fine...
I makes the output a bit verbose and ugly, but it seems to me formatting should happen on output, not on internal values.
 
Top