Winterbay's Helpful Automatic Monsterbasher (WHAM)

Hmm, might be the last part Theraze. I had randomly picked up the spices from one of the new gift packs. My guess is Mafia thought I had them in my inventory when in reality they go to storage (I think). Nice catch.
 

bombar

Member
Just downloaded this and started playing around with it today and let me first off say thanks.

Have two questions from my initial uses while in aftercore while getting all my reflection of maps before ascending.
1) Currently playing a Sauceror, and usually my attack action when not at full mp would be to cast curse of weaksauce, then cast saucegeyser, which kills most of the mobs I'm farming and allows me to restore 26 mp per turn. However, WHAM and its subscripts decide that I should instead just attack with my weapon since that is a 1 round kill.

2) Along the same lines, whenever I'm full of soulsauce, it decides that I need to cast Soul Blaze and 1-shot the monster I'm facing (dealing like 5k damage), while this isn't a terrible thing right now in aftercore, eventually if I use this during a run I wouldn't want it to do this unless that was the only way to 1-shot a monster. I don't want to add it to the never cast list since in some cases when it would kill while other spells wouldn't I don't care if its cast, I just would want it to be used when needed, not just when at full soulsauce.

Thanks,
 

Crowther

Active member
1) Currently playing a Sauceror, and usually my attack action when not at full mp would be to cast curse of weaksauce, then cast saucegeyser, which kills most of the mobs I'm farming and allows me to restore 26 mp per turn. However, WHAM and its subscripts decide that I should instead just attack with my weapon since that is a 1 round kill.
There has been some discussion about this before. I don't know how much got implemented since then.
 

Winterbay

Active member
1) I have not had time to implement anything regarding curse of weaksauce. I need to look at that.
2) That is a good question. I'll need to look at that I guess :)
 

Theraze

Active member
Both are probably tied into BatBrain tracking. I believe that it considers soul to have no value when it's full, since you're going to lose the bonus from the current fight anyways. And since it doesn't track the special effects of the curse spells, WHAM doesn't know about the special effects of the curse spells...
 

Magus_Prime

Well-known member
The recent change in zlib, that removed the tower_items function, breaks WHAM. Delete lines 464 - 467 in WHAM.ash to un-break it.
 

Magus_Prime

Well-known member
I'm getting this consistently today:

Code:
Expression syntax errors for 'modifier_eval()':
Can't     understand custom, endscombat (zlib.ash, line 186)
You're     on your own, partner.

Here's an example with a verbosity of 9.

Code:
[1073] The Secret Government Laboratory
Encounter: creepy little girl
Round     0: Arbos wins initiative!
BatMan RE disabled for     this character, skipping enhancements.
1     HP costs 1.4μ. ( 577 / 842 )
1 MP     costs 2.862μ. ( 235 / 719 )
WHAM: We     currently think that the round number is: 0 and that the turn number is     1072.
WHAM: Checking to see if WHAM sould     adjust the unknown_ml for creepy little girl.
WHAM:     No need to do anything with creepy little girl.
WHAM:     Setting up variables via BatBrain
Setting     monster to creepy little girl...
jangly     bracelet (0.01 @ +183): 111μ * 0.03% = 0.03
delicious     candy (0.01 @ +183): 930μ * 0.03% = 0.26
cuddly     teddy bear (0.01 @ +183): 1,155μ * 0.03% = 0.33
airborne     mutagen (0.01 @ +183): 4,000μ * 0.03% = 1.13
Value of stat     gain: 1,031.69μ
Loading batfactors...
Processing     batfactors...
Factoring in Jalapeño Saucesphere: 3 damage, retal
Factoring     in Scarysauce: (6) damage,     retal
You have plastic pumpkin bucket equipped: (7.35)     damage,
Events created: Jalapeño Saucesphere, Scarysauce, plastic     pumpkin bucket
Events created: companion Feral Kobold
Base round:     0 (7.35) damage, 0 player     damage, 10 meat
ATT: 350 (94% × (78.07),     death in 37)
DEF: 350 (95.45% × 115.74, win in 3)
HP: 299,     Value: 1,033.44 μ,     RES: 0 (-1) (1)     (-1)
Parsed     round number: 1
Building options...
Events     created: attack, (blank)
Expression syntax errors for     'modifier_eval()':
Can't understand custom, endscombat (zlib.ash, line     186)
You're on your own, partner.

According to zarqon's post in the zlib thread it seems that WHAM and/or Batbrain is handing zlib incorrect information. Any thoughts?
 

Ioeth

Member
Looks like a recent change in Mafia is now causing this error:

Code:
Function 'tower_items( boolean )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (WHAM.ash, line 464)
 

AssHandy

Member
The recent change in zlib, that removed the tower_items function, breaks WHAM. Delete lines 464 - 467 in WHAM.ash to un-break it.

For those of use without an editor with line numbers, (i.e. notepad), which lines are those? Is it:

Code:
				foreach i in tower_items(true) {
					if (item_amount(i) == 0)
						return false;
				}
 

