Issue with my_adventures since computer crashed while running script.

Des80

Member
I run a script that I made that basically goes through my adventures on barf mountain.

adventure(my_adventures(), $location[Barf Mountain] );

Ever since my computer crashed while it was running stuff has been screwed up. I now have to manually set properties I made to false afterwards when I used to not have to and my_adventures() seems to only register as 33. Anyone know how I can fix this issue?
 

Bale

Minion
If KoLmafia (or your computer) crashes, any properties you changed during that session not be saved, causing them to have the same values as they started. That can easily screw up your progress during a session. Of course that should be fine once they are set correctly. Since I don't know what these properties are or why they'd be set to false, I'm just guessing that they'd be fine the next day.

However I cannot think of a single reason that mafia would lose the ability to detect adventures remaining from KoL's api.
 

Theraze

Active member
Regarding properties, on a BAD computer crash, you can potentially have some spurious unicode characters which get added to the front of your properties file which are then expanded and corrupt your entire character preferences, causing everything to go back to defaults. If you use Dropbox or have some other form of file versioning, go to the second-to-last file before the size of your preference file balloons from ~60k to ~500k. I have to do that about once or twice a month, but since it's an issue with my computer not saving the file right rather than mafia actually doing something wrong, it's not a mafia bug... it's an OS issue.

Regarding adventures, as Bale said, mafia should be able to read that properly. If it's still wrong though, make sure you aren't in an adventure or anything - I tend to type "text main.php" into the gCLI to test that - and then run "refresh all" in the gCLI to fix all of its properties. It shouldn't be needed, but if you're kicking off the script RIGHT in conjunction with initial login, you can corrupt the initial calls... mafia doesn't lock your ability to run scripts until the SECOND character logs in. The first character in a given mafia session can launch a script while mafia is still initializing and loading. There's probably a reason for the inconsistent behaviour, but practically it just means to pay attention to what's happening in the gCLI before you kick off your farming script.
 

Des80

Member
Theraze the script worked perfectly fine for quite a long time until the computer crash. I deleted my Prefs file and let it remake one for me so I think I got that one fixed. But for some odd reason it does 33 adventures when I have over 400 before going to the next part of my script of putting my rollover outfit on and it only did that after the crash thats what Im trying to figure out why because no coding was changed. It Stops at 33 adventures each time. Ok I have figured out what it was I think and it was a stupid thing where it changed the value of what happens when an item I use breaks. Didn't even think about it until I looked over the logs closer. Thanks all for the help.
 
Last edited:

Theraze

Active member
It happens. When you lose your preference file, all sorts of scattered things may happen related to it that may cause aborting or things that you don't expect... you lose your recovery script, your counter script, your breakable item handling, your login/logout behaviour, etc. If your computer crashes often, I suggest either using Dropbox for the versioning even if you aren't going to use multiple computers, or just keeping a backup file for your preferences after you have them the way you want them.

Good that you figured out your problem though. :)
 

Des80

Member
Theraze First time It has crashed and I always keep a backup but thanks for the information non the less. I think it was the fact I opened way to many programs at once it decided to strike. Thanks again everyone.
 
Top