autoscend.ash demands ancient magi-wipes, can't find file, divides by zero

What I have not done yet:
Make a brand new, empty folder, and drop the latest KoLmafia JAR in there. Put autoscend in it.
Why? Because I want to fix this! I'm tired of using the nuclear option to fix things. I know I might have to. And if it works, then that is the workaround. How many times did this happen:
Me: Does it work now?
Tech support customer: Yes.
Me: Well, good, there you are.
Customer: But why?
Me: I don't know. But we have achieved the goal of having it work again.

I think the recommendation for autoscend help is to use their Discord channel, but... I can't. It (Discord!) is so confusing and, well, user-hostile, I swear. Me-hostile, anyway. So if anyone will take a look who understands ASH code, maybe you'll have a recommendation (other than Discord). Please?
I had been using autoscend pretty smoothly for some weeks. Sometimes it would do weird things I didn't understand. I learned to sometimes delete GIT, SVN, DATA, and SCRIPTS folders, and set up autoscend new again. It has fixed some things. Sometimes it aborts, and I see text in the GCLI that helps me fix what's wrong, instead of going such a destructive route. Sometimes just starting it again works. Today or yesterday it started complaining about restores and demanding ancient Magi-wipes, looping until I aborted it through the Relay script. I tried changing my KoLmafia settings to make sure I had several choices for both HP and MP restores, and that those options were actually available. Same problem. Finally I just bought a bunch of ancient magi-wipes (20?), it used almost all of them, then ran for a little while.

Now it has stopped looking for those. It aborted as shown below. I closed KoLmafia (logout, then close window). I wiped out GIT, SVN, DATA, and SCRIPTS folders, plus a few autoscend files I found in CCS and RELAY. Then I did a new checkout:
git checkout https://github.com/Loathing-Associates-Scripting-Society/autoscend.git

It seems the behavior is the same. Here is what it says when I invoke autoscend in the GCLI, which looks the same as before I "reinstalled" autoscend:
Code:
> autoscend

printStackOnAbort => true
Thank you for using autoscend!
If you need to configure or interrupt the script, choose autoscend from the drop-down "run script" menu in your browser.
If you want to contribute, please open an issue on Github
A FAQ with common issues (and tips for a great bug report) can be found here
The developers also hang around on the Ascension Speed Society discord server

autoscend (formerly sl_ascend) is under new management. Soolar (the maintainer of sl_ascend) and Jeparo (the most active contributor) have decided to cease development of sl_ascend in response to Jick's behavior that has recently come to light. New developers have taken over maintenance and rebranded sl_ascend to autoscend as per Soolar's request. Please be patient with us during this transition period. Please see the readme on the github page for more information.
Loading character status...
Refreshing session data...
Synchronizing moon data...
Retrieving character data...
Updating inventory...
Examining Meat in closet...
Updating closet...
Retrieving quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving campground data...
You are currently a member of Snugglemonsters
Seeing what's still unrestricted today...
Done checking allowed items.
Session data refreshed.
[INFO] Hello StorellaDeville, time to explode!
[INFO] This is version: 0 Mafia: 26840
[INFO] This is day 10.
[INFO] Turns played: 1855 current adventures: 159
[INFO] Current Ascension: none
promptAboutCrafting => 0
breakableHandling => 4
autoSatisfyWithCoinmasters => true
dontStopForCounters => true
maximizerCombinationLimit => 100000
afterAdventureScript => scripts/autoscend/auto_post_adv.ash
choiceAdventureScript => scripts/autoscend/auto_choice_adv.ash
betweenBattleScript => scripts/autoscend/auto_pre_adv.ash
spadingScript => excavator.ash
hpAutoRecovery => -0.05
hpAutoRecoveryTarget => -0.05
logPreferenceChange => true
Preference auto_backup_logPreferenceChangeFilter changed from to __BLANK__
logPreferenceChangeFilter => maximizerMRUList,testudinalTeachings,auto_maximize_current
Preference logPreferenceChangeFilter changed from to maximizerMRUList,testudinalTeachings,auto_maximize_current
Preference auto_backup_maximizerMRUSize changed from to 5
maximizerMRUSize => 0
Preference maximizerMRUSize changed from 5 to 0
Preference auto_backup_forbiddenStores changed from to __BLANK__
forbiddenStores => ,3408540
Preference forbiddenStores changed from to ,3408540
[INFO] Turn(1855): Starting with 159 left and -1 pulls left at Level: 15
[INFO] Encounter: 0.0 Exp Bonus: 0.0
[INFO] Meat Drop: 215.0 Item Drop: 270.9374510954317
[INFO] HP: 426/471, MP: 168/592, Meat: 5600629
[INFO] Tummy: 0/15 Liver: 15/19 Spleen: 0/15
[INFO] ML: 0 control: 0
[INFO] Soulsauce: 1
[INFO] Delay between adventures... beep boop...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Preference auto_newbieOverride changed from true to false
[INFO] Getting dimes.
Putting on outfit: War Hippy Fatigues
Equipment changed.
[INFO] Getting quarters.
Putting on outfit: Frat Warrior Fatigues
Equipment changed.
[INFO] Target hp => 471 - Considering restore options at 426/471 HP with 168/592 MP
[INFO] Active Negative Effects => []
[INFO] Loading restoration data.
(file not found)
logPreferenceChange => false
Preference logPreferenceChange changed from true to false
logPreferenceChangeFilter =>
printStackOnAbort => false
afterAdventureScript =>
autoSatisfyWithCoinmasters => false
betweenBattleScript =>
breakableHandling => 1
choiceAdventureScript =>
dontStopForCounters => false
forbiddenStores =>
hpAutoRecovery => 0.3
hpAutoRecoveryTarget => 0.9
maximizerCombinationLimit => 0
maximizerMRUSize => 5
promptAboutCrafting => 1
spadingScript =>
Division by zero (auto_restore.ash, line 647)
  at __calculate_objective_values (auto_restore.ash:971)
  at calculate_objective_values (auto_restore.ash:1359)
  at __maximize_restore_options (auto_restore.ash:1370)
  at __restore (auto_restore.ash:1590)
  at acquireHP (auto_restore.ash:1950)
  at acquireHP (auto_restore.ash:1867)
  at acquireHP (auto_restore.ash:1857)
  at acquireHP (auto_restore.ash:1847)
  at L12_finalizeWar (level_12.ash:2319)

