loathers / garbage-collector

Script for farming meat (and garbage) in 2003 web RPG Kingdom of Loathing
25 stars 57 forks source link

[BUG] Marginal MPA issue (very very negative items value) #1825

Open Aliisza opened 8 months ago

Aliisza commented 8 months ago

Describe the bug Is anyone else getting very wrong marginal MPA printouts? Mine are looking like this everytime:

This run of garbo, across 612 turns you generated 6,175,275 meat, with 4,899,854 raw meat and 1,275,421 from items So far today, across 613 turns you generated 5,672,942 meat, with 4,243,954 raw meat and 1,428,988 from items Outliers: Marginal MPA: 4,796.06 [raw] + -7,906,481.95 [items] (0 [outliers]) = -7,901,685.89 [total] (-7,901,685.89 [w/ outliers])

To Reproduce Steps to reproduce the behavior: I'm not actually certain what is causing the issue. Just that ever since it started tracking marginal MPA again. My items value has always been some massive multi-millions negative meat value in the ITEMS catagory.

Expected behavior A clear and concise description of what you expected to happen.

Session Log Attach a full KoLMafia session log from the day you encountered the bug. Include details about when in the log the bug occurred to help developers rapidly find the error. Copy and paste any associated red text printed to the gCLI during this error. aliisza_20240314.txt

Additional context Add any other context about the problem here. Does this always happen post-loop, but never pre-loop? Did this start happening when you got some particular IotM?

horrible-little-slime commented 8 months ago

Per testing by @Tokoeka this is related to clan stash handling

Aliisza commented 8 months ago

Per testing by @Tokoeka this is related to clan stash handling

Is it something more logs would help to fix? Or something someone's already working on?

Tokoeka commented 7 months ago

Still occuring with this fix- from browsing the code, my guess would be that no 0 turns remaining calc for marginal MPA occurs until the trackMarginalMpa(0); added in endSession(), which does not resolve the issue as endSession is called outside the withStash invocation in index.ts. I think this could be resolved by moving either the trackMarginalMpa(0); call or endSession() itself to being the final item of the withStash invocation (line 529 of index.ts), but not sure which would be preferable

Tokoeka commented 7 months ago

Tested adding trackMarginalMpa(0) as the final item of withStash, and it appears to have worked. will add a PR