I'm getting the same error with the latest builds. What is the last version that works with standard Java (version 8 update 311)?
My old Python 3 auto-update script broke down yesterday due to some issue on ci.kolmafia.us. Now that KoLmafia lives on GitHub, it made sense to tweak the script to download from GitHub instead:
SNIP
#!/usr/bin/env python
"""Updates KolMafia"""
import json
import pathlib
import sys
import urllib.request
def main():
"""Main entry point"""
RELEASES_URL = "https://api.github.com/repos/kolmafia/kolmafia/releases"
print(f"Visiting {RELEASES_URL}")
with urllib.request.urlopen(RELEASES_URL) as response:
body = response.read().decode("ISO-8859-1")
json_data = json.loads(body)
json_index = 0
while json_index < len(json_data[0]["assets"]):
if ".jar" in json_data[0]["assets"][json_index]["name"]:
break
else:
json_index += 1
continue
first_asset = json_data[0]["assets"][json_index]
jar_name = first_asset["name"]
jar_download_url = first_asset["browser_download_url"]
if pathlib.Path(jar_name).exists():
print(f"{jar_name} already exists.")
return 0
print(f"Downloading {jar_download_url}")
CHUNK_SIZE = 1024 * 1024 # 1MB
with urllib.request.urlopen(jar_download_url) as jar_response, open(
jar_name, mode="wb"
) as jarfile:
while True:
chunk: bytes = jar_response.read(CHUNK_SIZE)
jarfile.write(chunk)
print(".", end="", flush=True)
if len(chunk) < CHUNK_SIZE:
break
print("\nDownload complete!")
return 0
if __name__ == "__main__":
sys.exit(main())
I updated this script for MacOS and GitHub!I wrote a tiny script to do this from the unix command line as well -
https://github.com/mattleblanc/current-KoLMafia
Enjoy!
---------------
6/14/2024 1:56:00 PM
KoLMafiaUpdate 1.2
Checking https://ci.kolmafia.us/ for the latest version of KoLMafia...
KoLmafia-27978.jar is the latest version
KoLmafia-27978.jar exists, you have the latest version
Running KoLmafia-latest.jar...
---------------
---------------
6/15/2024 3:47:51 PM
KoLMafiaUpdate 1.2
Checking https://ci.kolmafia.us/ for the latest version of KoLMafia...
Running KoLmafia-latest.jar...
---------------
KolMafiaUpdate hasn't been working for me since mid-June. It runs, but it no longer updates, just launches the existing version of Mafia. According to what I can glean from the logs, it no longer even detects the latest version:
Code:--------------- 6/14/2024 1:56:00 PM KoLMafiaUpdate 1.2 Checking https://ci.kolmafia.us/ for the latest version of KoLMafia... KoLmafia-27978.jar is the latest version KoLmafia-27978.jar exists, you have the latest version Running KoLmafia-latest.jar... --------------- --------------- 6/15/2024 3:47:51 PM KoLMafiaUpdate 1.2 Checking https://ci.kolmafia.us/ for the latest version of KoLMafia... Running KoLmafia-latest.jar... ---------------
I've re-downloaded it, but no change. Anyone have any thoughts or suggestions?
Like fronobulax mentioned, the move to GitHub seems to have broken this auto-updater. I also used it, and I was sad when it stopped working. So I wrote a PowerShell script that serves the same purpose: https://kolmafia.us/threads/powershell-to-auto-update-kolmafia.29816/KolMafiaUpdate hasn't been working for me since mid-June. It runs, but it no longer updates, just launches the existing version of Mafia. According to what I can glean from the logs, it no longer even detects the latest version...
Thanks for the reply and explanation! I'm running KolMafiaUpdate, the subject of this topic--specifically the latest (I think) version from November of 2020, as shown in this post. It looks as if the original maintainer was matt.chugg, but I suspect that no one is maintaining it at present or someone else would have noticed when it broke a couple of months ago.I have no idea what you are running or who is maintaining it