Magus_Prime

Well-known member
This only happens in aftercore and after closeting every combat item it does not happen. That leads me to believe the problem is a combat item. I'll see if I can narrow it down.

Edit: Found it! It's item # 7542 "space invader". If I closet it or tell WHAM not to use that item the problem goes away.

Does anyone have any ideas on why?

Edit #2: zarqon fixed the problem. It was an error in the batfactors entry for the item.

Here's a verbosity 10 dump of the problem with zlib and the endscombat value:

Code:
[1065] The Sleazy Back Alley
Encounter: big creepy spider
Round 0:     Arbos wins initiative!
BatMan RE disabled for this     character, skipping enhancements.
1 HP     costs 0.12μ. ( 635 / 650 )
1 MP costs     2.727μ. ( 873 / 1091 )
WHAM: We     currently think that the round number is: 0 and that the turn number is     1064.
WHAM: Checking to see if WHAM sould     adjust the unknown_ml for big creepy spider.
WHAM:     No need to do anything with big creepy spider.
WHAM:     Setting up variables via BatBrain
Setting     monster to big creepy spider...
spider web     (25.0 @ +173): 3μ * 68.25% = 2.05
spider     web (25.0 @ +173): 3μ * 68.25% = 2.05
Value of stat gain:     118.03μ
Loading batfactors...
Processing     batfactors...
Factoring in Jalapeño Saucesphere: 3 damage, retal
Factoring     in Scarysauce: (6) damage,     retal
You have plastic pumpkin bucket equipped: (6.04)     damage,
You have navel ring of navel gazing equipped: 0 damage, stun 0.5
Events     created: Jalapeño Saucesphere, Scarysauce, plastic pumpkin bucket, navel     ring of navel gazing
Events created: companion Li'l Xenomorph
Base     round: 0 (6.04) damage, 0     player damage, 0.5 stun, 53.24 meat
ATT: 11 (3% × 0.29, death in     635)
DEF: 9 (95.45% × 145.18 (11),     win in 1)
HP: 11, Value: 139.68 μ,     RES: 0
Parsed round number: 1
Building     options...
Events created: attack, (blank), jiggle
Evaluating     'max(5,floor(0.1*650.0))+25'...
Evaluating     'max(5,floor(0.1*650.0))'...
Evaluating     'floor(50+10*47.0^0.7)'...
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     'loc(vibrato)'...
Evaluating     'zone(sea)*422'...
Evaluating     '494-zone(sea)*389'...
Evaluating     '1.5+zone(sea)*2'...
Evaluating     '-(300+zone(sea)*(650.0-635.0))'...
Evaluating     'min(max(11.0-635.0,0),1)*25'...
Evaluating     'min(max(635.0-11.0,0),1)*25'...
Evaluating     '15+10*min(1,effect(sugar rush))'...
Evaluating     '35*(1-loc(kegger))'...
Evaluating     'ceil(L/3.0)*4.5*5'...
Evaluating     '-min(0.25*650.0,0.5*(650.0-635.0))'...
Evaluating     '-max(min(10+11.0-145.0,100),10)'...
Evaluating     '-max(min(10+11.0-145.0,100),10)'...
Evaluating     'custom, endscombat'...
Expression syntax     errors for 'modifier_eval()':
Can't understand custom, endscombat     (zlib.ash, line 186)
You're on your own,     partner.
 
Last edited:

kdog

New member
For those of use without an editor with line numbers, (i.e. notepad), which lines are those? Is it:

Code:
				foreach i in tower_items(true) {
					if (item_amount(i) == 0)
						return false;
				}

I tried removing this, and now I get another error.

Code:
Unknown variable 'case' (WHAM beta.ash, line 471)
Consult script 'WHAM beta.ash' not found.
You're on your own, partner.
Click here to continue in the relay browser.

Something tells me I done fucked up.
 

Magus_Prime

Well-known member
I'm guessing you removed too much or too little. Here is what the immediate are around the edit should look like:
Code:
		switch(aid.group(1)+aid.group(2)) {
			case "use 2848":	//Gnomitronic thingamabob
				return (item_amount($item[gnomitronic hyperspatial demodulizer]) > 0 && !happened($item[gnomitronic hyperspatial demodulizer]));
			case "use 3391":	//Frosty's Iceball, should not be used but is anyway so disallow it
				return false;
			case "skill 66": //Flying Fire Fist
				if (have_effect($effect[Salamanderenity]) == 0)
					return true;
//				foreach i in tower_items(true) {
//					if (item_amount(i) == 0)
//						return false;
//				}
				return true;
 

Theraze

Active member
To make it slightly less useless, I'd also suggest removing (or commenting out) the two lines above. Since what you have basically is this logic:
If you don't have salamanderity, return true.
If there is a tower item that you don't have yet, return false.
In all other cases, return true.

The modified logic is this:
If you don't have salamanderity, return true.
In all other cases, also return true.

There's no case when it wouldn't return true. So you might as well cut out the salamanderity check and make things a bit cleaner.
 
Top