Division by zero is significant to me. I understand it can be hard for programs / code to recover from that. But I'm also worried about the (file not found) that comes right after [INFO] Loading restoration data.. What file??? Dang it! If it told me what file it sought, maybe that would help me! I do find ..\data\autoscend_restoration.txt, and it will open in WordPad. This is the file that ..\scripts\autoscend\auto_restore.ash says it loads restore methods from.

Anyone? Got anything other than making a brand new KoLmafia folder?
 

heeheehee

Developer
Staff member
(file not found)
This is apparently Mafia commenting that you don't have a mallprices.txt file in your data/ folder, not something from the script.

Division by zero (auto_restore.ash, line 647)
Line 647 is performing currency_available / price_per.

If your prices are somehow returning zero for some reason...

Do you happen to have "Share recent Mall price data with users" checked in preferences (equivalent preference is sharePriceData)? If not, do you have objections to doing so? This preference does two things: it fetches a community-sourced map of historical mall prices, and it contributes any such mall price data cached during your session to said community source. This is the typical way to populate mallprices.txt and keep it up-to-date.
 
Good grief! Thank you! So that's the file it wanted. I recognized that preference, had to look through every preference and start over because I overlooked it the first time. I thought, "Surely that is marked, though?" No. What have I done? Well, it's marked now. I had already verified there is no mallprices.txt.

Thank you again.
(And, um, does this mean KoLmafia is likely to crash if that preference checkbox is unmarked?)

Hold on! Rollover's done, and I logged in -- after fixing that preference.

Code:
Sending login request...
Initializing session for StorellaDeville...
Loading character status...
Refreshing session data...
Synchronizing moon data...
Retrieving character data...
Updating inventory...
Examining Meat in closet...
Updating closet...
Retrieving quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving campground data...
You are currently a member of Snugglemonsters
Visiting Underground Fireworks Shop in clan VIP lounge
Visiting Crimbo Tree in clan VIP lounge
Visiting Hot Dog Stand in clan VIP lounge
Visiting Speakeasy in clan VIP lounge
Visiting Floundry in clan VIP lounge
Seeing what's still unrestricted today...
Done checking allowed items.
Session data refreshed.
4 days until Festival of Jarlsberg, Mysticism bonus today (not tomorrow).
Executing request...
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
Executing request...
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
Executing request...
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
You acquire an item: stuffed MagiMechTech MicroMechaMech
Executing request...
Visiting Potted Meat Bush in clan rumpus room
You gain 540 Meat
Executing request...
Visiting Potted Meat Tree in clan rumpus room
You gain 1,009 Meat
Visiting Deluxe Mr. Klaw "Skill" Crane Game in clan VIP lounge
You acquire an item: stuffed monocle
Visiting Deluxe Mr. Klaw "Skill" Crane Game in clan VIP lounge
Visiting Deluxe Mr. Klaw "Skill" Crane Game in clan VIP lounge
You acquire an item: stuffed tin of caviar
Visiting Looking Glass in clan VIP lounge
You acquire an item: "DRINK ME" potion
Let's cannonball in the swimming pool.
You start screwing around in the swimming pool.
In the pool, flipping over.

Doing handstand in clan VIP swimming pool
In the pool, diving for treasure.

Diving for treasure in clan VIP swimming pool
You found a soggy used band-aid in the VIP pool!
Getting out of the pool.

