Created
January 10, 2023 14:07
-
-
Save Specnr/0f2632fbae4499793425e1c2ebec4059 to your computer and use it in GitHub Desktop.
DELETES all worlds called New World or Speedrun # in all instances AND wipes records folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
import glob | |
import os | |
# Edit this | |
INST_FOLDER = "C:/MultiInstanceMC/MultiMC/instances" | |
RECORDS_FOLDER = "C:/Users/Spencer/speedrunigt/records" | |
with open("bop.log", "w") as log: | |
print("Deleting worlds...") | |
files = glob.glob(f'{INST_FOLDER}/*/.minecraft/saves/*') | |
for f in files: | |
if os.path.isdir(f) and ("New World" in f or "Speedrun #" in f or "Practice Seed" in f): | |
log.write("Deleting: " + f + "\n") | |
shutil.rmtree(f) | |
else: | |
log.write("Skipping: " + f + "\n") | |
print("Deleting records...") | |
files = glob.glob(f'{RECORDS_FOLDER}/*.json') | |
for f in files: | |
os.remove(f) | |
input("Bopping completed, press Enter to continue...") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment