Bug oilPeakProgess preference gettign out of bounds

Winterbay

Active member
I've seen this a few times but have no real idea on what is causing it. I do most of my adventuring via BumCheekAscend but I doubt that has actually created this problem.

The oilPeakProgress gets set to absurd values. Today after finishing the quest it is at 29144790158454686000000000000000000,00 which leads to a) display issues with CHiT and b) looks really ugly :)

Not that much of a problem, but I really think it should end up at 0 when the quest is over since that value goes from 310.66 to 0 when you do the quest. Possibly this could be caused by a subtraction overflow when "overdoing" the lowering or something (pure speculation, I have no idea how Java handles subtractions).

Edit: Visiting the quest log made Mafia correctly set the value to 0.
 

lostcalpolydude

Developer
Staff member
Every time it's set at the end of a combat (in QuestManager) looks like
Code:
String setTo = String.format( "%.2f", Math.max( 0, current - 6.34 - pantsBonus ) );

Setting it when reading from the quest log just works with strings, and that part worked for you anyway.

How much +ML do you use when killing them, and do you wear dress pants? I have never seen display issues in CHIT, so it seems I'm not encountering the condition that leads to this issue.
 

Winterbay

Active member
I do not even know what dress pants are so I doubt I had those one. I ran with either 30 or 40 +ML (BBB + MCD, but I'm not sure if the MCD was turned on or not).
 

Winterbay

Active member
Ahh right. I tend to thinkof the BBB as +30, but it's +20 so yes +30 in total then because that is what I saw when I looked in on the script. I noticed the odd value when BCA couldn't get enough stench resistance for the Twin Peak and I had to go to the relay browser to finish that part off.
 

ereinion

Member
If it is any help in the debugging work, I just got this error again, running +70 ml (10 from mcd + 60 from the hand in glove) at the oil peak - no dress pants this time round either. get oilPeakProgress returns 278639802415551870000,00.
 

Winterbay

Active member
I just ran 2 turns in AoSP at +35ML (MCD: 10, Insult comic hellhound: +5, florist: +30, lapdog: + 20, sissy bar (motor cycle): -30) with the following result:
Code:
[426] Oil Peak
Encounter: oil tycoon
Round 0: winterbay wins      initiative!
[COLOR=#880000]1 HP costs 2,883μ. ( 44, / 100 )[/COLOR]
[COLOR=#000088]1      MP costs 8,μ. ( 165, / 207 )[/COLOR]
Checking for updates (running [URL="http://kolmafia.us/showthread.php?t=6445"]BatBrain[/URL]      rev. 0)...
Checking for updates (running [URL="http://kolmafia.us/showthread.php?t=1715"]SmartStasis[/URL]      rev. 0)...
[COLOR=black]Updating batfactors.txt from      '2014-02-14T08:51:42-06:00' to '2014-02-20T16:07:27-06:00'...[/COLOR]
[COLOR=black]...batfactors.txt      updated.[/COLOR]
ATT: [B]121,[/B] (100,% × [COLOR=purple][B](17,62)[/B][/COLOR],      death in 6)
DEF: [B]111,[/B] (95,45% × 58,9[B] [COLOR=green](25,)[/COLOR][/B],      win in 2)
HP: [B]94,[/B], Value: [COLOR=green][B]626,7 μ[/B][/COLOR],      RES: 0[B] [COLOR=blue](-0,5)[/COLOR] [COLOR=red](0,25)[/COLOR]      [COLOR=purple](1,)[/COLOR] [COLOR=gray](-1,)[/COLOR]      [COLOR=green](0,25)[/COLOR][/B]
[COLOR=purple]WHAM:      You have no profitable MP restoratives.[/COLOR]
[COLOR=purple]WHAM:      Your best HP restoring option available is: use 474[/COLOR]
[COLOR=purple]WHAM:      Monster HP is 94.0.[/COLOR]
[COLOR=purple]WHAM: Running      SmartStasis[/COLOR]
Profit per round:       [TABLE="width: 100%"]
       [TR]
         [TH]           Action         [/TH]
         [TH]           Profit         [/TH]
         [TH]           Damage         [/TH]
         [TH]           Other         [/TH]
       [/TR]
       [TR]
         [TD="align: left"]           base (0μ)         [/TD]
         [TD="align: right"]           [B]0μ[/B]         [/TD]
         [TD="align: center"]           --         [/TD]
         [TD="align: center"]                    
[/TD]
       [/TR]
     [/TABLE]
     
     [COLOR=purple]WHAM: SmartStasis complete.[/COLOR]
[COLOR=purple]WHAM:      SS did not finish the fight, continuing with script execution. [/COLOR]
[COLOR=purple]WHAM:      Starting evaluation and performing of attack[/COLOR]
[COLOR=purple]WHAM:      Enqueueing attack with your weapon (macroid attack).[/COLOR]
[COLOR=purple]WHAM:      Enqueueing attack with your weapon (macroid attack).[/COLOR]
[COLOR=purple]WHAM:      We are going to 2-shot with attack with your weapon and attack with your      weapon.[/COLOR]
Round 1: winterbay executes a macro!
Round 1:      winterbay attacks!
Round 2: oil tycoon takes 103 damage.
Round 2:      oil tycoon takes 16 damage.
Round 2: winterbay wins the fight!
You      gain 4 hit points
You gain 4 Mojo Points
You acquire an item:      bubblin' crude
You acquire an item: bubblin' crude
You gain 7      Strongness
You gain 6 Magicalness
You gain 26 Roguishness
[COLOR=green]Look!      You found 2 bubblin' crude (120,μ)![/COLOR]

[COLOR=olive]>      prefref oil[/COLOR]

oilPeakProgress (user, now '2977878,98', default      310.66 )

[COLOR=olive]MCD:      Sensitive location, not adjusting.[/COLOR]
Casting Live Fast 3 times...
You      acquire an effect: Living Fast (duration: 30 Adventures)
Live Fast was      successfully cast.

[427] Oil Peak
Encounter: oil tycoon
Round      0: winterbay wins initiative!
[COLOR=#880000]1 HP costs 2,883μ.      ( 50, / 100 )[/COLOR]
[COLOR=#000088]1 MP costs 8,μ. ( 168, / 207      )[/COLOR]
ATT: [B]118,[/B] (100,% × [COLOR=purple][B](17,18)[/B][/COLOR],      death in 7)
DEF: [B]112,[/B] (95,45% × 52,9[B] [COLOR=green](25,)[/COLOR][/B],      win in 2)
HP: [B]95,[/B], Value: [COLOR=green][B]626,7 μ[/B][/COLOR],      RES: 0[B] [COLOR=blue](-0,5)[/COLOR] [COLOR=red](0,25)[/COLOR]      [COLOR=purple](1,)[/COLOR] [COLOR=gray](-1,)[/COLOR]      [COLOR=green](0,25)[/COLOR][/B]
[COLOR=purple]WHAM:      You have no profitable MP restoratives.[/COLOR]
[COLOR=purple]WHAM:      You have no profitable HP restoratives.[/COLOR]
[COLOR=purple]WHAM:      Monster HP is 95.0.[/COLOR]
[COLOR=purple]WHAM: Running      SmartStasis[/COLOR]
Profit per round:       [TABLE="width: 100%"]
       [TR]
         [TH]           Action         [/TH]
         [TH]           Profit         [/TH]
         [TH]           Damage         [/TH]
         [TH]           Other         [/TH]
       [/TR]
       [TR]
         [TD="align: left"]           base (0μ)         [/TD]
         [TD="align: right"]           [B]0μ[/B]         [/TD]
         [TD="align: center"]           --         [/TD]
         [TD="align: center"]                    
[/TD]
       [/TR]
     [/TABLE]
     
     [COLOR=purple]WHAM: SmartStasis complete.[/COLOR]
[COLOR=purple]WHAM:      SS did not finish the fight, continuing with script execution. [/COLOR]
[COLOR=purple]WHAM:      Starting evaluation and performing of attack[/COLOR]
[COLOR=purple]WHAM:      Enqueueing attack with your weapon (macroid attack).[/COLOR]
[COLOR=purple]WHAM:      Enqueueing attack with your weapon (macroid attack).[/COLOR]
[COLOR=purple]WHAM:      We are going to 2-shot with attack with your weapon and attack with your      weapon.[/COLOR]
Round 1: winterbay executes a macro!
Round 1:      winterbay attacks!
Round 2: oil tycoon takes 100 damage.
Round 2:      oil tycoon takes 15 damage.
Round 2: winterbay wins the fight!
You      acquire an item: bag of GORP
You gain 5 hit points
You gain 4 Mojo      Points
You acquire an item: bubblin' crude
You gain 6 Beefiness
You      gain 5 Magicalness
You gain 27 Chutzpah
You gain a Moxie point!
[COLOR=green]Look!      You found 1 bag of GORP (23,μ)![/COLOR]
[COLOR=green]Look!      You found 1 bubblin' crude (60,μ)![/COLOR]

[COLOR=olive]>      prefref oil[/COLOR]

oilPeakProgress (user, now '297787884,98',      default 310.66 )

As you can see the preference increased rather than went down as I would've expected.

Current equipment and effects if relevant:
Code:
[COLOR=olive]> equip[/COLOR]

Hat: fuzzy montera
Weapon:      Sneaky Pete's basket
Off-hand: Victor, the Insult Comic Hellhound Puppet
Shirt:      harem girl t-shirt
Pants: astral shorts

Acc. 1: Codpiece of the      Goblin King
Acc. 2: Jolly Roger charrrm bracelet (2)
Acc. 3: badass      belt

Pet: (none)
Item: (none)

[COLOR=olive]> effects[/COLOR]

0 of 3 AT buffs active.
Butt-Rock      Hair (14)
Hustlin' (25)
All Revved Up (27)
Lapdog (47)
Living      Fast (67)
Slicked-Back Do (∞)
 

Darzil

Developer
Been doing it in the relay browser today at +60 ML, and checked at the start and after every fight (and the non-combat) and got the following :

oilPeakProgress(user, now '310.66 ', default 310.66 )
oilPeakProgress(user, now '278.96', default 310.66 )
oilPeakProgress(user, now '247.26', default 310.66 )
oilPeakProgress(user, now '215.56', default 310.66 )
oilPeakProgress(user, now '183.86', default 310.66 )
oilPeakProgress(user, now '152.16', default 310.66 )
oilPeakProgress(user, now '120.46', default 310.66 )
oilPeakProgress(user, now '88.76', default 310.66 )
oilPeakProgress(user, now '57.06', default 310.66 )
oilPeakProgress(user, now '25.36', default 310.66 )
oilPeakProgress(user, now '0.00', default 310.66 )
oilPeakProgress(user, now '0.00', default 310.66 )

Only clear oddity was the space after the default value, so removed that from defaults.txt.
 

Darzil

Developer
Looking at the code I wonder why we declare one variable as a float and another as a double, as we end up with some implied changes of precision which might possibly be flaky.
 

Winterbay

Active member
I think I've found the problem. When having CHiT on it goes crazy and when CHiT is disabled it goes down as expected. Looking in CHiT there is one line that references the preference:
Code:
high.append(item_report(get_property("oilPeakProgress").to_int() == 0, get_property("oilPeakProgress")+' μB/Hg'));

If I change that to_int() to a to_float() it works just as expected and with the to_int it goes to heck quickly... I'll take this over to CHiT I think.

Edit: Nope, it only worked once. Now it's going crazy even with CHiT turned off.
 
Last edited:

Bale

Minion
If I change that to_int() to a to_float() it works just as expected and with the to_int it goes to heck quickly... I'll take this over to CHiT I think.

Edit: Nope, it only worked once. Now it's going crazy even with CHiT turned off.

There is no way that get_property() can ever change a preference. If it could, that would be a pretty unlikely Mafia error.
 

Winterbay

Active member
Not that this adds anything, but this time ti got a bit out of hand even for Mafia so...
Code:
[COLOR=olive]> prefref oilpeak[/COLOR]

oilPeakProgress      (user, now 'Infinity', default 310.66)
:)
 
Top