Automatically download the newest daily build

It's a minor thing, but it looks like if it runs when KoLMafia happens to be already running (I was away from the computer and forgot about the scheduled task), then it crashes with a fatal exception. It's not a huge deal since I can just run it manually again after closing out Mafia, but I thought I'd bring it to your attention anyway. (I mean, obviously you wouldn't be able to delete the JAR while it's running still, but I just mean have it close nicely rather than passing the exception.)
 
Last edited:
It's a minor thing, but it looks like if it runs when KoLMafia happens to be already running (I was away from the computer and forgot about the scheduled task), then it crashes with a fatal exception. It's not a huge deal since I can just run it manually again after closing out Mafia, but I thought I'd bring it to your attention anyway. (I mean, obviously you wouldn't be able to delete the JAR while it's running still, but I just mean have it close nicely rather than passing the exception.)
Yeah I know about this, I just haven't had any time to add the catch for the exception.
 
Hmm. I'm executing this, it says "Checking builds.kolmafia for the latest version", then "Kolmafia-7798 is the latest version, then just stops executing. I'd like it to automatically open up the latest version of Mafia every single time after it executes.

Also, it seems to download very slowly. Is there something I need to do?

Edit: Oh, no. It just downloaded v7799 properly and opened it. Perhaps it was just being weird because there'd been an update recently. Well, it's working now.
 
Last edited:
Hmm. I'm executing this, it says "Checking builds.kolmafia for the latest version", then "Kolmafia-7798 is the latest version, then just stops executing. I'd like it to automatically open up the latest version of Mafia every single time after it executes.

Also, it seems to download very slowly. Is there something I need to do?

Edit: Oh, no. It just downloaded v7799 properly and opened it. Perhaps it was just being weird because there'd been an update recently. Well, it's working now.

http://kolmafia.us/showpost.php?p=19496&postcount=19
 
Holy smokes that is awesome. :) Many thanks for saving me having to check the page, download, then move it to my mafia dir from where firefox stashes the file.
 
Attempted to run this and got an application error

"The application failed to initialize properly (0xc0000135). Click on OK to terminate the application."
 
my version of this is to grab the latest hourly build, unix based and runs from where ever you hold your kolmafia file



Code:
if [[ -a index.html ]] ;then
        rm index.html
fi
rm KoLmafia-*

wget http://builds.kolmafia.us/
latest=$(grep KoLmafia- index.html | cut -c11-53 )
wget ${latest}
filenm=$(ls | grep KoL)
chmod 700 $filenm
 
Last edited:
just downloaded and tested (compiled myself) works fine for me, are you still getting the error ?

Yep. I think it might be related to some malware, because I just discovered I can't connect to Windows Update. Will edit post if I figure out the problem.

Edit: For some reason my LAN options were set to use a proxy. Turned that off and everything works fine. Yay! I love this program. :)
 
Last edited:
New cross-platform version written in Python

Hi, guys. I made my own utility that does this, not knowing that this version existed. My version is written in Python 2, so it's more cross-platform than the .Net version (dealing with Mono on a Mac is a real pain). It works unmodified on Windows, Linux, and Mac OS X. I've provided a windows executable (for convenience) too.

Instructions:

Download the .exe file (32-bit Windows or 64-bit Windows) or the .py file (Windows, Mac or Linux)

.exe users: Run the installer, and when you want to run mafia, run mafiaupdater.exe instead
.py users: When you want to run mafia, run mafiaupdater.py instead

That's it!

The script downloads the newest version of mafia and runs it for you. This way, you don't need to worry about KoL content not being in mafia yet, because the version you're running is always the newest!

Windows users using the .py file will need to install Python 2.whatever. The script doesn't appear to work with Python 3. (http://www.python.org). Mac and Linux users have it installed already.
 
Last edited:
Two potential tweaks. One, the typo that Azrane found is still there, namely this:
Command Line Arguments:
-o: Don't automatically delete old versions after updating
-o: Don't automatically open KoLmafia-latest.jar after updating
-h: Show this help message
Press any key to exit.
Most people don't make two different things to use the same argument... though I suppose it's possible that "-o" both stops deleting old files and tells it not to open. My guess though is that it actually wants -d: for the "don't delete" choice.

If possible, throwing -? for help as well would be nice. I only found -h after going through the compiled file with a hex editor. Well, not even that... I was lazy and used notepad, but the concept is still the same. :D For that matter, if possible, would be nice for / to work like - as well, so you could do /h or /? for your help, and /d or /o for the changed behaviour... but both of those freqs aren't really necessary, just there to make people used to old DOS command line flags less confused. :)
 
Ruby-based KoLmafia downloader

I know this has been done to death in this thread, but I figured I'd give the script I wrote for myself if anyone prefers it...it uses ruby, so if you have that installed, you're good. Drop the script into the directory where you will run KoLmafia, and run it using:

ruby KoLmafia.rb

The script will check for the latest .jar file, download it, delete all old versions, and launch it.


Note: I couldn't upload the .rb file directly, so rename the .txt to .rb
View attachment KoLmafia.txt
 
I've been getting the following exception since 4/27.

An error occurred while downloading data from http://builds.kolmafia.us/
Exception Message: Unable to connect to the remote server

I am able to manually download builds fine, though.
That exception is thrown whenever your computer is unable to connect to the mafia server. Currently if that error is encountered the application exits, while what it should do is at least continue on to run mafia (if it exists). I just haven't gotten around to updating it to do so since you can just run any preexisting jar by hand.
 
Back
Top