Getting out of clan VIP swimming pool
Using 1 Manual of Transmission...
Finished using 1 Manual of Transmission.
Visiting Hermit...
Visiting the Hermit...
You acquire 11-leaf clover (3)
Hermit successfully looted!
Collecting cut of hippy profits...
You gain 4,906 Meat
Using 1 handmade hobby horse...
You gain 20 Strengthliness
Finished using 1 handmade hobby horse.
Using 1 ball-in-a-cup...
You gain 27 Enchantedness
Finished using 1 ball-in-a-cup.
Using 1 Chester's bag of candy...
You acquire an item: marzipan skull
You acquire Angry Farmer candy (2)
You acquire an item: Tasty Fun Good rice candy
You acquire an item: Yummy Tummy bean
Finished using 1 Chester's bag of candy.
Using 1 burrowgrub hive...
Finished using 1 burrowgrub hive.
Using 1 glass gnoll eye...
You acquire an item: breath mint
Finished using 1 glass gnoll eye.
Using 1 Trivial Avocations board game...
You acquire an item: Trivial Avocations Card: What?
You acquire an item: Trivial Avocations Card: What?
You acquire an item: Trivial Avocations Card: When?
Finished using 1 Trivial Avocations board game.
Using 1 creepy voodoo doll...
Finished using 1 creepy voodoo doll.
Using 1 Chroner cross...
You acquire Chroner (2)
Finished using 1 Chroner cross.
Using 1 cheap toaster...
You acquire toast (3)
Finished using 1 cheap toaster.
Casting Advanced Cocktailcrafting 1 times...
You acquire an item: little paper umbrella
You acquire an item: coconut shell
You acquire an item: magical ice cubes
You acquire an item: little paper umbrella
You acquire an item: little paper umbrella
Advanced Cocktailcrafting was successfully cast.
Casting Advanced Saucecrafting 1 times...
You acquire scrumptious reagent (8)
Advanced Saucecrafting was successfully cast.
Casting Pastamastery 1 times...
You acquire dry noodles (5)
Pastamastery was successfully cast.
Casting Lunch Break 1 times...
You acquire an item: sack lunch
Lunch Break was successfully cast.
Casting Grab a Cold One 1 times...
You acquire an item: Cold One
Grab a Cold One was successfully cast.
Casting Summon Snowcones 3 times...
You acquire an item: blue snowcone
You acquire an item: orange snowcone
You acquire an item: red snowcone
Summon Snowcones was successfully cast.
Casting Summon Stickers 3 times...
You acquire an item: scratch 'n' sniff unicorn sticker
You acquire an item: scratch 'n' sniff UPC sticker
You acquire an item: scratch 'n' sniff dragon sticker
You acquire an item: scratch 'n' sniff apple sticker
You acquire an item: scratch 'n' sniff UPC sticker
You acquire an item: scratch 'n' sniff rock band sticker
You acquire an item: scratch 'n' sniff apple sticker
You acquire an item: scratch 'n' sniff UPC sticker
You acquire an item: scratch 'n' sniff rock band sticker
Summon Stickers was successfully cast.
Casting Summon Sugar Sheets 3 times...
You acquire sugar sheet (3)
Summon Sugar Sheets was successfully cast.
Casting Summon Rad Libs 3 times...
You acquire Rad Lib (6)
Summon Rad Libs was successfully cast.
Casting Summon Hilarious Objects 1 times...
You acquire an item: joybuzzer
You acquire an item: magical ice cube with a fly in it
You acquire an item: fake hand
Summon Hilarious Objects was successfully cast.
(file not found)
7610 prices updated from https://kolmafia.us/scripts/updateprices.php?action=getmap

And there it is! (file not found) followed by price updates, and now I have a brand new mallprices.txt! I'm checking my other mafia folders... it seems like none of them had that preference marked. Is that the default? Oh, I guess I can answer that. Putting a fresh copy of KoLmafia-26840.jar in an empty folder and launching it. Preferences | General does not have the "Share recent Mall price data with users" checkbox marked. I definitely don't object to participating. So I guess the reason it wasn't set is that I didn't know it ought to be? I'll try to make sure I always have that marked.

One more time: Thank you.
 

heeheehee

Developer
Staff member
(And, um, does this mean KoLmafia is likely to crash if that preference checkbox is unmarked?)
It shouldn't. Historical mall price information should just be an optimization, and if we don't have data for a particular item, we should just do a mall search when we want it.

This is just a quirk of this script, coupled with a missing check for the returned value being 0 at that particular point.

//0 could be due to item not being tradeable.
//-1 could be due to tradeable item not found in the mall. Or due to an IO error during lookup
//-1 is non trivial to fix due to mafia anti abuse code
//historical price can never be -1. only 0 or a positive number
//just use the historical price. It will be good enough. it never returns -1. and if it returns 0 it is because this mafia install never happened to look up that item before. which suggests an extreme edge case or that the item is really unavailable
 
Top