From 4387da07b0d21a7812e55559797799311a2429fe Mon Sep 17 00:00:00 2001 From: ferricles Date: Wed, 15 Jun 2022 11:55:04 -0700 Subject: [PATCH] python refactor pt 2 --- py_script/README.md | 10 +- py_script/get.py | 67 ++++-- py_script/id_map.json | 10 +- ing_map.json => py_script/ing_map.json | 0 py_script/json_diff.py | 6 +- py_script/parse_log.py | 6 + py_script/parse_set_individual.py | 6 + py_script/parse_sets.py | 5 + py_script/plot_dps.py | 4 + ...g_transform_combine.py => process_ings.py} | 41 ++-- ...transform_preserve.py => process_items.py} | 69 +++--- ...ransform_combine.py => process_recipes.py} | 35 +-- recipe_map.json => py_script/recipe_map.json | 0 py_script/recipes.py | 33 --- py_script/script.py | 9 - py_script/sets/_Adventurer%27s.json | 39 ---- py_script/sets/_Air+Relic.json | 30 --- py_script/sets/_Bandit%27s.json | 26 --- py_script/sets/_Beachside.json | 14 -- py_script/sets/_Bear.json | 15 -- py_script/sets/_Black+Catalyst.json | 19 -- py_script/sets/_Black.json | 29 --- py_script/sets/_Blue+Team.json | 14 -- py_script/sets/_Bony.json | 14 -- py_script/sets/_Builder%27s.json | 20 -- py_script/sets/_Champion.json | 21 -- py_script/sets/_Clock.json | 58 ----- py_script/sets/_Corrupted+Nii.json | 24 -- py_script/sets/_Corrupted+Uth.json | 24 -- py_script/sets/_Cosmic.json | 44 ---- py_script/sets/_Earth+Relic.json | 30 --- py_script/sets/_Elf.json | 33 --- py_script/sets/_Fire+Relic.json | 30 --- py_script/sets/_Flashfire.json | 22 -- py_script/sets/_GM%27s.json | 20 -- py_script/sets/_Ghostly.json | 35 --- py_script/sets/_Goblin.json | 30 --- py_script/sets/_Hallowynn+2016.json | 14 -- py_script/sets/_Horse.json | 16 -- py_script/sets/_Jester.json | 37 --- py_script/sets/_Kaerynn%27s.json | 17 -- py_script/sets/_Leaf.json | 29 --- py_script/sets/_Morph.json | 73 ------ py_script/sets/_Nether.json | 33 --- py_script/sets/_Outlaw.json | 29 --- py_script/sets/_Pigman.json | 13 -- py_script/sets/_Red+Team.json | 14 -- py_script/sets/_Relic.json | 46 ---- py_script/sets/_Saint%27s.json | 38 ---- py_script/sets/_Silverfish.json | 17 -- py_script/sets/_Skien%27s.json | 24 -- py_script/sets/_Slime.json | 17 -- py_script/sets/_Snail.json | 38 ---- py_script/sets/_Snow.json | 32 --- py_script/sets/_Spider.json | 24 -- py_script/sets/_Spore.json | 14 -- py_script/sets/_Thanos+Legionnaire.json | 42 ---- py_script/sets/_Thunder+Relic.json | 30 --- py_script/sets/_Tribal.json | 27 --- py_script/sets/_Ultramarine.json | 35 --- py_script/sets/_Veekhat%27s.json | 15 -- py_script/sets/_Vexing.json | 16 -- py_script/sets/_Villager.json | 14 -- py_script/sets/_Visceral.json | 35 --- py_script/sets/_Water+Relic.json | 30 --- py_script/skillpoint_test.py | 7 +- py_script/terrs.py | 63 ------ py_script/transform_combine.py | 179 --------------- py_script/transform_merge.py | 214 ------------------ py_script/update_sets_in_items.py | 25 -- py_script/update_tomes_in_items.py | 42 ---- py_script/validate.py | 9 + 72 files changed, 176 insertions(+), 2024 deletions(-) rename ing_map.json => py_script/ing_map.json (100%) rename py_script/{ing_transform_combine.py => process_ings.py} (89%) rename py_script/{transform_preserve.py => process_items.py} (76%) rename py_script/{recipe_transform_combine.py => process_recipes.py} (57%) rename recipe_map.json => py_script/recipe_map.json (100%) delete mode 100644 py_script/recipes.py delete mode 100644 py_script/script.py delete mode 100644 py_script/sets/_Adventurer%27s.json delete mode 100644 py_script/sets/_Air+Relic.json delete mode 100644 py_script/sets/_Bandit%27s.json delete mode 100644 py_script/sets/_Beachside.json delete mode 100644 py_script/sets/_Bear.json delete mode 100644 py_script/sets/_Black+Catalyst.json delete mode 100644 py_script/sets/_Black.json delete mode 100644 py_script/sets/_Blue+Team.json delete mode 100644 py_script/sets/_Bony.json delete mode 100644 py_script/sets/_Builder%27s.json delete mode 100644 py_script/sets/_Champion.json delete mode 100644 py_script/sets/_Clock.json delete mode 100644 py_script/sets/_Corrupted+Nii.json delete mode 100644 py_script/sets/_Corrupted+Uth.json delete mode 100644 py_script/sets/_Cosmic.json delete mode 100644 py_script/sets/_Earth+Relic.json delete mode 100644 py_script/sets/_Elf.json delete mode 100644 py_script/sets/_Fire+Relic.json delete mode 100644 py_script/sets/_Flashfire.json delete mode 100644 py_script/sets/_GM%27s.json delete mode 100644 py_script/sets/_Ghostly.json delete mode 100644 py_script/sets/_Goblin.json delete mode 100644 py_script/sets/_Hallowynn+2016.json delete mode 100644 py_script/sets/_Horse.json delete mode 100644 py_script/sets/_Jester.json delete mode 100644 py_script/sets/_Kaerynn%27s.json delete mode 100644 py_script/sets/_Leaf.json delete mode 100644 py_script/sets/_Morph.json delete mode 100644 py_script/sets/_Nether.json delete mode 100644 py_script/sets/_Outlaw.json delete mode 100644 py_script/sets/_Pigman.json delete mode 100644 py_script/sets/_Red+Team.json delete mode 100644 py_script/sets/_Relic.json delete mode 100644 py_script/sets/_Saint%27s.json delete mode 100644 py_script/sets/_Silverfish.json delete mode 100644 py_script/sets/_Skien%27s.json delete mode 100644 py_script/sets/_Slime.json delete mode 100644 py_script/sets/_Snail.json delete mode 100644 py_script/sets/_Snow.json delete mode 100644 py_script/sets/_Spider.json delete mode 100644 py_script/sets/_Spore.json delete mode 100644 py_script/sets/_Thanos+Legionnaire.json delete mode 100644 py_script/sets/_Thunder+Relic.json delete mode 100644 py_script/sets/_Tribal.json delete mode 100644 py_script/sets/_Ultramarine.json delete mode 100644 py_script/sets/_Veekhat%27s.json delete mode 100644 py_script/sets/_Vexing.json delete mode 100644 py_script/sets/_Villager.json delete mode 100644 py_script/sets/_Visceral.json delete mode 100644 py_script/sets/_Water+Relic.json delete mode 100644 py_script/terrs.py delete mode 100644 py_script/transform_combine.py delete mode 100644 py_script/transform_merge.py delete mode 100644 py_script/update_sets_in_items.py delete mode 100644 py_script/update_tomes_in_items.py diff --git a/py_script/README.md b/py_script/README.md index 656b911..89a1feb 100644 --- a/py_script/README.md +++ b/py_script/README.md @@ -1,8 +1,6 @@ Process for getting new data: -1. run `python3 dump.py`. This will overwrite `dump.json` and `../ingreds.json` -2. Copy `../old clean.json` or `../compress.json` into `updated.json` -3. Run `python3 transform_merge.py` -4. Run `python3 ing_transform_combine.py` -5. Check validity (json differ or whatever) -6. Copy `clean.json` and `compress.json` into toplevel for usage +1. Get new data from API with `get.py` +2. Clean the data (may have to do manually) with the `process` related py files +3. Check validity (json differ or whatever) +4. Create clean and compress versions and copy them into toplevel for usage (can use `clean_json.py` and `compress_json.py` for this). diff --git a/py_script/get.py b/py_script/get.py index ae5ba2b..9daa4fc 100644 --- a/py_script/get.py +++ b/py_script/get.py @@ -7,27 +7,54 @@ Usage: python get.py [url or command] [outfile rel path] Relevant page: https://docs.wynncraft.com/ """ -if __name__ == "__main__": - import requests - import json - import numpy as np - import sys +import requests +import json +import numpy as np +import sys - #req can either be a link to an API page OR a preset default - req = sys.argv[1] - outfile = sys.argv[2] - response = {} #default to empty file output +#req can either be a link to an API page OR a preset default +req, outfile = sys.argv[1], sys.argv[2] - if req.lower() is "items": - response = requests.get("https://api.wynncraft.com/public_api.php?action=itemDB&category=all") - elif req.lower() is "ings": - response = requests.get("https://api.wynncraft.com/v2/ingredient/list") - elif req.lower() is "recipes": - response = requests.get("https://api.wynncraft.com/v2/recipe/list") - else: - response = requests.get(req) +CURR_WYNN_VERS = 2.0 - with open("dump.json", "w") as outfile: - outfile.write(json.dumps(response.json())) +#default to empty file output +response = {} - json.dump(response.json(), open(outfile, "w")) \ No newline at end of file +if req.lower() == "items": + response = requests.get("https://api.wynncraft.com/public_api.php?action=itemDB&category=all") +elif req.lower() == "ings": + response = {"ings":[]} + for i in range(4): + response['ings'].extend(requests.get("https://api.wynncraft.com/v2/ingredient/search/tier/" + str(i)).json()['data']) +elif req.lower() == "recipes": + temp = requests.get("https://api.wynncraft.com/v2/recipe/list") + response = {"recipes":[]} + for i in range(len(temp['data'])): + response["recipes"].extend(requests.get("https://api.wynncraft.com/v2/recipe/get/" + temp['data'][i]).json()['data']) + print("" + str(i) + " / " + str(len(temp['data']))) +elif req.lower() == "terrs": + response = requests.get("https://api.wynncraft.com/public_api.php?action=territoryList").json()['territories'] + delkeys = ["territory","acquired","attacker"] + for t in response: + for key in delkeys: + del response[t][key] + response[t]["neighbors"] = [] + + #Dependency on a third-party manually-collected data source. May not update in sync with API. + terr_data = requests.get("https://gist.githubusercontent.com/kristofbolyai/87ae828ecc740424c0f4b3749b2287ed/raw/0735f2e8bb2d2177ba0e7e96ade421621070a236/territories.json").json() + for t in data: + response[t]["neighbors"] = data[t]["Routes"] + response[t]["resources"] = data[t]["Resources"] + response[t]["storage"] = data[t]["Storage"] + response[t]["emeralds"] = data[t]["Emeralds"] + response[t]["doubleemeralds"] = data[t]["DoubleEmerald"] + response[t]["doubleresource"] = data[t]["DoubleResource"] + +elif req.lower() == "maploc": + response = requests.get('https://api.wynncraft.com/public_api.php?action=mapLocations') +else: + response = requests.get(req) + +response['version'] = CURR_WYNN_VERS + +json.dump(response, open(outfile, "w+")) \ No newline at end of file diff --git a/py_script/id_map.json b/py_script/id_map.json index 4fd47dd..aedceff 100644 --- a/py_script/id_map.json +++ b/py_script/id_map.json @@ -3646,5 +3646,11 @@ "Narcissist": 3648, "Mask of the Spirits": 3649, "Inhibitor": 3650, - "Spear of Testiness": 3651 -} + "Spear of Testiness": 3651, + "Blue Wynnter Sweater": 3648, + "Green Wynnter Sweater": 3649, + "Purple Wynnter Sweater": 3650, + "Red Wynnter Sweater": 3651, + "Snowtread Boots": 3652, + "White Wynnter Sweater": 3653 +} \ No newline at end of file diff --git a/ing_map.json b/py_script/ing_map.json similarity index 100% rename from ing_map.json rename to py_script/ing_map.json diff --git a/py_script/json_diff.py b/py_script/json_diff.py index 6e47cea..11ce04e 100644 --- a/py_script/json_diff.py +++ b/py_script/json_diff.py @@ -1,4 +1,8 @@ -"""Json diff checker for manual testing.""" +""" +Json diff checker for manual testing - mainly debug + + +""" import argparse import json diff --git a/py_script/parse_log.py b/py_script/parse_log.py index cc2b6ed..946da03 100644 --- a/py_script/parse_log.py +++ b/py_script/parse_log.py @@ -1,3 +1,9 @@ +""" +Used to parse a changelog at some point in the past. Could be used in the future. + +Not a typically used file +""" + import json import difflib diff --git a/py_script/parse_set_individual.py b/py_script/parse_set_individual.py index 4b8d012..972506f 100644 --- a/py_script/parse_set_individual.py +++ b/py_script/parse_set_individual.py @@ -1,3 +1,9 @@ +""" +Parses a set from a single file. + +Usage: python parse_set_individual.py [infile] +""" + import sys set_infile = sys.argv[1] diff --git a/py_script/parse_sets.py b/py_script/parse_sets.py index bb61088..289578d 100644 --- a/py_script/parse_sets.py +++ b/py_script/parse_sets.py @@ -1,3 +1,8 @@ +""" +An old file. + +""" + with open("sets.txt", "r") as setsFile: sets_split = (x.split("'", 2)[1][2:] for x in setsFile.read().split("a href=")[1:]) with open("sets_list.txt", "w") as outFile: diff --git a/py_script/plot_dps.py b/py_script/plot_dps.py index 5768f1d..89bafe5 100644 --- a/py_script/plot_dps.py +++ b/py_script/plot_dps.py @@ -1,3 +1,7 @@ +""" +Plots the dps of all weapons on a neat graph. Used to generate graphics for dps_vis. +""" + import matplotlib.pyplot as plt import json import numpy as np diff --git a/py_script/ing_transform_combine.py b/py_script/process_ings.py similarity index 89% rename from py_script/ing_transform_combine.py rename to py_script/process_ings.py index 0dd7491..666281b 100644 --- a/py_script/ing_transform_combine.py +++ b/py_script/process_ings.py @@ -1,15 +1,25 @@ +""" +Used to process the raw data about ingredients pulled from the API. +Usage: +- python process_ings.py [infile] [outfile] +OR +- python process_ings.py [infile and outfile] +""" import json - -with open("../ingreds.json", "r") as infile: - ing_data = json.loads(infile.read()) -ings = ing_data -#this data does not have request :) - +import sys import os -if os.path.exists("../ing_map.json"): - with open("../ing_map.json","r") as ing_mapfile: +import base64 + +infile, outfile = sys.argv[1], sys.argv[2] if len(sys.argv) > 2 else sys.argv[1] + +with open(infile, "r") as in_file: + ing_data = json.loads(in_file.read()) +ings = ing_data['ings'] + +if os.path.exists("ing_map.json"): + with open("ing_map.json","r") as ing_mapfile: ing_map = json.load(ing_mapfile) else: ing_map = {ing["name"]: i for i, ing in enumerate(ings)} @@ -146,8 +156,6 @@ ing_delete_keys = [ "skin" ] -print("loaded all files.") - for ing in ings: for key in ing_delete_keys: if key in ing: @@ -202,13 +210,10 @@ for ing in ings: print(f'New Ingred: {ing["name"]}') ing["id"] = ing_map[ing["name"]] - -with open("../ingreds_clean.json", "w") as outfile: - json.dump(ing_data, outfile, indent = 2) -with open("../ingreds_compress.json", "w") as outfile: - json.dump(ing_data, outfile) -with open("../ing_map.json", "w") as ing_mapfile: +#save ing ids +with open("ing_map.json", "w+") as ing_mapfile: json.dump(ing_map, ing_mapfile, indent = 2) - -print('All ing jsons updated.') +#save ings +with open(outfile, "w+") as out_file: + json.dump(ing_data, out_file) diff --git a/py_script/transform_preserve.py b/py_script/process_items.py similarity index 76% rename from py_script/transform_preserve.py rename to py_script/process_items.py index 66c415f..27e6ed6 100644 --- a/py_script/transform_preserve.py +++ b/py_script/process_items.py @@ -1,44 +1,30 @@ """ +Used to process the raw item data pulled from the API. -NOTE!!!!!!! +Usage: +- python process_items.py [infile] [outfile] +OR +- python process_items.py [infile and outfile] -DEMON TIDE 1.20 IS HARD CODED! - -AMBIVALENCE IS REMOVED! +NOTE: id_map.json is due for change. Should be updated manually when Wynn2.0/corresponding WB version drops. """ import json +import sys +import os +import base64 -with open("dump.json", "r") as infile: - data = json.load(infile) +infile, outfile = sys.argv[1], sys.argv[2] if len(sys.argv) > 2 else sys.argv[1] + +with open(infile, "r") as in_file: + data = json.loads(in_file.read()) -with open("updated.json", "r") as oldfile: - old_data = json.load(oldfile) items = data["items"] -old_items = old_data["items"] if "request" in data: del data["request"] -# import os -# sets = dict() -# for filename in os.listdir('sets'): -# if "json" not in filename: -# continue -# set_name = filename[1:].split(".")[0].replace("+", " ").replace("%27", "'") -# with open("sets/"+filename) as set_info: -# set_obj = json.load(set_info) -# for item in set_obj["items"]: -# item_set_map[item] = set_name -# sets[set_name] = set_obj -# -# data["sets"] = sets -data["sets"] = old_data["sets"] -item_set_map = dict() -for set_name, set_data in data["sets"].items(): - for item_name in set_data["items"]: - item_set_map[item_name] = set_name translate_mappings = { #"name": "name", @@ -141,7 +127,12 @@ delete_keys = [ #"material" ] +with open("../clean.json", "r") as oldfile: + old_data = json.load(oldfile) +old_items = old_data['items'] id_map = {item["name"]: item["id"] for item in old_items} +with open("id_map.json", "r") as idmap_file: + id_map = json.load(idmap_file) used_ids = set([v for k, v in id_map.items()]) max_id = 0 @@ -150,8 +141,8 @@ known_item_names = set() for item in items: known_item_names.add(item["name"]) -old_items_map = dict() remap_items = [] +old_items_map = dict() for item in old_items: if "remapID" in item: remap_items.append(item) @@ -186,16 +177,18 @@ for item in items: item_name = item["displayName"] else: item_name = item["name"] - if item_name in item_set_map: - item["set"] = item_set_map[item_name] - if item["name"] in old_items_map: - old_item = old_items_map[item["name"]] - if "hideSet" in old_item: - item["hideSet"] = old_item["hideSet"] items.extend(remap_items) -with open("clean.json", "w") as outfile: - json.dump(data, outfile, indent=2) -with open("compress.json", "w") as outfile: - json.dump(data, outfile) +#write items back into data +data["items"] = items + +#save id map +with open("id_map.json","w") as id_mapfile: + json.dump(id_map, id_mapfile, indent=2) + + +#write the data back to the outfile +with open(outfile, "w+") as out_file: + json.dump(data, out_file) + diff --git a/py_script/recipe_transform_combine.py b/py_script/process_recipes.py similarity index 57% rename from py_script/recipe_transform_combine.py rename to py_script/process_recipes.py index 334df84..7dad257 100644 --- a/py_script/recipe_transform_combine.py +++ b/py_script/process_recipes.py @@ -1,8 +1,22 @@ +""" +Used to process the raw data about crafting recipes pulled from the API. +Usage: +- python process_recipes.py [infile] [outfile] +OR +- python process_recipes.py [infile and outfile] +""" + +import json +import sys import os +import base64 -with open("../recipes_compress.json", "r") as infile: - recipe_data = json.loads(infile.read()) +infile, outfile = sys.argv[1], sys.argv[2] if len(sys.argv) > 2 else sys.argv[1] + + +with open(infile, "r") as in_file: + recipe_data = json.loads(in_file.read()) recipes = recipe_data["recipes"] if os.path.exists("recipe_map.json"): @@ -19,8 +33,6 @@ recipe_delete_keys = [ #lol ] -print("loaded all files.") - for recipe in recipes: for key in recipe_delete_keys: if key in recipe: @@ -34,13 +46,10 @@ for recipe in recipes: print(f'New Recipe: {recipe["name"]}') recipe["id"] = recipe_map[recipe["name"]] +#save recipe id map +with open("recipe_map.json", "w") as recipe_mapfile: + json.dump(recipe_map, recipe_mapfile, indent = 2) -with open("../recipes_clean.json", "w") as outfile: - json.dump(recipe_data, outfile, indent = 2) -with open("../recipes_compress.json", "w") as outfile: - json.dump(recipe_data, outfile) -with open("../recipe_map.json", "w") as recipe_mapfile: - json.dump(recipe_map,recipe_mapfile,indent = 2) - - -print('All ing jsons updated.') \ No newline at end of file +#save recipe data +with open(outfile, "w+") as out_file: + json.dump(recipe_data, out_file) \ No newline at end of file diff --git a/recipe_map.json b/py_script/recipe_map.json similarity index 100% rename from recipe_map.json rename to py_script/recipe_map.json diff --git a/py_script/recipes.py b/py_script/recipes.py deleted file mode 100644 index 91d9e63..0000000 --- a/py_script/recipes.py +++ /dev/null @@ -1,33 +0,0 @@ -import requests -import json -import time -''' -response = requests.get("https://api.wynncraft.com/v2/recipe/list") -with open("mats.json", "w") as outfile: - outfile.write(json.dumps(response.json()))''' - -recipes = ["Boots-3-5", "Boots-5-7", "Bow-1-3", "Boots-7-9", "Bow-3-5", "Bow-5-7", "Bow-7-9", "Bracelet-3-5", "Bracelet-5-7", "Bracelet-1-3", "Chestplate-1-3", "Chestplate-3-5", "Chestplate-7-9", "Chestplate-5-7", "Dagger-1-3", "Dagger-3-5", "Dagger-5-7", "Bracelet-7-9", "Dagger-7-9", "Food-3-5", "Food-1-3", "Food-5-7", "Food-7-9", "Helmet-1-3", "Helmet-3-5", "Helmet-7-9", "Helmet-5-7", "Necklace-3-5", "Necklace-1-3", "Necklace-7-9", "Necklace-5-7", "Pants-1-3", "Pants-3-5", "Pants-5-7", "Pants-7-9", "Potion-1-3", "Potion-3-5", "Potion-5-7", "Relik-1-3", "Potion-7-9", "Relik-5-7", "Relik-3-5", "Relik-7-9", "Boots-1-3", "Ring-3-5", "Ring-5-7", "Ring-7-9", "Scroll-1-3", "Scroll-3-5", "Scroll-5-7", "Scroll-7-9", "Spear-1-3", "Spear-3-5", "Spear-5-7", "Spear-7-9", "Wand-1-3", "Wand-3-5", "Wand-5-7", "Wand-7-9", "Boots-10-13", "Boots-13-15", "Boots-15-17", "Boots-17-19", "Bow-10-13", "Bow-13-15", "Bracelet-10-13", "Bracelet-13-15", "Bracelet-15-17", "Bow-17-19", "Bracelet-17-19", "Chestplate-10-13", "Chestplate-13-15", "Chestplate-15-17", "Bow-15-17", "Dagger-10-13", "Dagger-13-15", "Chestplate-17-19", "Dagger-17-19", "Food-13-15", "Food-15-17", "Food-10-13", "Food-17-19", "Helmet-10-13", "Helmet-13-15", "Helmet-15-17", "Helmet-17-19", "Necklace-10-13", "Dagger-15-17", "Necklace-15-17", "Necklace-17-19", "Pants-10-13", "Pants-13-15", "Pants-15-17", "Pants-17-19", "Potion-10-13", "Potion-13-15", "Potion-15-17", "Relik-10-13", "Relik-13-15", "Relik-15-17", "Relik-17-19", "Ring-10-13", "Ring-13-15", "Ring-15-17", "Ring-17-19", "Scroll-10-13", "Potion-17-19", "Scroll-13-15", "Scroll-15-17", "Spear-10-13", "Scroll-17-19", "Spear-13-15", "Spear-15-17", "Spear-17-19", "Wand-10-13", "Wand-13-15", "Wand-15-17", "Wand-17-19", "Boots-20-23", "Boots-23-25", "Boots-25-27", "Bow-23-25", "Bow-20-23", "Boots-27-29", "Bow-25-27", "Bow-27-29", "Bracelet-20-23", "Bracelet-23-25", "Bracelet-25-27", "Bracelet-27-29", "Chestplate-23-25", "Chestplate-25-27", "Chestplate-20-23", "Chestplate-27-29", "Dagger-20-23", "Dagger-23-25", "Dagger-25-27", "Dagger-27-29", "Food-20-23", "Food-25-27", "Food-27-29", "Helmet-20-23", "Food-23-25", "Helmet-23-25", "Helmet-27-29", "Helmet-25-27", "Necklace-20-23", "Necklace-23-25", "Necklace-27-29", "Pants-20-23", "Necklace-25-27", "Pants-23-25", "Pants-25-27", "Pants-27-29", "Potion-20-23", "Potion-23-25", "Potion-27-29", "Potion-25-27", "Relik-20-23", "Relik-23-25", "Relik-25-27", "Relik-27-29", "Ring-20-23", "Ring-23-25", "Ring-25-27", "Ring-27-29", "Scroll-20-23", "Scroll-23-25", "Scroll-25-27", "Scroll-27-29", "Spear-20-23", "Spear-23-25", "Spear-25-27", "Spear-27-29", "Wand-20-23", "Wand-23-25", "Wand-25-27", "Wand-27-29", "Boots-30-33", "Boots-33-35", "Boots-35-37", "Boots-37-39", "Bow-30-33", "Bow-33-35", "Bow-35-37", "Necklace-13-15", "Bow-37-39", "Bracelet-30-33", "Bracelet-33-35", "Bracelet-35-37", "Bracelet-37-39", "Chestplate-30-33", "Chestplate-35-37", "Chestplate-33-35", "Dagger-30-33", "Chestplate-37-39", "Dagger-35-37", "Dagger-37-39", "Food-30-33", "Dagger-33-35", "Food-33-35", "Food-35-37", "Food-37-39", "Helmet-30-33", "Helmet-33-35", "Helmet-35-37", "Helmet-37-39", "Necklace-30-33", "Necklace-33-35", "Necklace-35-37", "Necklace-37-39", "Pants-33-35", "Pants-30-33", "Pants-35-37", "Pants-37-39", "Potion-30-33", "Potion-33-35", "Potion-35-37", "Potion-37-39", "Relik-30-33", "Relik-33-35", "Relik-35-37", "Ring-30-33", "Relik-37-39", "Ring-33-35", "Ring-35-37", "Ring-37-39", "Scroll-30-33", "Scroll-33-35", "Scroll-35-37", "Scroll-37-39", "Spear-30-33", "Spear-33-35", "Spear-35-37", "Spear-37-39", "Wand-30-33", "Wand-33-35", "Wand-35-37", "Boots-40-43", "Wand-37-39", "Boots-45-47", "Boots-47-49", "Boots-43-45", "Bow-40-43", "Bow-47-49", "Bow-43-45", "Bracelet-40-43", "Bow-45-47", "Bracelet-45-47", "Bracelet-47-49", "Chestplate-43-45", "Bracelet-43-45", "Chestplate-40-43", "Chestplate-45-47", "Dagger-40-43", "Chestplate-47-49", "Dagger-43-45", "Dagger-47-49", "Dagger-45-47", "Food-40-43", "Food-43-45", "Food-45-47", "Food-47-49", "Helmet-40-43", "Helmet-43-45", "Helmet-45-47", "Necklace-40-43", "Necklace-43-45", "Necklace-45-47", "Helmet-47-49", "Necklace-47-49", "Pants-40-43", "Pants-43-45", "Pants-45-47", "Pants-47-49", "Potion-43-45", "Potion-45-47", "Relik-40-43", "Potion-47-49", "Potion-40-43", "Relik-45-47", "Ring-40-43", "Relik-43-45", "Ring-45-47", "Relik-47-49", "Ring-43-45", "Ring-47-49", "Scroll-40-43", "Scroll-43-45", "Scroll-45-47", "Scroll-47-49", "Spear-43-45", "Spear-40-43", "Spear-45-47", "Spear-47-49", "Wand-40-43", "Wand-43-45", "Wand-45-47", "Wand-47-49", "Boots-50-53", "Boots-53-55", "Boots-55-57", "Boots-57-59", "Bow-50-53", "Bow-55-57", "Bow-53-55", "Bow-57-59", "Bracelet-50-53", "Bracelet-53-55", "Bracelet-55-57", "Bracelet-57-59", "Chestplate-50-53", "Chestplate-53-55", "Chestplate-55-57", "Chestplate-57-59", "Dagger-50-53", "Dagger-53-55", "Dagger-55-57", "Food-50-53", "Food-53-55", "Food-55-57", "Dagger-57-59", "Food-57-59", "Helmet-50-53", "Helmet-53-55", "Helmet-55-57", "Helmet-57-59", "Necklace-50-53", "Necklace-57-59", "Necklace-53-55", "Necklace-55-57", "Pants-53-55", "Pants-55-57", "Pants-57-59", "Potion-53-55", "Potion-50-53", "Potion-55-57", "Relik-50-53", "Pants-50-53", "Relik-53-55", "Potion-57-59", "Relik-55-57", "Relik-57-59", "Ring-50-53", "Ring-53-55", "Ring-55-57", "Ring-57-59", "Scroll-50-53", "Scroll-53-55", "Scroll-57-59", "Scroll-55-57", "Spear-50-53", "Spear-53-55", "Spear-55-57", "Wand-50-53", "Spear-57-59", "Wand-55-57", "Wand-53-55", "Wand-57-59", "Boots-60-63", "Boots-65-67", "Boots-63-65", "Boots-67-69", "Bow-60-63", "Bow-63-65", "Bow-67-69", "Bow-65-67", "Bracelet-63-65", "Bracelet-60-63", "Bracelet-65-67", "Bracelet-67-69", "Chestplate-63-65", "Chestplate-60-63", "Chestplate-65-67", "Chestplate-67-69", "Dagger-60-63", "Dagger-63-65", "Dagger-65-67", "Dagger-67-69", "Food-60-63", "Food-63-65", "Food-67-69", "Helmet-60-63", "Helmet-63-65", "Food-65-67", "Helmet-65-67", "Helmet-67-69", "Necklace-60-63", "Necklace-63-65", "Necklace-65-67", "Necklace-67-69", "Pants-63-65", "Pants-60-63", "Pants-65-67", "Pants-67-69", "Potion-60-63", "Potion-63-65", "Potion-67-69", "Relik-63-65", "Relik-65-67", "Potion-65-67", "Relik-67-69", "Relik-60-63", "Ring-60-63", "Ring-65-67", "Ring-63-65", "Ring-67-69", "Scroll-60-63", "Scroll-63-65", "Scroll-67-69", "Scroll-65-67", "Spear-63-65", "Spear-60-63", "Spear-67-69", "Wand-60-63", "Wand-63-65", "Spear-65-67", "Wand-65-67", "Wand-67-69", "Boots-70-73", "Boots-73-75", "Boots-77-79", "Boots-75-77", "Bow-75-77", "Bow-73-75", "Bracelet-70-73", "Bow-77-79", "Bracelet-73-75", "Bow-70-73", "Bracelet-75-77", "Chestplate-70-73", "Bracelet-77-79", "Chestplate-73-75", "Chestplate-75-77", "Chestplate-77-79", "Dagger-70-73", "Dagger-73-75", "Dagger-75-77", "Food-70-73", "Dagger-77-79", "Food-73-75", "Food-75-77", "Food-77-79", "Helmet-70-73", "Helmet-73-75", "Helmet-75-77", "Helmet-77-79", "Necklace-70-73", "Necklace-73-75", "Necklace-75-77", "Necklace-77-79", "Pants-73-75", "Pants-75-77", "Pants-77-79", "Pants-70-73", "Potion-70-73", "Potion-73-75", "Potion-75-77", "Potion-77-79", "Relik-70-73", "Relik-73-75", "Relik-75-77", "Relik-77-79", "Ring-70-73", "Ring-73-75", "Ring-75-77", "Ring-77-79", "Scroll-70-73", "Scroll-73-75", "Scroll-75-77", "Scroll-77-79", "Spear-70-73", "Spear-73-75", "Spear-75-77", "Spear-77-79", "Wand-70-73", "Wand-73-75", "Wand-75-77", "Wand-77-79", "Boots-80-83", "Boots-83-85", "Boots-85-87", "Boots-87-89", "Bow-83-85", "Bow-85-87", "Bow-80-83", "Bracelet-83-85", "Bracelet-80-83", "Bracelet-85-87", "Bow-87-89", "Bracelet-87-89", "Chestplate-80-83", "Chestplate-83-85", "Chestplate-85-87", "Chestplate-87-89", "Dagger-83-85", "Dagger-80-83", "Dagger-85-87", "Dagger-87-89", "Food-83-85", "Food-80-83", "Food-85-87", "Food-87-89", "Helmet-80-83", "Helmet-83-85", "Helmet-85-87", "Helmet-87-89", "Necklace-80-83", "Necklace-83-85", "Necklace-85-87", "Necklace-87-89", "Pants-80-83", "Pants-83-85", "Pants-85-87", "Pants-87-89", "Potion-80-83", "Potion-83-85", "Potion-85-87", "Potion-87-89", "Relik-80-83", "Relik-83-85", "Relik-85-87", "Ring-83-85", "Relik-87-89", "Ring-85-87", "Ring-80-83", "Ring-87-89", "Scroll-80-83", "Scroll-85-87", "Scroll-83-85", "Spear-80-83", "Scroll-87-89", "Spear-85-87", "Wand-80-83", "Spear-87-89", "Wand-83-85", "Wand-85-87", "Wand-87-89", "Spear-83-85", "Boots-93-95", "Boots-95-97", "Boots-90-93", "Boots-97-99", "Bow-90-93", "Bow-93-95", "Bow-95-97", "Bow-97-99", "Bracelet-90-93", "Bracelet-93-95", "Bracelet-97-99", "Chestplate-90-93", "Chestplate-93-95", "Bracelet-95-97", "Chestplate-95-97", "Ring-1-3", "Chestplate-97-99", "Dagger-93-95", "Dagger-90-93", "Dagger-95-97", "Dagger-97-99", "Food-90-93", "Food-93-95", "Food-95-97", "Food-97-99", "Helmet-90-93", "Helmet-93-95", "Helmet-95-97", "Helmet-97-99", "Necklace-93-95", "Necklace-95-97", "Necklace-97-99", "Pants-90-93", "Necklace-90-93", "Pants-93-95", "Pants-97-99", "Potion-90-93", "Potion-93-95", "Potion-95-97", "Relik-90-93", "Potion-97-99", "Relik-93-95", "Relik-95-97", "Ring-90-93", "Ring-95-97", "Ring-93-95", "Scroll-90-93", "Scroll-93-95", "Ring-97-99", "Scroll-95-97", "Spear-90-93", "Spear-93-95", "Spear-95-97", "Spear-97-99", "Relik-97-99", "Pants-95-97", "Wand-90-93", "Scroll-97-99", "Wand-93-95", "Wand-95-97", "Wand-97-99", "Boots-100-103", "Bow-100-103", "Bracelet-100-103", "Chestplate-100-103", "Dagger-100-103", "Necklace-100-103", "Potion-100-103", "Relik-100-103", "Ring-100-103", "Scroll-100-103", "Spear-100-103", "Pants-100-103", "Boots-103-105", "Bow-103-105", "Bracelet-103-105", "Chestplate-103-105", "Dagger-103-105", "Food-103-105", "Helmet-103-105", "Food-100-103", "Pants-103-105", "Potion-103-105", "Relik-103-105", "Wand-100-103", "Ring-103-105", "Necklace-103-105", "Scroll-103-105", "Spear-103-105", "Wand-103-105", "Helmet-100-103"] -#recipes = ["Boots-3-5", "Boots-5-7", "Bow-1-3", "Boots-7-9", "Bow-3-5", "Bow-5-7", "Bow-7-9", "Bracelet-3-5", "Bracelet-5-7", "Bracelet-1-3", "Chestplate-1-3", "Chestplate-3-5", "Chestplate-7-9", "Chestplate-5-7", "Dagger-1-3", "Dagger-3-5", "Dagger-5-7", "Bracelet-7-9", "Dagger-7-9", "Food-3-5", "Food-1-3", "Food-5-7", "Food-7-9", "Helmet-1-3", "Helmet-3-5", "Helmet-7-9", "Helmet-5-7", "Necklace-3-5", "Necklace-1-3", "Necklace-7-9", "Necklace-5-7", "Pants-1-3", "Pants-3-5", "Pants-5-7", "Pants-7-9", "Potion-1-3", "Potion-3-5", "Potion-5-7", "Relik-1-3", "Potion-7-9", "Relik-5-7", "Relik-3-5", "Relik-7-9", "Boots-1-3", "Ring-3-5", "Ring-5-7", "Ring-7-9", "Scroll-1-3", "Scroll-3-5", "Scroll-5-7", "Scroll-7-9", "Spear-1-3", "Spear-3-5", "Spear-5-7", "Spear-7-9", "Wand-1-3", "Wand-3-5", "Wand-5-7", "Wand-7-9", "Boots-10-13", "Boots-13-15", "Boots-15-17", "Boots-17-19", "Bow-10-13", "Bow-13-15", "Bracelet-10-13", "Bracelet-13-15", "Bracelet-15-17", "Bow-17-19", "Bracelet-17-19", "Chestplate-10-13", "Chestplate-13-15", "Chestplate-15-17", "Bow-15-17", "Dagger-10-13", "Dagger-13-15", "Chestplate-17-19", "Dagger-17-19", "Food-13-15", "Food-15-17", "Food-10-13", "Food-17-19", "Helmet-10-13", "Helmet-13-15", "Helmet-15-17", "Helmet-17-19", "Necklace-10-13", "Dagger-15-17", "Necklace-15-17", "Necklace-17-19", "Pants-10-13", "Pants-13-15", "Pants-15-17", "Pants-17-19", "Potion-10-13", "Potion-13-15", "Potion-15-17", "Relik-10-13", "Relik-13-15", "Relik-15-17", "Relik-17-19", "Ring-10-13", "Ring-13-15", "Ring-15-17", "Ring-17-19", "Scroll-10-13", "Potion-17-19", "Scroll-13-15", "Scroll-15-17", "Spear-10-13", "Scroll-17-19", "Spear-13-15", "Spear-15-17", "Spear-17-19", "Wand-10-13", "Wand-13-15", "Wand-15-17", "Wand-17-19", "Boots-20-23", "Boots-23-25", "Boots-25-27", "Bow-23-25", "Bow-20-23", "Boots-27-29", "Bow-25-27", "Bow-27-29", "Bracelet-20-23", "Bracelet-23-25", "Bracelet-25-27", "Bracelet-27-29", "Chestplate-23-25", "Chestplate-25-27", "Chestplate-20-23", "Chestplate-27-29", "Dagger-20-23", "Dagger-23-25", "Dagger-25-27", "Dagger-27-29", "Food-20-23", "Food-25-27", "Food-27-29", "Helmet-20-23", "Food-23-25", "Helmet-23-25", "Helmet-27-29", "Helmet-25-27", "Necklace-20-23", "Necklace-23-25", "Necklace-27-29", "Pants-20-23", "Necklace-25-27", "Pants-23-25", "Pants-25-27", "Pants-27-29", "Potion-20-23", "Potion-23-25", "Potion-27-29", "Potion-25-27", "Relik-20-23", "Relik-23-25", "Relik-25-27", "Relik-27-29", "Ring-20-23", "Ring-23-25", "Ring-25-27", "Ring-27-29", "Scroll-20-23", "Scroll-23-25", "Scroll-25-27", "Scroll-27-29", "Spear-20-23", "Spear-23-25", "Spear-25-27", "Spear-27-29", "Wand-20-23", "Wand-23-25", "Wand-25-27", "Wand-27-29", "Boots-30-33", "Boots-33-35", "Dagger-33-35", "Food-33-35", "Food-35-37", "Food-37-39", "Helmet-30-33", "Helmet-33-35", "Helmet-35-37", "Helmet-37-39", "Necklace-30-33", "Necklace-33-35", "Necklace-35-37", "Necklace-37-39", "Pants-33-35", "Pants-30-33", "Pants-35-37", "Pants-37-39", "Potion-30-33", "Potion-33-35", "Potion-35-37", "Potion-37-39", "Relik-30-33", "Relik-33-35", "Relik-35-37", "Ring-30-33", "Relik-37-39", "Ring-33-35", "Ring-35-37", "Ring-37-39", "Scroll-30-33", "Scroll-33-35", "Scroll-35-37", "Scroll-37-39", "Spear-30-33", "Spear-33-35", "Spear-35-37", "Spear-37-39", "Wand-30-33", "Wand-33-35", "Wand-35-37", "Boots-40-43", "Wand-37-39", "Boots-45-47", "Boots-47-49", "Boots-43-45", "Bow-40-43", "Bow-47-49", "Bow-43-45", "Bracelet-40-43", "Bow-45-47", "Bracelet-45-47", "Bracelet-47-49", "Chestplate-43-45", "Bracelet-43-45", "Chestplate-40-43", "Chestplate-45-47", "Dagger-40-43", "Chestplate-47-49", "Dagger-43-45", "Dagger-47-49", "Dagger-45-47", "Food-40-43", "Food-43-45", "Food-45-47", "Food-47-49", "Helmet-40-43", "Helmet-43-45", "Helmet-45-47", "Necklace-40-43", "Necklace-43-45", "Necklace-45-47", "Helmet-47-49", "Necklace-47-49", "Pants-40-43", "Pants-43-45", "Pants-45-47", "Pants-47-49", "Potion-43-45", "Potion-45-47", "Relik-40-43", "Potion-47-49", "Potion-40-43", "Relik-45-47", "Ring-40-43", "Relik-43-45", "Ring-45-47", "Relik-47-49", "Ring-43-45", "Ring-47-49", "Scroll-40-43", "Scroll-43-45", "Scroll-45-47", "Scroll-47-49", "Spear-43-45", "Spear-40-43", "Spear-45-47", "Spear-47-49", "Wand-40-43", "Wand-43-45", "Wand-45-47", "Wand-47-49", "Boots-50-53", "Boots-53-55", "Boots-55-57", "Boots-57-59", "Bow-50-53", "Bow-55-57", "Bow-53-55", "Bow-57-59", "Bracelet-50-53", "Bracelet-53-55", "Bracelet-55-57", "Bracelet-57-59", "Chestplate-50-53", "Chestplate-53-55", "Chestplate-55-57", "Chestplate-57-59", "Dagger-50-53", "Dagger-53-55", "Dagger-55-57", "Food-50-53", "Food-53-55", "Food-55-57", "Dagger-57-59", "Food-57-59", "Helmet-50-53", "Helmet-53-55", "Helmet-55-57", "Helmet-57-59", "Necklace-50-53", "Necklace-57-59", "Necklace-53-55", "Necklace-55-57", "Pants-53-55", "Pants-55-57", "Pants-57-59", "Potion-53-55", "Potion-50-53", "Potion-55-57", "Relik-50-53", "Pants-50-53", "Relik-53-55", "Potion-57-59", "Relik-55-57", "Relik-57-59", "Ring-50-53", "Ring-53-55", "Ring-55-57", "Ring-57-59", "Scroll-50-53", "Scroll-53-55", "Scroll-57-59", "Scroll-55-57", "Spear-50-53", "Spear-53-55", "Spear-55-57", "Wand-50-53", "Spear-57-59", "Wand-55-57", "Wand-53-55", "Wand-57-59", "Boots-60-63", "Boots-65-67", "Boots-63-65", "Boots-67-69", "Bow-60-63", "Bow-63-65", "Bow-67-69", "Bow-65-67", "Bracelet-63-65", "Bracelet-60-63", "Bracelet-65-67", "Bracelet-67-69", "Chestplate-63-65", "Chestplate-60-63", "Chestplate-65-67", "Chestplate-67-69", "Dagger-60-63", "Dagger-63-65", "Dagger-65-67", "Dagger-67-69", "Spear-60-63", "Spear-67-69", "Wand-60-63", "Wand-63-65", "Spear-65-67", "Wand-65-67", "Wand-67-69", "Boots-70-73", "Boots-73-75", "Boots-77-79", "Boots-75-77", "Bow-75-77", "Bow-73-75", "Bracelet-70-73", "Bow-77-79", "Bracelet-73-75", "Bow-70-73", "Bracelet-75-77", "Chestplate-70-73", "Bracelet-77-79", "Chestplate-73-75", "Chestplate-75-77", "Chestplate-77-79", "Dagger-70-73", "Dagger-73-75", "Dagger-75-77", "Food-70-73", "Dagger-77-79", "Food-73-75", "Food-75-77", "Food-77-79", "Helmet-70-73", "Helmet-73-75", "Helmet-75-77", "Helmet-77-79", "Necklace-70-73", "Necklace-73-75", "Necklace-75-77", "Necklace-77-79", "Pants-73-75", "Pants-75-77", "Pants-77-79", "Pants-70-73", "Potion-70-73", "Potion-73-75", "Potion-75-77", "Potion-77-79", "Relik-70-73", "Relik-73-75", "Relik-75-77", "Relik-77-79", "Ring-70-73", "Ring-73-75", "Ring-75-77", "Ring-77-79", "Scroll-70-73", "Scroll-73-75", "Scroll-75-77", "Scroll-77-79", "Spear-70-73", "Spear-73-75", "Spear-75-77", "Spear-77-79", "Wand-70-73", "Wand-73-75", "Wand-75-77", "Wand-77-79", "Boots-80-83", "Boots-83-85", "Boots-85-87", "Boots-87-89", "Bow-83-85", "Bow-85-87", "Bow-80-83", "Bracelet-83-85", "Bracelet-80-83", "Bracelet-85-87", "Bow-87-89", "Bracelet-87-89", "Chestplate-80-83", "Chestplate-83-85", "Chestplate-85-87", "Chestplate-87-89", "Dagger-83-85", "Dagger-80-83", "Dagger-85-87", "Dagger-87-89", "Food-83-85", "Food-80-83", "Food-85-87", "Food-87-89", "Helmet-80-83", "Helmet-83-85", "Helmet-85-87", "Helmet-87-89", "Necklace-80-83", "Necklace-83-85", "Necklace-85-87", "Necklace-87-89", "Pants-80-83", "Pants-83-85", "Pants-85-87", "Pants-87-89", "Potion-80-83", "Potion-83-85", "Potion-85-87", "Potion-87-89", "Relik-80-83", "Relik-83-85", "Relik-85-87", "Ring-83-85", "Relik-87-89", "Ring-85-87", "Ring-80-83", "Ring-87-89", "Scroll-80-83", "Scroll-85-87", "Scroll-83-85", "Spear-80-83", "Scroll-87-89", "Spear-85-87", "Wand-80-83", "Spear-87-89", "Wand-83-85", "Wand-85-87", "Wand-87-89", "Spear-83-85", "Boots-93-95", "Boots-95-97", "Boots-90-93", "Boots-97-99", "Bow-90-93", "Bow-93-95", "Bow-95-97", "Bow-97-99", "Bracelet-90-93", "Bracelet-93-95", "Bracelet-97-99", "Chestplate-90-93", "Chestplate-93-95", "Bracelet-95-97", "Chestplate-95-97", "Ring-1-3", "Chestplate-97-99", "Dagger-93-95", "Dagger-90-93", "Dagger-95-97", "Dagger-97-99", "Food-90-93", "Food-93-95", "Food-95-97", "Food-97-99", "Helmet-90-93", "Helmet-93-95", "Helmet-95-97", "Helmet-97-99", "Necklace-93-95", "Necklace-95-97", "Necklace-97-99", "Pants-90-93", "Necklace-90-93", "Pants-93-95", "Pants-97-99", "Potion-90-93", "Potion-93-95", "Potion-95-97", "Relik-90-93", "Potion-97-99", "Relik-93-95", "Relik-95-97", "Ring-90-93", "Ring-95-97", "Ring-93-95", "Scroll-90-93", "Scroll-93-95", "Ring-97-99", "Scroll-95-97", "Spear-90-93", "Spear-93-95", "Spear-95-97", "Spear-97-99", "Relik-97-99", "Pants-95-97", "Wand-90-93", "Scroll-97-99", "Wand-93-95", "Wand-95-97", "Wand-97-99", "Boots-100-103", "Bow-100-103", "Bracelet-100-103", "Chestplate-100-103", "Dagger-100-103", "Necklace-100-103", "Potion-100-103", "Relik-100-103", "Ring-100-103", "Scroll-100-103", "Spear-100-103", "Pants-100-103", "Boots-103-105", "Bow-103-105", "Bracelet-103-105", "Chestplate-103-105", "Dagger-103-105", "Food-103-105", "Helmet-103-105", "Food-100-103", "Pants-103-105", "Potion-103-105", "Relik-103-105", "Wand-100-103", "Ring-103-105", "Necklace-103-105", "Scroll-103-105", "Spear-103-105", "Wand-103-105", "Helmet-100-103"] - -arr = [] -fail = [] -data = [] - -'''for i in range(330,len(recipes)): - response = requests.get("https://api.wynncraft.com/v2/recipe/get/" + recipes[i]) - if("message" in response.json()): - print("failed to get " + recipes[i]) - fail.append(recipes[i]) - else: - arr.append(response.json()) - time.sleep(0.2) - -with open("temp.json", "w") as outfile: - json.dump(arr,outfile)''' - - -with open("mats_clean.json", "w") as outfile: - json.dump(arr,outfile,indent = 2) - -with open("mats_compress.json", "w") as outfile: - json.dump(arr,outfile) \ No newline at end of file diff --git a/py_script/script.py b/py_script/script.py deleted file mode 100644 index e90655d..0000000 --- a/py_script/script.py +++ /dev/null @@ -1,9 +0,0 @@ -import requests -import json -response = requests.get("https://api.wynncraft.com/public_api.php?action=itemDB&search=atlas").json() -atlas = response['items'][0] - -with open('test.json',"w") as outfile: - json.dump(atlas, outfile, indent = 2) - -print(atlas) diff --git a/py_script/sets/_Adventurer%27s.json b/py_script/sets/_Adventurer%27s.json deleted file mode 100644 index f50d86c..0000000 --- a/py_script/sets/_Adventurer%27s.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "items": [ - "Adventurer's Cap", - "Adventurer's Boots", - "Adventurer's Pants", - "Adventurer's Tunic" - ], - "bonuses": [ - {}, - { - "sdPct": 4, - "mdPct": 4, - "xpb": 10, - "lb": 5, - "spd": 2, - "hpBonus": 15, - "spRegen": 5 - }, - { - "sdPct": 12, - "mdPct": 12, - "xpb": 20, - "lb": 10, - "spd": 5, - "hpBonus": 40, - "spRegen": 15 - }, - { - "mr": 2, - "sdPct": 25, - "mdPct": 25, - "xpb": 50, - "lb": 30, - "spd": 15, - "hpBonus": 175, - "spRegen": 50 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Air+Relic.json b/py_script/sets/_Air+Relic.json deleted file mode 100644 index 77e7e65..0000000 --- a/py_script/sets/_Air+Relic.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "items": [ - "Air Relic Helmet", - "Air Relic Boots", - "Air Relic Leggings", - "Air Relic Chestplate" - ], - "bonuses": [ - {}, - { - "xpb": 5, - "lb": 10, - "spd": 10, - "hpBonus": 60 - }, - { - "xpb": 10, - "lb": 25, - "spd": 20, - "hpBonus": 190 - }, - { - "xpb": 25, - "lb": 50, - "agi": 20, - "spd": 60, - "hpBonus": 400 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Bandit%27s.json b/py_script/sets/_Bandit%27s.json deleted file mode 100644 index 3632ce1..0000000 --- a/py_script/sets/_Bandit%27s.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "items": [ - "Bandit's Locket", - "Bandit's Bangle", - "Bandit's Knuckle", - "Bandit's Ring" - ], - "bonuses": [ - {}, - { - "xpb": 3, - "lb": 4, - "eSteal": 1 - }, - { - "xpb": 7, - "lb": 9, - "eSteal": 3 - }, - { - "xpb": 12, - "lb": 15, - "eSteal": 6 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Beachside.json b/py_script/sets/_Beachside.json deleted file mode 100644 index a54b31e..0000000 --- a/py_script/sets/_Beachside.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "items": [ - "Beachside Headwrap", - "Beachside Conch" - ], - "bonuses": [ - {}, - { - "lb": 20, - "wDamPct": 35, - "wDefPct": 25 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Bear.json b/py_script/sets/_Bear.json deleted file mode 100644 index ee929ed..0000000 --- a/py_script/sets/_Bear.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "items": [ - "Bear Mask", - "Bear Head", - "Bear Body" - ], - "bonuses": [ - {}, - { - "mdPct": 14, - "hpBonus": 30, - "mdRaw": 20 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Black+Catalyst.json b/py_script/sets/_Black+Catalyst.json deleted file mode 100644 index 2495417..0000000 --- a/py_script/sets/_Black+Catalyst.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "items": [ - "Black Catalyst" - ], - "bonuses": [ - { - "xpb": -5 - }, - { - "mr": 1, - "sdPct": 10, - "xpb": 30, - "expd": 10, - "hpBonus": 325, - "spRegen": 10, - "sdRaw": 90 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Black.json b/py_script/sets/_Black.json deleted file mode 100644 index 0229629..0000000 --- a/py_script/sets/_Black.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "items": [ - "Black Cap", - "Black Boots", - "Black Pants", - "Black Tunic" - ], - "bonuses": [ - {}, - { - "ms": 1, - "dex": 2, - "sdRaw": 15, - "mdRaw": 5 - }, - { - "ms": 1, - "dex": 6, - "sdRaw": 35, - "mdRaw": 10 - }, - { - "ms": 3, - "dex": 20, - "sdRaw": 65, - "mdRaw": 70 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Blue+Team.json b/py_script/sets/_Blue+Team.json deleted file mode 100644 index 8afc872..0000000 --- a/py_script/sets/_Blue+Team.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "items": [ - "Blue Team Boots", - "Blue Team Leggings", - "Blue Team Chestplate", - "Blue Team Helmet" - ], - "bonuses": [ - {}, - {}, - {}, - {} - ] -} \ No newline at end of file diff --git a/py_script/sets/_Bony.json b/py_script/sets/_Bony.json deleted file mode 100644 index faa887b..0000000 --- a/py_script/sets/_Bony.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "items": [ - "Bony Circlet", - "Bony Bow" - ], - "bonuses": [ - {}, - { - "agi": 8, - "mdRaw": 45, - "aDamPct": 15 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Builder%27s.json b/py_script/sets/_Builder%27s.json deleted file mode 100644 index c5ca2cc..0000000 --- a/py_script/sets/_Builder%27s.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "items": [ - "Builder's Helmet", - "Builder's Boots", - "Builder's Trousers", - "Builder's Breastplate" - ], - "bonuses": [ - {}, - { - "xpb": 5 - }, - { - "xpb": 10 - }, - { - "xpb": 15 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Champion.json b/py_script/sets/_Champion.json deleted file mode 100644 index ab4161f..0000000 --- a/py_script/sets/_Champion.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "items": [ - "Champion Helmet", - "Champion Boots", - "Champion Leggings", - "Champion Chestplate" - ], - "bonuses": [ - {}, - {}, - {}, - { - "mr": 5, - "sdPct": 75, - "mdPct": 75, - "ms": 5, - "ls": 400, - "hprRaw": 600 - } - ] -} diff --git a/py_script/sets/_Clock.json b/py_script/sets/_Clock.json deleted file mode 100644 index 1d1f5a4..0000000 --- a/py_script/sets/_Clock.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "items": [ - "Clock Helm", - "Clock Amulet", - "Watch Bracelet", - "Clockwork Ring", - "Time Ring", - "Clock Boots", - "Clock Leggings", - "Clock Mail" - ], - "bonuses": [ - {}, - { - "fDamPct": 15, - "wDamPct": 6, - "aDamPct": 5, - "tDamPct": 18, - "eDamPct": 8 - }, - { - "fDamPct": 14, - "wDamPct": 12, - "aDamPct": 13 - }, - { - "fDamPct": 13, - "wDamPct": 18, - "aDamPct": 20, - "tDamPct": 18, - "eDamPct": 14 - }, - { - "fDamPct": 12, - "wDamPct": 24, - "aDamPct": 28 - }, - { - "fDamPct": 11, - "wDamPct": 24, - "aDamPct": 24, - "tDamPct": 18, - "eDamPct": 22 - }, - { - "fDamPct": 10, - "wDamPct": 24, - "aDamPct": 19 - }, - { - "fDamPct": 9, - "wDamPct": 24, - "aDamPct": 14, - "tDamPct": 18, - "eDamPct": 34 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Corrupted+Nii.json b/py_script/sets/_Corrupted+Nii.json deleted file mode 100644 index 359d0cd..0000000 --- a/py_script/sets/_Corrupted+Nii.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "items": [ - "Corrupted Nii Mukluk", - "Corrupted Nii Plate", - "Corrupted Nii Shako" - ], - "bonuses": [ - {}, - { - "int": 3, - "def": 3, - "hprRaw": 60 - }, - { - "mr": 4, - "int": 15, - "def": 15, - "hpBonus": 1500, - "hprRaw": 270, - "fDefPct": 60, - "wDefPct": 60 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Corrupted+Uth.json b/py_script/sets/_Corrupted+Uth.json deleted file mode 100644 index 9430139..0000000 --- a/py_script/sets/_Corrupted+Uth.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "items": [ - "Corrupted Uth Sandals", - "Corrupted Uth Belt", - "Corrupted Uth Plume" - ], - "bonuses": [ - {}, - { - "ls": 125, - "agi": 3, - "def": 3 - }, - { - "ls": 375, - "ref": 70, - "agi": 15, - "def": 15, - "thorns": 70, - "fDefPct": 75, - "aDefPct": 75 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Cosmic.json b/py_script/sets/_Cosmic.json deleted file mode 100644 index 3e6e0c7..0000000 --- a/py_script/sets/_Cosmic.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "items": [ - "Cosmic Visor", - "Cosmic Walkers", - "Cosmic Ward", - "Cosmic Vest" - ], - "bonuses": [ - {}, - { - "xpb": 15, - "lb": 15, - "ref": 5, - "spRegen": 15, - "fDefPct": 10, - "wDefPct": 10, - "aDefPct": 10, - "tDefPct": 10, - "eDefPct": 10 - }, - { - "xpb": 35, - "lb": 35, - "ref": 15, - "spRegen": 35, - "fDefPct": 20, - "wDefPct": 20, - "aDefPct": 20, - "tDefPct": 20, - "eDefPct": 20 - }, - { - "xpb": 50, - "lb": 50, - "ref": 30, - "spRegen": 50, - "fDefPct": 30, - "wDefPct": 30, - "aDefPct": 30, - "tDefPct": 30, - "eDefPct": 30 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Earth+Relic.json b/py_script/sets/_Earth+Relic.json deleted file mode 100644 index 1a29526..0000000 --- a/py_script/sets/_Earth+Relic.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "items": [ - "Earth Relic Helmet", - "Earth Relic Boots", - "Earth Relic Leggings", - "Earth Relic Chestplate" - ], - "bonuses": [ - {}, - { - "mdPct": 10, - "xpb": 5, - "lb": 10, - "hpBonus": 65 - }, - { - "mdPct": 20, - "xpb": 10, - "lb": 25, - "hpBonus": 200 - }, - { - "mdPct": 45, - "xpb": 25, - "lb": 50, - "str": 20, - "hpBonus": 425 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Elf.json b/py_script/sets/_Elf.json deleted file mode 100644 index 2d82b67..0000000 --- a/py_script/sets/_Elf.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "items": [ - "Elf Cap", - "Elf Shoes", - "Elf Pants", - "Elf Robe" - ], - "bonuses": [ - {}, - { - "hprPct": 10, - "lb": 8, - "agi": 5, - "def": 5, - "spd": 6 - }, - { - "hprPct": 20, - "lb": 16, - "agi": 7, - "def": 7, - "spd": 14 - }, - { - "hprPct": 45, - "lb": 32, - "agi": 10, - "def": 10, - "spd": 20, - "hprRaw": 45 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Fire+Relic.json b/py_script/sets/_Fire+Relic.json deleted file mode 100644 index bd38ca6..0000000 --- a/py_script/sets/_Fire+Relic.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "items": [ - "Fire Relic Helmet", - "Fire Relic Boots", - "Fire Relic Leggings", - "Fire Relic Chestplate" - ], - "bonuses": [ - {}, - { - "xpb": 5, - "lb": 10, - "hpBonus": 90, - "hprRaw": 12 - }, - { - "xpb": 10, - "lb": 25, - "hpBonus": 270, - "hprRaw": 40 - }, - { - "xpb": 25, - "lb": 50, - "def": 20, - "hpBonus": 570, - "hprRaw": 100 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Flashfire.json b/py_script/sets/_Flashfire.json deleted file mode 100644 index 1b5732d..0000000 --- a/py_script/sets/_Flashfire.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "items": [ - "Flashfire Gauntlet", - "Flashfire Knuckle" - ], - "bonuses": [ - {}, - { - "spd": 8, - "atkTier": 1, - "wDamPct": -15, - "wDefPct": -15 - }, - { - "spd": 16, - "atkTier": 1, - "fDamPct": 12, - "wDamPct": -15, - "wDefPct": -15 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_GM%27s.json b/py_script/sets/_GM%27s.json deleted file mode 100644 index dd60ee3..0000000 --- a/py_script/sets/_GM%27s.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "items": [ - "GM's Helmet", - "GM's Boots", - "GM's Trousers", - "GM's Breastplate" - ], - "bonuses": [ - {}, - { - "xpb": 5 - }, - { - "xpb": 10 - }, - { - "xpb": 15 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Ghostly.json b/py_script/sets/_Ghostly.json deleted file mode 100644 index 7f59dfb..0000000 --- a/py_script/sets/_Ghostly.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "items": [ - "Ghostly Cap", - "Ghostly Boots", - "Ghostly Pants", - "Ghostly Tunic" - ], - "bonuses": [ - {}, - { - "mr": -1, - "ms": 2, - "sdRaw": 35, - "wDamPct": 5, - "tDamPct": 5, - "eDamPct": -34 - }, - { - "mr": -2, - "ms": 4, - "sdRaw": 100, - "wDamPct": 10, - "tDamPct": 10, - "eDamPct": -67 - }, - { - "mr": -3, - "ms": 6, - "sdRaw": 195, - "wDamPct": 25, - "tDamPct": 25, - "eDamPct": -100 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Goblin.json b/py_script/sets/_Goblin.json deleted file mode 100644 index 7217dbd..0000000 --- a/py_script/sets/_Goblin.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "items": [ - "Goblin Hood", - "Goblin Runners", - "Goblin Cloak" - ], - "bonuses": [ - { - "sdPct": -6, - "mdPct": -6, - "sdRaw": 15, - "mdRaw": 10 - }, - { - "sdPct": -12, - "mdPct": -12, - "ls": 22, - "sdRaw": 55, - "mdRaw": 45 - }, - { - "sdPct": -23, - "mdPct": -23, - "ls": 51, - "ms": 2, - "sdRaw": 130, - "mdRaw": 105 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Hallowynn+2016.json b/py_script/sets/_Hallowynn+2016.json deleted file mode 100644 index bc95522..0000000 --- a/py_script/sets/_Hallowynn+2016.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "items": [ - "Treat", - "Trick" - ], - "bonuses": [ - {}, - { - "xpb": 15, - "spRegen": 10, - "eSteal": 5 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Horse.json b/py_script/sets/_Horse.json deleted file mode 100644 index 6cf44a5..0000000 --- a/py_script/sets/_Horse.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "items": [ - "Horse Mask", - "Horse Hoof" - ], - "bonuses": [ - {}, - { - "mdPct": 11, - "xpb": 10, - "spd": 20, - "aDamPct": 15, - "eDamPct": 15 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Jester.json b/py_script/sets/_Jester.json deleted file mode 100644 index bdcb2e8..0000000 --- a/py_script/sets/_Jester.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "items": [ - "Jester Necklace", - "Jester Bracelet", - "Jester Ring" - ], - "bonuses": [ - { - "xpb": -25, - "lb": -25 - }, - { - "xpb": -50, - "lb": -50, - "spd": -10, - "hpBonus": 300, - "sdRaw": -110, - "mdRaw": 60 - }, - { - "xpb": -75, - "lb": -75, - "spd": 5, - "hpBonus": -150, - "sdRaw": 100, - "mdRaw": -75 - }, - { - "xpb": -100, - "lb": -100, - "spd": 5, - "hpBonus": -150, - "sdRaw": 100, - "mdRaw": -75 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Kaerynn%27s.json b/py_script/sets/_Kaerynn%27s.json deleted file mode 100644 index d186b83..0000000 --- a/py_script/sets/_Kaerynn%27s.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "items": [ - "Kaerynn's Mind", - "Kaerynn's Body" - ], - "bonuses": [ - {}, - { - "mr": 2, - "xpb": 12, - "str": 4, - "hpBonus": 400, - "sdRaw": 100, - "mdRaw": 50 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Leaf.json b/py_script/sets/_Leaf.json deleted file mode 100644 index 8343c5c..0000000 --- a/py_script/sets/_Leaf.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "items": [ - "Leaf Cap", - "Leaf Boots", - "Leaf Pants", - "Leaf Tunic" - ], - "bonuses": [ - {}, - { - "hprPct": 5, - "thorns": 7, - "hpBonus": 10, - "hprRaw": 1 - }, - { - "hprPct": 12, - "thorns": 18, - "hpBonus": 20, - "hprRaw": 3 - }, - { - "hprPct": 25, - "thorns": 35, - "hpBonus": 60, - "hprRaw": 7 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Morph.json b/py_script/sets/_Morph.json deleted file mode 100644 index ba1dc87..0000000 --- a/py_script/sets/_Morph.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "items": [ - "Morph-Stardust", - "Morph-Ruby", - "Morph-Amethyst", - "Morph-Emerald", - "Morph-Topaz", - "Morph-Gold", - "Morph-Iron", - "Morph-Steel" - ], - "bonuses": [ - {}, - { - "xpb": 5, - "lb": 5 - }, - { - "mr": 1, - "xpb": 10, - "lb": 10, - "spRaw2": -1, - "hpBonus": 125 - }, - { - "mr": 1, - "xpb": 15, - "lb": 15, - "spRaw2": -1, - "hpBonus": 425 - }, - { - "mr": 2, - "xpb": 35, - "lb": 35, - "hpBonus": 1325, - "spRaw2": -1, - "spRaw4": -1 - }, - { - "mr": 2, - "xpb": 55, - "lb": 55, - "hpBonus": 2575, - "spRaw2": -1, - "spRaw4": -1 - }, - { - "mr": 3, - "xpb": 80, - "lb": 80, - "hpBonus": 4450, - "spRaw1": -1, - "spRaw2": -1, - "spRaw4": -1 - }, - { - "mr": 4, - "xpb": 100, - "lb": 100, - "str": 15, - "dex": 15, - "int": 15, - "agi": 15, - "def": 15, - "hpBonus": 6800, - "spRaw1": -1, - "spRaw2": -1, - "spRaw3": -1, - "spRaw4": -1 - } - ] -} diff --git a/py_script/sets/_Nether.json b/py_script/sets/_Nether.json deleted file mode 100644 index fa32664..0000000 --- a/py_script/sets/_Nether.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "items": [ - "Nether Cap", - "Nether Boots", - "Nether Pants", - "Nether Tunic" - ], - "bonuses": [ - {}, - { - "ls": 5, - "expd": 2, - "hprRaw": -1, - "fDamPct": 2, - "wDamPct": -10 - }, - { - "ls": 15, - "expd": 10, - "hprRaw": -2, - "fDamPct": 8, - "wDamPct": -25 - }, - { - "ls": 50, - "def": 15, - "expd": 60, - "hprRaw": -20, - "fDamPct": 42, - "wDamPct": -45 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Outlaw.json b/py_script/sets/_Outlaw.json deleted file mode 100644 index c6d49e0..0000000 --- a/py_script/sets/_Outlaw.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "items": [ - "Outlaw Cap", - "Outlaw Boots", - "Outlaw Pants", - "Outlaw Tunic" - ], - "bonuses": [ - {}, - { - "ls": 11, - "xpb": 5, - "agi": 4, - "eSteal": 2 - }, - { - "ls": 22, - "xpb": 10, - "agi": 8, - "eSteal": 4 - }, - { - "ls": 45, - "xpb": 25, - "agi": 28, - "eSteal": 8 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Pigman.json b/py_script/sets/_Pigman.json deleted file mode 100644 index 670b4b1..0000000 --- a/py_script/sets/_Pigman.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "items": [ - "Pigman Helmet", - "Pigman Battle Hammer" - ], - "bonuses": [ - {}, - { - "str": 20, - "eDamPct": 40 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Red+Team.json b/py_script/sets/_Red+Team.json deleted file mode 100644 index c2a3602..0000000 --- a/py_script/sets/_Red+Team.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "items": [ - "Red Team Boots", - "Red Team Leggings", - "Red Team Chestplate", - "Red Team Helmet" - ], - "bonuses": [ - {}, - {}, - {}, - {} - ] -} \ No newline at end of file diff --git a/py_script/sets/_Relic.json b/py_script/sets/_Relic.json deleted file mode 100644 index 0c371cd..0000000 --- a/py_script/sets/_Relic.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "items": [ - "Relic Helmet", - "Relic Boots", - "Relic Leggings", - "Relic Chestplate" - ], - "bonuses": [ - {}, - { - "xpb": 10, - "lb": 10, - "hpBonus": 65, - "fDamPct": 5, - "wDamPct": 5, - "aDamPct": 5, - "tDamPct": 5, - "eDamPct": 5 - }, - { - "xpb": 25, - "lb": 25, - "hpBonus": 200, - "fDamPct": 12, - "wDamPct": 12, - "aDamPct": 12, - "tDamPct": 12, - "eDamPct": 12 - }, - { - "xpb": 50, - "lb": 50, - "str": 8, - "dex": 8, - "int": 8, - "agi": 8, - "def": 8, - "hpBonus": 425, - "fDamPct": 25, - "wDamPct": 25, - "aDamPct": 25, - "tDamPct": 25, - "eDamPct": 25 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Saint%27s.json b/py_script/sets/_Saint%27s.json deleted file mode 100644 index 99f5173..0000000 --- a/py_script/sets/_Saint%27s.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "items": [ - "Saint's Shawl", - "Saint's Sandals", - "Saint's Leggings", - "Saint's Tunic" - ], - "bonuses": [ - {}, - { - "mr": 1, - "sdPct": -5, - "mdPct": -10, - "def": 5, - "spRegen": 5, - "wDamPct": 10, - "aDamPct": 10 - }, - { - "mr": 3, - "sdPct": -10, - "mdPct": -20, - "def": 10, - "spRegen": 10, - "wDamPct": 20, - "aDamPct": 20 - }, - { - "mr": 5, - "sdPct": -15, - "mdPct": -35, - "def": 30, - "spRegen": 100, - "wDamPct": 35, - "aDamPct": 35 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Silverfish.json b/py_script/sets/_Silverfish.json deleted file mode 100644 index fa7d63a..0000000 --- a/py_script/sets/_Silverfish.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "items": [ - "Silverfish Helm", - "Silverfish Boots" - ], - "bonuses": [ - { - "spd": 5 - }, - { - "agi": 10, - "thorns": 20, - "spd": 20, - "poison": 290 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Skien%27s.json b/py_script/sets/_Skien%27s.json deleted file mode 100644 index 3eed0fb..0000000 --- a/py_script/sets/_Skien%27s.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "items": [ - "Skien Boots", - "Skien Leggings", - "Skien's Fatigues" - ], - "bonuses": [ - {}, - { - "sdPct": -10, - "mdPct": 12, - "sdRaw": -40, - "mdRaw": 30 - }, - { - "sdPct": -35, - "mdPct": 30, - "dex": 15, - "spd": 8, - "sdRaw": -90, - "mdRaw": 125 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Slime.json b/py_script/sets/_Slime.json deleted file mode 100644 index 342bf61..0000000 --- a/py_script/sets/_Slime.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "items": [ - "Slime Boots", - "Slime Plate" - ], - "bonuses": [ - {}, - { - "hprPct": 35, - "thorns": 15, - "spd": -6, - "poison": 300, - "hpBonus": 600, - "jh": 1 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Snail.json b/py_script/sets/_Snail.json deleted file mode 100644 index 260ba13..0000000 --- a/py_script/sets/_Snail.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "items": [ - "Snail Helm", - "Snail Boots", - "Snail Leggings", - "Snail Mail" - ], - "bonuses": [ - {}, - { - "str": 7, - "agi": -5, - "thorns": 10, - "spd": -5, - "poison": 880, - "hpBonus": 1100, - "hprRaw": 125 - }, - { - "str": 14, - "agi": -10, - "thorns": 20, - "spd": -10, - "poison": 2650, - "hpBonus": 2675, - "hprRaw": 275 - }, - { - "str": 21, - "agi": -15, - "thorns": 40, - "spd": -15, - "poison": 5500, - "hpBonus": 5500, - "hprRaw": 575 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Snow.json b/py_script/sets/_Snow.json deleted file mode 100644 index 6272591..0000000 --- a/py_script/sets/_Snow.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "items": [ - "Snow Helmet", - "Snow Boots", - "Snow Pants", - "Snow Tunic" - ], - "bonuses": [ - {}, - { - "hprPct": -10, - "mr": 1, - "sdPct": 4, - "ref": 10, - "thorns": 8 - }, - { - "hprPct": -20, - "mr": 2, - "sdPct": 12, - "ref": 30, - "thorns": 24 - }, - { - "hprPct": -35, - "mr": 4, - "sdPct": 28, - "ref": 70, - "thorns": 55 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Spider.json b/py_script/sets/_Spider.json deleted file mode 100644 index 9d0062d..0000000 --- a/py_script/sets/_Spider.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "items": [ - "Spinneret", - "Abdomen", - "Cephalothorax" - ], - "bonuses": [ - {}, - { - "xpb": 10, - "dex": 2, - "agi": 2, - "spd": 7, - "poison": 35 - }, - { - "xpb": 25, - "dex": 6, - "agi": 6, - "spd": 19, - "poison": 130 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Spore.json b/py_script/sets/_Spore.json deleted file mode 100644 index 1f32c8c..0000000 --- a/py_script/sets/_Spore.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "items": [ - "Spore Cap", - "Spore Shortsword" - ], - "bonuses": [ - {}, - { - "ls": 20, - "expd": 20, - "poison": 70 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Thanos+Legionnaire.json b/py_script/sets/_Thanos+Legionnaire.json deleted file mode 100644 index 6ee1a85..0000000 --- a/py_script/sets/_Thanos+Legionnaire.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "items": [ - "Thanos Legionnaire Helm", - "Thanos Legionnaire Greaves", - "Thanos Legionnaire Leggings", - "Thanos Legionnaire Plate" - ], - "bonuses": [ - {}, - { - "str": 1, - "dex": -1, - "int": -1, - "agi": 1, - "def": 1, - "spd": 2, - "hprRaw": 60, - "mdRaw": 60 - }, - { - "str": 4, - "dex": -4, - "int": -4, - "agi": 4, - "def": 4, - "spd": 8, - "hprRaw": 180, - "mdRaw": 180 - }, - { - "str": 15, - "dex": -15, - "int": -15, - "agi": 15, - "def": 15, - "spd": 20, - "atkTier": 1, - "hprRaw": 480, - "mdRaw": 480 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Thunder+Relic.json b/py_script/sets/_Thunder+Relic.json deleted file mode 100644 index 8ae5909..0000000 --- a/py_script/sets/_Thunder+Relic.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "items": [ - "Thunder Relic Helmet", - "Thunder Relic Boots", - "Thunder Relic Leggings", - "Thunder Relic Chestplate" - ], - "bonuses": [ - {}, - { - "xpb": 5, - "lb": 10, - "hpBonus": 55, - "mdRaw": 12 - }, - { - "xpb": 10, - "lb": 25, - "hpBonus": 180, - "mdRaw": 32 - }, - { - "xpb": 25, - "lb": 50, - "dex": 20, - "hpBonus": 380, - "mdRaw": 105 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Tribal.json b/py_script/sets/_Tribal.json deleted file mode 100644 index 8532af9..0000000 --- a/py_script/sets/_Tribal.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "items": [ - "Tribal Cap", - "Tribal Boots", - "Tribal Pants", - "Tribal Tunic" - ], - "bonuses": [ - {}, - { - "str": 2, - "spd": 5 - }, - { - "str": 5, - "agi": 2, - "spd": 10 - }, - { - "sdPct": -15, - "str": 10, - "agi": 5, - "spd": 15, - "atkTier": 1 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Ultramarine.json b/py_script/sets/_Ultramarine.json deleted file mode 100644 index 52e625f..0000000 --- a/py_script/sets/_Ultramarine.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "items": [ - "Ultramarine Crown", - "Ultramarine Boots", - "Ultramarine Belt", - "Ultramarine Cape" - ], - "bonuses": [ - {}, - { - "mr": 2, - "mdPct": -24, - "int": 5, - "wDamPct": 10, - "tDamPct": -8, - "wDefPct": 16 - }, - { - "mr": 5, - "mdPct": -54, - "int": 15, - "wDamPct": 20, - "tDamPct": -18, - "wDefPct": 36 - }, - { - "mr": 8, - "mdPct": -90, - "int": 25, - "wDamPct": 40, - "tDamPct": -30, - "wDefPct": 56 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Veekhat%27s.json b/py_script/sets/_Veekhat%27s.json deleted file mode 100644 index 64277ab..0000000 --- a/py_script/sets/_Veekhat%27s.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "items": [ - "Veekhat's Horns", - "Veekhat's Udders" - ], - "bonuses": [ - {}, - { - "mdPct": 30, - "ms": 2, - "spd": 25, - "spPct2": -40 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Vexing.json b/py_script/sets/_Vexing.json deleted file mode 100644 index d51746d..0000000 --- a/py_script/sets/_Vexing.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "items": [ - "Mask of the Dark Vexations", - "Staff of the Dark Vexations" - ], - "bonuses": [ - {}, - { - "mr": 2, - "sdPct": 15, - "mdPct": -15, - "sdRaw": 30, - "spPct2": -50 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Villager.json b/py_script/sets/_Villager.json deleted file mode 100644 index c6dd53d..0000000 --- a/py_script/sets/_Villager.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "items": [ - "Villager Pants", - "Villager Mail" - ], - "bonuses": [ - {}, - { - "xpb": 20, - "lb": 60, - "eSteal": 8 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Visceral.json b/py_script/sets/_Visceral.json deleted file mode 100644 index bd5683f..0000000 --- a/py_script/sets/_Visceral.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "items": [ - "Visceral Skullcap", - "Visceral Toe", - "Visceral Legs", - "Visceral Chest" - ], - "bonuses": [ - {}, - { - "hprPct": 30, - "mdPct": 10, - "ls": 45, - "hpBonus": -1000, - "hprRaw": 35, - "mdRaw": 40 - }, - { - "hprPct": 100, - "mdPct": 25, - "ls": 90, - "hpBonus": -2500, - "hprRaw": 75, - "mdRaw": 80 - }, - { - "hprPct": 350, - "mdPct": 50, - "ls": 180, - "hpBonus": -4000, - "hprRaw": 145, - "mdRaw": 165 - } - ] -} \ No newline at end of file diff --git a/py_script/sets/_Water+Relic.json b/py_script/sets/_Water+Relic.json deleted file mode 100644 index f900450..0000000 --- a/py_script/sets/_Water+Relic.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "items": [ - "Water Relic Helmet", - "Water Relic Boots", - "Water Relic Leggings", - "Water Relic Chestplate" - ], - "bonuses": [ - {}, - { - "mr": 1, - "xpb": 5, - "lb": 10, - "hpBonus": 55 - }, - { - "mr": 2, - "xpb": 10, - "lb": 25, - "hpBonus": 170 - }, - { - "mr": 4, - "xpb": 25, - "lb": 50, - "int": 20, - "hpBonus": 360 - } - ] -} \ No newline at end of file diff --git a/py_script/skillpoint_test.py b/py_script/skillpoint_test.py index 9cdc68d..6c395b2 100644 --- a/py_script/skillpoint_test.py +++ b/py_script/skillpoint_test.py @@ -1,3 +1,8 @@ +""" +An old script used for testing skillpoint assignment algorithms. Not used commonly. +""" + + import json import math import copy @@ -7,7 +12,7 @@ with open("clean.json") as infile: def clean_item(item): if not "displayName" in item: - item["displayName"] = item["name"]; + item["displayName"] = item["name"] return item items = data["items"] diff --git a/py_script/terrs.py b/py_script/terrs.py deleted file mode 100644 index 942c320..0000000 --- a/py_script/terrs.py +++ /dev/null @@ -1,63 +0,0 @@ -import requests -import json -import time - -#used for requesting the api -'''response = requests.get("https://api.wynncraft.com/public_api.php?action=territoryList") -with open("terrs.json", "w") as outfile: - outfile.write(json.dumps(response.json()))''' - -#used for cleaning the data -'''with open("terrs.json", "r") as infile: - data = json.load(infile) - -data = data["territories"] -delkeys = ["territory","acquired","attacker"] - -for t in data: - for key in delkeys: - del data[t][key] - data[t]["neighbors"] = [] - - -with open("terrs_compress.json", "w") as outfile: - json.dump(data,outfile) -with open("terrs_clean.json", "w") as outfile: - json.dump(data,outfile,indent = 2)''' - -#used for pushing data to compress (edit in clean, move to compress) -'''with open("terrs.json", "r") as infile: - data = json.load(infile)["territories"]''' - -'''with open("terrs_clean.json", "r") as infile: - newdata = json.load(infile)''' - -'''for t in newdata: - del newdata[t]["attacker"] - del newdata[t]["acquired"]''' - - -'''response = requests.get("https://gist.githubusercontent.com/kristofbolyai/87ae828ecc740424c0f4b3749b2287ed/raw/0735f2e8bb2d2177ba0e7e96ade421621070a236/territories.json").json() -for t in data: - data[t]["neighbors"] = response[t]["Routes"] - data[t]["resources"] = response[t]["Resources"] - data[t]["storage"] = response[t]["Storage"] - data[t]["emeralds"] = response[t]["Emeralds"] - data[t]["doubleemeralds"] = response[t]["DoubleEmerald"] - data[t]["doubleresource"] = response[t]["DoubleResource"]''' - -'''with open("terrs_clean.json", "w") as outfile: - json.dump(newdata,outfile,indent=2) - -with open("terrs_compress.json", "w") as outfile: - json.dump(newdata,outfile)''' - -response = requests.get('https://api.wynncraft.com/public_api.php?action=mapLocations').json() -del response["request"] - -with open("maploc.json", "w") as outfile: - json.dump(response, outfile) -with open("maploc_clean.json", "w") as outfile: - json.dump(response, outfile, indent = 2) -with open("maploc_compress.json", "w") as outfile: - json.dump(response, outfile) \ No newline at end of file diff --git a/py_script/transform_combine.py b/py_script/transform_combine.py deleted file mode 100644 index 4662416..0000000 --- a/py_script/transform_combine.py +++ /dev/null @@ -1,179 +0,0 @@ -""" - -NOTE!!!!!!! - -DEMON TIDE 1.20 IS HARD CODED! - -AMBIVALENCE IS REMOVED! - -""" - -import json - -with open("dump.json", "r") as infile: - data = json.loads(infile.read()) - -items = data["items"] -if "request" in data: - del data["request"] - -import os -sets = dict() -item_set_map = dict() -for filename in os.listdir('sets'): - if "json" not in filename: - continue - set_name = filename[1:].split(".")[0].replace("+", " ").replace("%27", "'") - with open("sets/"+filename) as set_info: - set_obj = json.load(set_info) - for item in set_obj["items"]: - item_set_map[item] = set_name - sets[set_name] = set_obj - -data["sets"] = sets - -translate_mappings = { - #"name": "name", - #"displayName": "displayName", - #"tier": "tier", - #"set": "set", - "sockets": "slots", - #"type": "type", - #"armorType": "armorType", (deleted) - #"armorColor": "color", (deleted) - #"addedLore": "lore", (deleted) - #"material": "material", (deleted) - "dropType": "drop", - #"quest": "quest", - "restrictions": "restrict", - "damage": "nDam", - "fireDamage": "fDam", - "waterDamage": "wDam", - "airDamage": "aDam", - "thunderDamage": "tDam", - "earthDamage": "eDam", - "attackSpeed": "atkSpd", - "health": "hp", - "fireDefense": "fDef", - "waterDefense": "wDef", - "airDefense": "aDef", - "thunderDefense": "tDef", - "earthDefense": "eDef", - "level": "lvl", - "classRequirement": "classReq", - "strength": "strReq", - "dexterity": "dexReq", - "intelligence": "intReq", - "agility": "agiReq", - "defense": "defReq", - "healthRegen": "hprPct", - "manaRegen": "mr", - "spellDamage": "sdPct", - "damageBonus": "mdPct", - "lifeSteal": "ls", - "manaSteal": "ms", - "xpBonus": "xpb", - "lootBonus": "lb", - "reflection": "ref", - "strengthPoints": "str", - "dexterityPoints": "dex", - "intelligencePoints": "int", - "agilityPoints": "agi", - "defensePoints": "def", - #"thorns": "thorns", - "exploding": "expd", - "speed": "spd", - "attackSpeedBonus": "atkTier", - #"poison": "poison", - "healthBonus": "hpBonus", - "soulPoints": "spRegen", - "emeraldStealing": "eSteal", - "healthRegenRaw": "hprRaw", - "spellDamageRaw": "sdRaw", - "damageBonusRaw": "mdRaw", - "bonusFireDamage": "fDamPct", - "bonusWaterDamage": "wDamPct", - "bonusAirDamage": "aDamPct", - "bonusThunderDamage": "tDamPct", - "bonusEarthDamage": "eDamPct", - "bonusFireDefense": "fDefPct", - "bonusWaterDefense": "wDefPct", - "bonusAirDefense": "aDefPct", - "bonusThunderDefense": "tDefPct", - "bonusEarthDefense": "eDefPct", - "accessoryType": "type", - "identified": "fixID", - #"skin": "skin", - #"category": "category", - - "spellCostPct1": "spPct1", - "spellCostRaw1": "spRaw1", - "spellCostPct2": "spPct2", - "spellCostRaw2": "spRaw2", - "spellCostPct3": "spPct3", - "spellCostRaw3": "spRaw3", - "spellCostPct4": "spPct4", - "spellCostRaw4": "spRaw4", - - "rainbowSpellDamageRaw": "rainbowRaw", - #"sprint": "sprint", - "sprintRegen": "sprintReg", - "jumpHeight": "jh", - "lootQuality": "lq", - - "gatherXpBonus": "gXp", - "gatherSpeed": "gSpd", -} - -delete_keys = [ - "addedLore", - #"skin", - "armorType", - "armorColor", - "material" -] - -import os -if os.path.exists("id_map.json"): - with open("id_map.json","r") as id_mapfile: - id_map = json.load(id_mapfile) -else: - id_map = {item["name"]: i for i, item in enumerate(items)} - - -texture_names = [] - -import base64 -for item in items: - for key in delete_keys: - if key in item: - del item[key] - - for k in list(item.keys()): - if (item[k] == 0 or item[k] is None): - del item[k] - - for k, v in translate_mappings.items(): - if k in item: - item[v] = item[k] - del item[k] - - if not (item["name"] in id_map): - id_map[item["name"]] = len(id_map) - print(f'New item: {item["name"]}') - item["id"] = id_map[item["name"]] - - item["type"] = item["type"].lower() - if item["name"] in item_set_map: - item["set"] = item_set_map[item["name"]] - -#with open("1_20_ci.json", "r") as ci_file: -# ci_items = json.load(ci_file) -# items.extend(ci_items) - -with open("id_map.json","w") as id_mapfile: - json.dump(id_map, id_mapfile, indent=2) -with open("clean.json", "w") as outfile: - json.dump(data, outfile, indent=2) -with open("compress.json", "w") as outfile: - json.dump(data, outfile) diff --git a/py_script/transform_merge.py b/py_script/transform_merge.py deleted file mode 100644 index 49a962d..0000000 --- a/py_script/transform_merge.py +++ /dev/null @@ -1,214 +0,0 @@ -""" - -NOTE!!!!!!! - -DEMON TIDE 1.20 IS HARD CODED! - -AMBIVALENCE IS REMOVED! - -""" - -import json -import os - -with open("dump.json", "r") as infile: - data = json.load(infile) - -with open("updated.json", "r") as oldfile: - old_data = json.load(oldfile) - -items = data["items"] -old_items = old_data["items"] -old_tomes = old_data["tomes"] -if "request" in data: - del data["request"] - -#this script does not change sets or tomes. use the dedicated set and tome update scripts to update. -data["sets"] = old_data["sets"] -data["tomes"] = old_data["tomes"] - -item_set_map = dict() -for set_name, set_data in data["sets"].items(): - for item_name in set_data["items"]: - item_set_map[item_name] = set_name - -must_mappings = [ - "strength", - "dexterity", - "intelligence", - "agility", - "defense", - "strengthPoints", - "dexterityPoints", - "intelligencePoints", - "agilityPoints", - "defensePoints", -] - -translate_mappings = { - #"name": "name", - #"displayName": "displayName", - #"tier": "tier", - #"set": "set", - "sockets": "slots", - #"type": "type", - #"armorType": "armorType", (deleted) - "armorColor": "color", #(deleted) - "addedLore": "lore", #(deleted) - #"material": "material", (deleted) - "dropType": "drop", - #"quest": "quest", - "restrictions": "restrict", - "damage": "nDam", - "fireDamage": "fDam", - "waterDamage": "wDam", - "airDamage": "aDam", - "thunderDamage": "tDam", - "earthDamage": "eDam", - "attackSpeed": "atkSpd", - "health": "hp", - "fireDefense": "fDef", - "waterDefense": "wDef", - "airDefense": "aDef", - "thunderDefense": "tDef", - "earthDefense": "eDef", - "level": "lvl", - "classRequirement": "classReq", - "strength": "strReq", - "dexterity": "dexReq", - "intelligence": "intReq", - "agility": "agiReq", - "defense": "defReq", - "healthRegen": "hprPct", - "manaRegen": "mr", - "spellDamage": "sdPct", - "damageBonus": "mdPct", - "lifeSteal": "ls", - "manaSteal": "ms", - "xpBonus": "xpb", - "lootBonus": "lb", - "reflection": "ref", - "strengthPoints": "str", - "dexterityPoints": "dex", - "intelligencePoints": "int", - "agilityPoints": "agi", - "defensePoints": "def", - #"thorns": "thorns", - "exploding": "expd", - "speed": "spd", - "attackSpeedBonus": "atkTier", - #"poison": "poison", - "healthBonus": "hpBonus", - "soulPoints": "spRegen", - "emeraldStealing": "eSteal", - "healthRegenRaw": "hprRaw", - "spellDamageRaw": "sdRaw", - "damageBonusRaw": "mdRaw", - "bonusFireDamage": "fDamPct", - "bonusWaterDamage": "wDamPct", - "bonusAirDamage": "aDamPct", - "bonusThunderDamage": "tDamPct", - "bonusEarthDamage": "eDamPct", - "bonusFireDefense": "fDefPct", - "bonusWaterDefense": "wDefPct", - "bonusAirDefense": "aDefPct", - "bonusThunderDefense": "tDefPct", - "bonusEarthDefense": "eDefPct", - "accessoryType": "type", - "identified": "fixID", - #"skin": "skin", - #"category": "category", - - "spellCostPct1": "spPct1", - "spellCostRaw1": "spRaw1", - "spellCostPct2": "spPct2", - "spellCostRaw2": "spRaw2", - "spellCostPct3": "spPct3", - "spellCostRaw3": "spRaw3", - "spellCostPct4": "spPct4", - "spellCostRaw4": "spRaw4", - - "rainbowSpellDamageRaw": "rainbowRaw", - #"sprint": "sprint", - "sprintRegen": "sprintReg", - "jumpHeight": "jh", - "lootQuality": "lq", - - "gatherXpBonus": "gXp", - "gatherSpeed": "gSpd", -} - -delete_keys = [ - #"addedLore", - #"skin", - #"armorType", - #"armorColor", - #"material" -] - -id_map = {item["name"]: item["id"] for item in old_items} -used_ids = set([v for k, v in id_map.items()]) -max_id = 0 - -known_item_names = set() - -for item in items: - known_item_names.add(item["name"]) - -old_items_map = dict() -unchanged_items = [] -remap_items = [] -for item in old_items: - if "remapID" in item: - remap_items.append(item) - elif item["name"] not in known_item_names: - unchanged_items.append(item) - old_items_map[item["name"]] = item - -for item in items: - for key in delete_keys: - if key in item: - del item[key] - - for k in list(item.keys()): - if (item[k] == 0 or item[k] is None) and not k in must_mappings: - del item[k] - - for k, v in translate_mappings.items(): - if k in item: - item[v] = item[k] - del item[k] - - if not (item["name"] in id_map): - while max_id in used_ids: - max_id += 1 - used_ids.add(max_id) - id_map[item["name"]] = max_id - print(f'New item: {item["name"]} (id: {max_id})') - item["id"] = id_map[item["name"]] - - item["type"] = item["type"].lower() - if "displayName" in item: - item_name = item["displayName"] - else: - item_name = item["name"] - if item_name in item_set_map: - item["set"] = item_set_map[item_name] - if item["name"] in old_items_map: - old_item = old_items_map[item["name"]] - if "hideSet" in old_item: - item["hideSet"] = old_item["hideSet"] - -items.extend(unchanged_items) -items.extend(remap_items) -with open("id_map.json","w") as id_mapfile: - print("{", file=id_mapfile) - outputs = [] - for v, k in sorted((v, k) for k, v in id_map.items()): - outputs.append(f' "{k}": {v}') - print(',\n'.join(outputs), file=id_mapfile) - print("}", file=id_mapfile) -with open("clean.json", "w") as outfile: - json.dump(data, outfile, indent=2) -with open("compress.json", "w") as outfile: - json.dump(data, outfile) diff --git a/py_script/update_sets_in_items.py b/py_script/update_sets_in_items.py deleted file mode 100644 index fc4dd7d..0000000 --- a/py_script/update_sets_in_items.py +++ /dev/null @@ -1,25 +0,0 @@ -import os - -'''takes the data in updated.json and the jsons in the sets folder to update the sets in the db.''' - -with open("updated.json", "r") as oldfile: - data = json.load(oldfile) - -#This probably does not work. I have not checked :) -sets = dict() -for filename in os.listdir('sets'): - if "json" not in filename: - continue - set_name = filename[1:].split(".")[0].replace("+", " ").replace("%27", "'") - with open("sets/"+filename) as set_info: - set_obj = json.load(set_info) - for item in set_obj["items"]: - item_set_map[item] = set_name - sets[set_name] = set_obj - -data["sets"] = sets - -with open("clean.json", "w") as outfile: - json.dump(data, outfile, indent=2) -with open("compress.json", "w") as outfile: - json.dump(data, outfile) \ No newline at end of file diff --git a/py_script/update_tomes_in_items.py b/py_script/update_tomes_in_items.py deleted file mode 100644 index bc177bb..0000000 --- a/py_script/update_tomes_in_items.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import json - -'''takes updated data in tomes.json and updates the tome map''' - -#read in tomes json file -with open("../tomes.json", "r") as tomesfile: - tome_data = json.load(tomesfile) - -tomes = dict() -tome_mapping = dict() - - -max_id = 0 -for tome in tome_data: - if "id" in tome: - if tome["id"] > max_id: - max_id = tome["id"] - tome_mapping[tome["name"]] = tome["id"] -i = max_id + 1 - -for tome in tome_data: - if "id" not in tome: - tome["id"] = i - tome_mapping[tome["name"]] = i - i += 1 - - tomes[tome["name"]] = tome - - -''' -with open("clean.json", "w") as outfile: - json.dump(data, outfile, indent=2) -with open("compress.json", "w") as outfile: - json.dump(data, outfile) -''' -with open("tome_map.json", "w") as outfile: - json.dump(tome_mapping, outfile, indent = 2) -with open("../tomes2.json", "w") as outfile: - json.dump(tome_data, outfile, indent = 2) - - diff --git a/py_script/validate.py b/py_script/validate.py index 734b27d..d064ea2 100644 --- a/py_script/validate.py +++ b/py_script/validate.py @@ -1,3 +1,12 @@ +""" +Used to validate item file - searches for duplicate items. Does not change the file. + +TODO: Eventually integrate this into the process scripts, including ings and recipes + +Usage: +python validate.py [input file] +""" + import json import sys