From f0d8240aa0f9c0d8e48a8e2662f90ac5772812eb Mon Sep 17 00:00:00 2001 From: louis chauvet Date: Sat, 20 Oct 2018 23:00:51 +0200 Subject: [PATCH] Finish update_data.py --- modules/deeptown.py | 13 +- modules/deeptownOptimizer/items.json | 1560 +--------------------- modules/deeptownOptimizer/mines.json | 679 +++++++++- modules/deeptownOptimizer/optimizer.py | 20 +- modules/deeptownOptimizer/update_data.py | 79 +- traductions.py | 10 +- 6 files changed, 738 insertions(+), 1623 deletions(-) diff --git a/modules/deeptown.py b/modules/deeptown.py index c4c2182..4267207 100644 --- a/modules/deeptown.py +++ b/modules/deeptown.py @@ -5,6 +5,14 @@ import traductions as tr import modules.deeptownOptimizer.optimizer as optimizer +item_type_priority = { + "quest":00, + "crafted":50, + "chemical":60, + 'organic':70, + "raw":100, +} + class MainClass: name = "deeptown" @@ -20,7 +28,7 @@ class MainClass: await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["NotEnoughParamError"]) return if args[0] not in self.optimizer.mines["0"].keys(): - await msg.channel.send(tr.tr[self.guild.config["lang"]]["error"]["OreNotFoundError"].format(ore=args[0])) + await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["OreNotFoundError"].format(ore=args[0])) return else: text = tr.tr[self.guild.config["lang"]]["modules"]["deeptown"]["best_place_mine"].format(ore=args[0]) @@ -84,10 +92,11 @@ class MainClass: needed = self.optimizer.recursive_to_make(args[0], quantity) texte = tr.tr[self.guild.config["lang"]]["modules"]["deeptown"]["recursive_to_make"]["header"] \ .format(item=args[0], quantity=quantity) + needed.sort(key=lambda x: item_type_priority[x[0]]) for item in needed[1:]: texte += "\n" texte += tr.tr[self.guild.config["lang"]]["modules"]["deeptown"]["recursive_to_make"]["line"] \ - .format(item=item[0], quantity=item[1], time=datetime.timedelta(seconds=int(item[2]))) + .format(item=item[1], quantity=item[2], time=datetime.timedelta(seconds=int(item[3]))) texte += "```" await msg.channel.send(texte) diff --git a/modules/deeptownOptimizer/items.json b/modules/deeptownOptimizer/items.json index 52f3193..78a7d21 100644 --- a/modules/deeptownOptimizer/items.json +++ b/modules/deeptownOptimizer/items.json @@ -1,1559 +1 @@ -{ - "accumulator": { - "type": "crafted", - "building": "crafting", - "value": 9000, - "quantity": 1, - "needed": { - "sulfur": 20, - "sodium": 20 - } - }, - "insulatedwire": { - "type": "crafted", - "building": "crafting", - "value": 750, - "quantity": 1, - "needed": { - "wire": 1, - "amberinsulation": 1 - } - }, - "amberinsulation": { - "type": "crafted", - "building": "crafting", - "value": 125, - "quantity": 1, - "needed": { - "aluminiumbottle": 1, - "amber": 10 - } - }, - "aluminiumbottle": { - "type": "crafted", - "building": "crafting", - "value": 55, - "quantity": 1, - "needed": { - "aluminiumbar": 1 - } - }, - "greenlaser": { - "type": "crafted", - "building": "crafting", - "value": 400, - "quantity": 5, - "needed": { - "polishedemerald": 1, - "insulatedwire": 1, - "lamp": 1 - } - }, - "ambercharger": { - "type": "crafted", - "building": "crafting", - "value": 4, - "quantity": 1, - "needed": { - "amber": 1 - } - }, - "lamp": { - "type": "crafted", - "building": "crafting", - "value": 760, - "quantity": 1, - "needed": { - "copperbar": 5, - "wire": 10, - "graphite": 20 - } - }, - "circuits": { - "type": "crafted", - "building": "crafting", - "value": 2070, - "quantity": 1, - "needed": { - "ironbar": 10, - "graphite": 50, - "copperbar": 20 - } - }, - "battery": { - "type": "crafted", - "building": "crafting", - "value": 200, - "quantity": 1, - "needed": { - "amber": 1, - "ironbar": 1, - "copperbar": 5 - } - }, - "sattelitedish": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "wire": 50, - "coppernail": 500, - "ironbar": 20 - } - }, - "graphite": { - "type": "crafted", - "building": "crafting", - "value": 15, - "quantity": 1, - "needed": { - "coal": 5 - } - }, - "coppernail": { - "type": "crafted", - "building": "crafting", - "value": 7, - "quantity": 10, - "needed": { - "copperbar": 1 - } - }, - "wire": { - "type": "crafted", - "building": "crafting", - "value": 15, - "quantity": 5, - "needed": { - "copperbar": 1 - } - }, - "silverbar": { - "type": "crafted", - "building": "smelting", - "value": 200, - "quantity": 1, - "needed": { - "silver": 5 - } - }, - "solarpanel": { - "type": "crafted", - "building": "crafting", - "value": 69000, - "quantity": 1, - "needed": { - "rubber": 1, - "silicon": 10, - "glass": 50 - } - }, - "motherboard": { - "type": "crafted", - "building": "crafting", - "value": 17000, - "quantity": 1, - "needed": { - "goldbar": 1, - "circuits": 3, - "silicon": 3 - } - }, - "steelplate": { - "type": "crafted", - "building": "smelting", - "value": 1800, - "quantity": 1, - "needed": { - "steelbar": 5 - } - }, - "titaniumbar": { - "type": "crafted", - "building": "smelting", - "value": 3000, - "quantity": 1, - "needed": { - "titanium": 5 - } - }, - "steelbar": { - "type": "crafted", - "building": "smelting", - "value": 180, - "quantity": 1, - "needed": { - "graphite": 1, - "ironbar": 1 - } - }, - "ironbar": { - "type": "crafted", - "building": "smelting", - "value": 40, - "quantity": 1, - "needed": { - "iron": 5 - } - }, - "copperbar": { - "type": "crafted", - "building": "smelting", - "value": 25, - "quantity": 1, - "needed": { - "copper": 5 - } - }, - "trillium": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "saronite": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "thorium": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "moonstone": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "mithril": { - "type": "unknown", - "building": "", - "value": 14, - "quantity": 0, - "needed": {} - }, - "anaptanium": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "arcanite": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "diamondcutter": { - "type": "crafted", - "building": "crafting", - "value": 5000, - "quantity": 1, - "needed": { - "steelplate": 1, - "polisheddiamond": 5 - } - }, - "bomb": { - "type": "crafted", - "building": "crafting", - "value": 55500, - "quantity": 1, - "needed": { - "steelbar": 5, - "gunpowder": 10 - } - }, - "opticfiber": { - "type": "crafted", - "building": "crafting", - "value": 10500, - "quantity": 10, - "needed": { - "plasticplate": 1, - "oxygen": 10, - "silicon": 10 - } - }, - "techinducer": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "motherboard": 50 - } - }, - "portal": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "circuits": 100, - "polishedemerald": 500 - } - }, - "antenna": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "propellers": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "aluminiumbar": 25, - "insulatedwire": 50, - "steelbar": 25 - } - }, - "jetengine": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "silverbar": 20, - "wire": 100, - "steelbar": 100 - } - }, - "fuselage": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "teslacoil": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "graphite": 100, - "insulatedwire": 100, - "amber": 100 - } - }, - "cpumodule": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "coppernail": 600, - "ironbar": 20, - "circuits": 10 - } - }, - "screenmodule": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "ironbar": 50, - "lamp": 50, - "wire": 300 - } - }, - "inputmodule": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "ironbar": 20, - "battery": 50 - } - }, - "rammodule": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "ironbar": 20, - "battery": 50 - } - }, - "amberbracelet": { - "type": "crafted", - "building": "jewel", - "value": 280, - "quantity": 0, - "needed": {} - }, - "obsidianknife": { - "type": "crafted", - "building": "jewel", - "value": 32000, - "quantity": 0, - "needed": {} - }, - "compressor": { - "type": "crafted", - "building": "crafting", - "value": 44000, - "quantity": 1, - "needed": { - "refinedoil": 2, - "rubber": 1, - "ironbar": 5 - } - }, - "haircomb": { - "type": "crafted", - "building": "jewel", - "value": 14000, - "quantity": 0, - "needed": {} - }, - "emeraldring": { - "type": "crafted", - "building": "jewel", - "value": 450, - "quantity": 0, - "needed": {} - }, - "polishedobsidian": { - "type": "crafted", - "building": "jewel", - "value": 280, - "quantity": 0, - "needed": {} - }, - "polishedalexandrite": { - "type": "crafted", - "building": "jewel", - "value": 270, - "quantity": 0, - "needed": {} - }, - "polishedamethyst": { - "type": "crafted", - "building": "jewel", - "value": 250, - "quantity": 0, - "needed": {} - }, - "polishedsapphire": { - "type": "crafted", - "building": "jewel", - "value": 230, - "quantity": 0, - "needed": {} - }, - "polishedtopaz": { - "type": "crafted", - "building": "jewel", - "value": 200, - "quantity": 0, - "needed": {} - }, - "polishedruby": { - "type": "crafted", - "building": "jewel", - "value": 250, - "quantity": 0, - "needed": {} - }, - "polisheddiamond": { - "type": "crafted", - "building": "jewel", - "value": 300, - "quantity": 0, - "needed": {} - }, - "polishedemerald": { - "type": "crafted", - "building": "jewel", - "value": 160, - "quantity": 0, - "needed": {} - }, - "polishedamber": { - "type": "crafted", - "building": "jewel", - "value": 70, - "quantity": 0, - "needed": {} - }, - "goldbar": { - "type": "crafted", - "building": "smelting", - "value": 250, - "quantity": 1, - "needed": { - "gold": 5 - } - }, - "labflask": { - "type": "crafted", - "building": "crafting", - "value": 800, - "quantity": 1, - "needed": { - "glass": 1 - } - }, - "aluminiumbar": { - "type": "crafted", - "building": "smelting", - "value": 50, - "quantity": 1, - "needed": { - "aluminium": 5 - } - }, - "gear": { - "type": "crafted", - "building": "crafting", - "value": 18500, - "quantity": 1, - "needed": { - "diamondcutter": 1, - "titaniumbar": 1 - } - }, - "mayacalendar": { - "type": "crafted", - "building": "jewel", - "value": 6000, - "quantity": 0, - "needed": {} - }, - "solidpropellant": { - "type": "crafted", - "building": "crafting", - "value": 27000, - "quantity": 1, - "needed": { - "aluminiumbar": 10, - "rubber": 3 - } - }, - "uranium": { - "type": "raw", - "building": "", - "value": 22, - "quantity": 0, - "needed": {} - }, - "iron": { - "type": "raw", - "building": "", - "value": 3, - "quantity": 0, - "needed": {} - }, - "copper": { - "type": "raw", - "building": "", - "value": 2, - "quantity": 0, - "needed": {} - }, - "coal": { - "type": "raw", - "building": "smelting", - "value": 1, - "quantity": 50, - "needed": { - "tree": 1 - } - }, - "liana": { - "type": "organic", - "building": "greenhouse", - "value": 1700, - "quantity": 1, - "needed": { - "lianaseed": 1, - "water": 20 - } - }, - "lianaseed": { - "type": "organic", - "building": "", - "value": 1000, - "quantity": 0, - "needed": {} - }, - "grape": { - "type": "organic", - "building": "greenhouse", - "value": 1500, - "quantity": 2, - "needed": { - "grapeseed": 1, - "water": 15 - } - }, - "grapeseed": { - "type": "organic", - "building": "", - "value": 1200, - "quantity": 0, - "needed": {} - }, - "treeseed": { - "type": "organic", - "building": "", - "value": 10, - "quantity": 0, - "needed": {} - }, - "tree": { - "type": "organic", - "building": "greenhouse", - "value": 193, - "quantity": 10, - "needed": { - "treeseed": 1, - "water": 10 - } - }, - "glass": { - "type": "chemical", - "building": "smelting", - "value": 450, - "quantity": 1, - "needed": { - "silicon": 2 - } - }, - "gunpowder": { - "type": "chemical", - "building": "chemistry", - "value": 2500, - "quantity": 20, - "needed": { - "tree": 2, - "sulfuricacid": 2, - "diethylether": 1 - } - }, - "uraniumrod": { - "type": "chemical", - "building": "uranium", - "value": 17000, - "quantity": 0, - "needed": {} - }, - "diethylether": { - "type": "chemical", - "building": "chemistry", - "value": 17000, - "quantity": 1, - "needed": { - "ethanol": 1, - "sulfuricacid": 1 - } - }, - "amber": { - "type": "raw", - "building": "", - "value": 4, - "quantity": 0, - "needed": {} - }, - "titanium": { - "type": "chemical", - "building": "chemistry", - "value": 260, - "quantity": 50, - "needed": { - "sulfuricacid": 1, - "titaniumore": 100 - } - }, - "refinedoil": { - "type": "chemical", - "building": "chemistry", - "value": 16500, - "quantity": 1, - "needed": { - "oil": 10, - "hydrogen": 10, - "labflask": 1 - } - }, - "ethanol": { - "type": "chemical", - "building": "chemistry", - "value": 4200, - "quantity": 1, - "needed": { - "aluminiumbottle": 1, - "grape": 2 - } - }, - "sodium": { - "type": "chemical", - "building": "", - "value": 100, - "quantity": 0, - "needed": {} - }, - "silicon": { - "type": "chemical", - "building": "", - "value": 100, - "quantity": 0, - "needed": {} - }, - "sulfur": { - "type": "chemical", - "building": "", - "value": 100, - "quantity": 0, - "needed": {} - }, - "sulfuricacid": { - "type": "chemical", - "building": "chemistry", - "value": 3500, - "quantity": 1, - "needed": { - "sulfur": 2, - "cleanwater": 1 - } - }, - "rubber": { - "type": "chemical", - "building": "chemistry", - "value": 4000, - "quantity": 2, - "needed": { - "liana": 1 - } - }, - "cleanwater": { - "type": "chemical", - "building": "chemistry", - "value": 1200, - "quantity": 1, - "needed": { - "labflask": 1, - "water": 1 - } - }, - "liquidnitrogen": { - "type": "chemical", - "building": "chemistry", - "value": 12500, - "quantity": 4, - "needed": { - "aluminiumbottle": 1, - "nitrogen": 10, - "compressor": 1 - } - }, - "nitrogen": { - "type": "chemical", - "building": "", - "value": 300, - "quantity": 0, - "needed": {} - }, - "oxygen": { - "type": "chemical", - "building": "", - "value": 900, - "quantity": 0, - "needed": {} - }, - "hydrogen": { - "type": "chemical", - "building": "chemistry", - "value": 400, - "quantity": 2, - "needed": { - "cleanwater": 1 - } - }, - "water": { - "type": "raw", - "building": "smelting", - "value": 5, - "quantity": 10, - "needed": { - "ambercharger": 20, - "cosmicice": 10 - } - }, - "plasticplate": { - "type": "chemical", - "building": "chemistry", - "value": 40000, - "quantity": 1, - "needed": { - "greenlaser": 1, - "coal": 50, - "refinedoil": 1 - } - }, - "aluminium": { - "type": "raw", - "building": "", - "value": 5, - "quantity": 0, - "needed": {} - }, - "gold": { - "type": "raw", - "building": "", - "value": 10, - "quantity": 0, - "needed": {} - }, - "oil": { - "type": "raw", - "building": "", - "value": 21, - "quantity": 0, - "needed": {} - }, - "redberyl": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "helium3": { - "type": "raw", - "building": "", - "value": 400, - "quantity": 0, - "needed": {} - }, - "winterfesttoy": { - "type": "crafted", - "building": "jewel", - "value": 0, - "quantity": 0, - "needed": {} - }, - "winterfestglobe": { - "type": "crafted", - "building": "jewel", - "value": 0, - "quantity": 0, - "needed": {} - }, - "magicbox": { - "type": "crafted", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "candybatch": { - "type": "crafted", - "building": "crafting", - "value": 350, - "quantity": 1, - "needed": { - "greencandy": 3, - "yellowcandy": 3, - "redcandy": 3 - } - }, - "sockofcandies": { - "type": "crafted", - "building": "crafting", - "value": 3000, - "quantity": 1, - "needed": { - "candybatch": 2, - "wintersock": 1 - } - }, - "wintersock": { - "type": "crafted", - "building": "crafting", - "value": 600, - "quantity": 1, - "needed": { - "magicbox": 1, - "graphite": 10, - "candybatch": 1 - } - }, - "purplegift": { - "type": "crafted", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "greencandy": 300, - "magicbox": 1 - } - }, - "yellowgift": { - "type": "crafted", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "yellowcandy": 300, - "magicbox": 1 - } - }, - "crimsongift": { - "type": "crafted", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "redcandy": 300, - "magicbox": 1 - } - }, - "greencandy": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "yellowcandy": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "silver": { - "type": "raw", - "building": "", - "value": 7, - "quantity": 0, - "needed": {} - }, - "redcandy": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "copperknive": { - "type": "crafted", - "building": "crafting", - "value": 300, - "quantity": 1, - "needed": { - "copperbar": 1, - "pumpkin": 1 - } - }, - "defectivepumpkin": { - "type": "crafted", - "building": "", - "value": 100, - "quantity": 0, - "needed": {} - }, - "carvedpumkin": { - "type": "crafted", - "building": "crafting", - "value": 1100, - "quantity": 1, - "needed": { - "copperknive": 1, - "pumpkin": 1 - } - }, - "pumpkin": { - "type": "raw", - "building": "", - "value": 50, - "quantity": 0, - "needed": {} - }, - "obsidian": { - "type": "raw", - "building": "", - "value": 20, - "quantity": 0, - "needed": {} - }, - "amethyst": { - "type": "raw", - "building": "", - "value": 18, - "quantity": 0, - "needed": {} - }, - "titaniumore": { - "type": "raw", - "building": "", - "value": 19, - "quantity": 0, - "needed": {} - }, - "alexandrite": { - "type": "raw", - "building": "", - "value": 19, - "quantity": 0, - "needed": {} - }, - "ruby": { - "type": "raw", - "building": "", - "value": 15, - "quantity": 0, - "needed": {} - }, - "sapphire": { - "type": "raw", - "building": "", - "value": 16, - "quantity": 0, - "needed": {} - }, - "diamond": { - "type": "raw", - "building": "", - "value": 18, - "quantity": 0, - "needed": {} - }, - "topaz": { - "type": "raw", - "building": "", - "value": 14, - "quantity": 0, - "needed": {} - }, - "platinum": { - "type": "raw", - "building": "", - "value": 13, - "quantity": 0, - "needed": {} - }, - "emerald": { - "type": "raw", - "building": "", - "value": 12, - "quantity": 0, - "needed": {} - }, - "megapumpkin": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "stageiwinglet": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "sasmodule": { - "type": "quest", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "electroniccomponents": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "solarpanel": 65 - } - }, - "rocketengine": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "nozzleii": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "nozzleil": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "nozzleir": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "nozzleic": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "decoupleriii": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "decouplerii": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "decoupleri": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "maincapsule": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "stageiiwinglet": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "steelplate": 777 - } - }, - "stageiii": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "rocketles": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "node": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "engineil": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "engineir": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "engineic": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "rubber": 25, - "diamondcutter": 310 - } - }, - "stagei": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "dryice": { - "type": "crafted", - "building": "crafting", - "value": 140000, - "quantity": 1, - "needed": {} - }, - "magnet": { - "type": "crafted", - "building": "crafting", - "value": 300000, - "quantity": 1, - "needed": { - "magnetitebar": 1 - } - }, - "electricalengine": { - "type": "crafted", - "building": "crafting", - "value": 745000, - "quantity": 1, - "needed": { - "insulatedwire": 50, - "magnet": 1, - "aluminiumbar": 20 - } - }, - "magnetitebar": { - "type": "crafted", - "building": "smelting", - "value": 137000, - "quantity": 1, - "needed": { - "magnetiteore": 5 - } - }, - "magnetiteore": { - "type": "chemical", - "building": "chemistry", - "value": 12500, - "quantity": 1, - "needed": { - "oxygen": 5, - "ironbar": 10, - "greenlaser": 5 - } - }, - "enhancedhelium3": { - "type": "chemical", - "building": "chemistry", - "value": 190000, - "quantity": 1, - "needed": { - "aluminiumbottle": 1 - } - }, - "stageii": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": {} - }, - "toxicbomb": { - "type": "chemical", - "building": "chemistry", - "value": 77500, - "quantity": 10, - "needed": { - "sulfuricacid": 10 - } - }, - "hydrochloricacid": { - "type": "chemical", - "building": "chemistry", - "value": 12000, - "quantity": 4, - "needed": { - "sulfuricacid": 1, - "sodiumchloride": 20 - } - }, - "rockettypea": { - "type": "crafted", - "building": "", - "value": 100, - "quantity": 0, - "needed": {} - }, - "chipset": { - "type": "crafted", - "building": "crafting", - "value": 40000, - "quantity": 1, - "needed": { - "silverbar": 1, - "hydrochloricacid": 1, - "circuits": 3 - } - }, - "shardsofeternity": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofeternity": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "sulfur": 100, - "rubber": 3, - "shardsofeternity": 100 - } - }, - "shardsofradiation": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofradiation": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "sulfur": 100, - "rubber": 3, - "shardsofradiation": 100 - } - }, - "shardsofentropy": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofentropy": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "sulfur": 100, - "rubber": 3, - "shardsofentropy": 100 - } - }, - "shardsofempathy": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofempathy": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "sulfur": 100, - "rubber": 3, - "shardsofempathy": 100 - } - }, - "shardsofshine": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofshine": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "rubber": 3, - "shardsofshine": 100, - "sulfur": 100 - } - }, - "shardsofmistakes": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofmistakes": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "sulfur": 100, - "rubber": 3, - "shardsofmistakes": 100 - } - }, - "shardsofkindness": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofkindness": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "sulfur": 100, - "rubber": 3, - "shardsofkindness": 100 - } - }, - "shardsofstrength": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofstrength": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "shardsofstrength": 100, - "sulfur": 100, - "rubber": 3 - } - }, - "shardsofwisdom": { - "type": "raw", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - }, - "stoneofwisdom": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "shardsofwisdom": 100, - "rubber": 3, - "sulfur": 100 - } - }, - "researchbeam": { - "type": "quest", - "building": "crafting", - "value": 0, - "quantity": 1, - "needed": { - "accumulator": 100, - "chipset": 50, - "lutetiumbar": 40 - } - }, - "lutetiumbar": { - "type": "crafted", - "building": "smelting", - "value": 68000, - "quantity": 1, - "needed": { - "lutetium": 5 - } - }, - "zipdrive": { - "type": "crafted", - "building": "crafting", - "value": 2200, - "quantity": 1, - "needed": { - "circuits": 1, - "magicbox": 1 - } - }, - "lutetium": { - "type": "chemical", - "building": "chemistry", - "value": 13500, - "quantity": 1, - "needed": { - "sulfuricacid": 1, - "lutetiumore": 20 - } - }, - "cosmicice": { - "type": "raw", - "building": "", - "value": 100, - "quantity": 0, - "needed": {} - }, - "sodiumchloride": { - "type": "raw", - "building": "", - "value": 100, - "quantity": 0, - "needed": {} - }, - "lutetiumore": { - "type": "raw", - "building": "", - "value": 500, - "quantity": 0, - "needed": {} - }, - "rockettypeb": { - "type": "crafted", - "building": "crafting", - "value": 100, - "quantity": 1, - "needed": { - "titaniumbar": 10, - "insulatedwire": 100, - "moonstone": 1 - } - }, - "honorbadge": { - "type": "crafted", - "building": "", - "value": 0, - "quantity": 0, - "needed": {} - } -} \ No newline at end of file +{"accumulator": {"type": "crafted", "building": "crafting", "value": 9000, "quantity": 1, "time": 180, "needed": {"sulfur": 20, "sodium": 20}}, "insulatedwire": {"type": "crafted", "building": "crafting", "value": 750, "quantity": 1, "time": 200, "needed": {"wire": 1, "amberinsulation": 1}}, "amberinsulation": {"type": "crafted", "building": "crafting", "value": 125, "quantity": 1, "time": 20, "needed": {"aluminiumbottle": 1, "amber": 10}}, "aluminiumbottle": {"type": "crafted", "building": "crafting", "value": 55, "quantity": 1, "time": 30, "needed": {"aluminiumbar": 1}}, "greenlaser": {"type": "crafted", "building": "crafting", "value": 400, "quantity": 5, "time": 20, "needed": {"polishedemerald": 1, "insulatedwire": 1, "lamp": 1}}, "ambercharger": {"type": "crafted", "building": "crafting", "value": 4, "quantity": 1, "time": 5, "needed": {"amber": 1}}, "lamp": {"type": "crafted", "building": "crafting", "value": 760, "quantity": 1, "time": 80, "needed": {"copperbar": 5, "wire": 10, "graphite": 20}}, "circuits": {"type": "crafted", "building": "crafting", "value": 2070, "quantity": 1, "time": 180, "needed": {"ironbar": 10, "graphite": 50, "copperbar": 20}}, "battery": {"type": "crafted", "building": "crafting", "value": 200, "quantity": 1, "time": 120, "needed": {"amber": 1, "ironbar": 1, "copperbar": 5}}, "satellitedish": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"wire": 50, "coppernail": 500, "ironbar": 20}}, "graphite": {"type": "crafted", "building": "crafting", "value": 15, "quantity": 1, "time": 5, "needed": {"coal": 5}}, "coppernail": {"type": "crafted", "building": "crafting", "value": 7, "quantity": 10, "time": 20, "needed": {"copperbar": 1}}, "wire": {"type": "crafted", "building": "crafting", "value": 15, "quantity": 5, "time": 30, "needed": {"copperbar": 1}}, "silverbar": {"type": "crafted", "building": "smelting", "value": 200, "quantity": 1, "time": 60, "needed": {"silver": 5}}, "solarpanel": {"type": "crafted", "building": "crafting", "value": 69000, "quantity": 1, "time": 60, "needed": {"rubber": 1, "silicon": 10, "glass": 50}}, "motherboard": {"type": "crafted", "building": "crafting", "value": 17000, "quantity": 1, "time": 1800, "needed": {"goldbar": 1, "circuits": 3, "silicon": 3}}, "steelplate": {"type": "crafted", "building": "smelting", "value": 1800, "quantity": 1, "time": 120, "needed": {"steelbar": 5}}, "titaniumbar": {"type": "crafted", "building": "smelting", "value": 3000, "quantity": 1, "time": 60, "needed": {"titanium": 5}}, "steelbar": {"type": "crafted", "building": "smelting", "value": 150, "quantity": 1, "time": 45, "needed": {"graphite": 1, "ironbar": 1}}, "ironbar": {"type": "crafted", "building": "smelting", "value": 40, "quantity": 1, "time": 15, "needed": {"iron": 5}}, "copperbar": {"type": "crafted", "building": "smelting", "value": 25, "quantity": 1, "time": 10, "needed": {"copper": 5}}, "trillium": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "saronite": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "thorium": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "moonstone": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "mithril": {"type": "unknown", "building": null, "value": 14, "quantity": 0, "time": 0, "needed": {}}, "anaptanium": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "arcanite": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "diamondcutter": {"type": "crafted", "building": "crafting", "value": 5000, "quantity": 1, "time": 30, "needed": {"steelplate": 1, "polisheddiamond": 5}}, "bomb": {"type": "crafted", "building": "crafting", "value": 55500, "quantity": 1, "time": 180, "needed": {"steelbar": 5, "gunpowder": 10}}, "opticfiber": {"type": "crafted", "building": "crafting", "value": 10500, "quantity": 10, "time": 120, "needed": {"plasticplate": 1, "oxygen": 10, "silicon": 10}}, "techinducer": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 21600, "needed": {"motherboard": 50, "insulatedwire": 1000, "steelplate": 500}}, "portal": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 21600, "needed": {"circuits": 100, "polishedemerald": 500, "steelbar": 1000}}, "antenna": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"coppernail": 1000, "aluminiumbar": 10, "steelbar": 10}}, "propellers": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"aluminiumbar": 25, "insulatedwire": 50, "steelbar": 25}}, "jetengine": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"silverbar": 20, "wire": 100, "steelbar": 100}}, "fuselage": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"coppernail": 1000, "steelbar": 100, "aluminiumbar": 500}}, "teslacoil": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"graphite": 100, "insulatedwire": 100, "amber": 100}}, "cpumodule": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 5400, "needed": {"coppernail": 600, "ironbar": 20, "circuits": 10}}, "screenmodule": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 10800, "needed": {"ironbar": 50, "lamp": 50, "wire": 300}}, "inputmodule": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"ironbar": 20, "battery": 50}}, "rammodule": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 1800, "needed": {"ironbar": 20, "battery": 50}}, "amberbracelet": {"type": "crafted", "building": "jewel", "value": 280, "quantity": 0, "time": 0, "needed": {}}, "obsidianknife": {"type": "crafted", "building": "jewel", "value": 32000, "quantity": 0, "time": 0, "needed": {}}, "compressor": {"type": "crafted", "building": "crafting", "value": 44000, "quantity": 1, "time": 180, "needed": {"refinedoil": 2, "rubber": 1, "ironbar": 5}}, "haircomb": {"type": "crafted", "building": "jewel", "value": 14000, "quantity": 0, "time": 0, "needed": {}}, "emeraldring": {"type": "crafted", "building": "jewel", "value": 450, "quantity": 0, "time": 0, "needed": {}}, "polishedobsidian": {"type": "crafted", "building": "jewel", "value": 280, "quantity": 0, "time": 0, "needed": {}}, "polishedalexandrite": {"type": "crafted", "building": "jewel", "value": 270, "quantity": 0, "time": 0, "needed": {}}, "polishedamethyst": {"type": "crafted", "building": "jewel", "value": 250, "quantity": 0, "time": 0, "needed": {}}, "polishedsapphire": {"type": "crafted", "building": "jewel", "value": 230, "quantity": 0, "time": 0, "needed": {}}, "polishedtopaz": {"type": "crafted", "building": "jewel", "value": 200, "quantity": 0, "time": 0, "needed": {}}, "polishedruby": {"type": "crafted", "building": "jewel", "value": 250, "quantity": 0, "time": 0, "needed": {}}, "polisheddiamond": {"type": "crafted", "building": "jewel", "value": 300, "quantity": 0, "time": 0, "needed": {}}, "polishedemerald": {"type": "crafted", "building": "jewel", "value": 160, "quantity": 0, "time": 0, "needed": {}}, "polishedamber": {"type": "crafted", "building": "jewel", "value": 70, "quantity": 0, "time": 0, "needed": {}}, "goldbar": {"type": "crafted", "building": "smelting", "value": 250, "quantity": 1, "time": 60, "needed": {"gold": 5}}, "labflask": {"type": "crafted", "building": "crafting", "value": 800, "quantity": 1, "time": 60, "needed": {"glass": 1}}, "aluminiumbar": {"type": "crafted", "building": "smelting", "value": 50, "quantity": 1, "time": 15, "needed": {"aluminium": 5}}, "gear": {"type": "crafted", "building": "crafting", "value": 18500, "quantity": 1, "time": 80, "needed": {"diamondcutter": 1, "titaniumbar": 1}}, "mayacalendar": {"type": "crafted", "building": "jewel", "value": 6000, "quantity": 0, "time": 0, "needed": {}}, "solidpropellant": {"type": "crafted", "building": "crafting", "value": 27000, "quantity": 1, "time": 1200, "needed": {"aluminiumbar": 10, "rubber": 3}}, "uranium": {"type": "raw", "building": null, "value": 22, "quantity": 0, "time": 0, "needed": {}}, "iron": {"type": "raw", "building": null, "value": 3, "quantity": 0, "time": 0, "needed": {}}, "copper": {"type": "raw", "building": null, "value": 2, "quantity": 0, "time": 0, "needed": {}}, "coal": {"type": "raw", "building": "smelting", "value": 1, "quantity": 50, "time": 60, "needed": {"tree": 1}}, "liana": {"type": "organic", "building": "greenhouse", "value": 1700, "quantity": 1, "time": 1800, "needed": {"lianaseed": 1, "water": 20}}, "lianaseed": {"type": "organic", "building": null, "value": 1000, "quantity": 0, "time": 0, "needed": {}}, "grape": {"type": "organic", "building": "greenhouse", "value": 1500, "quantity": 2, "time": 1800, "needed": {"grapeseed": 1, "water": 15}}, "grapeseed": {"type": "organic", "building": null, "value": 1200, "quantity": 0, "time": 0, "needed": {}}, "treeseed": {"type": "organic", "building": null, "value": 10, "quantity": 0, "time": 0, "needed": {}}, "tree": {"type": "organic", "building": "greenhouse", "value": 193, "quantity": 10, "time": 1800, "needed": {"treeseed": 1, "water": 10}}, "glass": {"type": "crafted", "building": "smelting", "value": 450, "quantity": 1, "time": 60, "needed": {"silicon": 2}}, "gunpowder": {"type": "chemical", "building": "chemistry", "value": 2500, "quantity": 20, "time": 120, "needed": {"tree": 2, "sulfuricacid": 2, "diethylether": 1}}, "uraniumrod": {"type": "chemical", "building": "uranium", "value": 17000, "quantity": 0, "time": 0, "needed": {}}, "diethylether": {"type": "chemical", "building": "chemistry", "value": 17000, "quantity": 1, "time": 60, "needed": {"ethanol": 1, "sulfuricacid": 1}}, "amber": {"type": "raw", "building": null, "value": 4, "quantity": 0, "time": 0, "needed": {}}, "titanium": {"type": "chemical", "building": "chemistry", "value": 260, "quantity": 50, "time": 20, "needed": {"sulfuricacid": 1, "titaniumore": 100}}, "refinedoil": {"type": "chemical", "building": "chemistry", "value": 16500, "quantity": 1, "time": 1800, "needed": {"oil": 10, "hydrogen": 10, "labflask": 1}}, "ethanol": {"type": "chemical", "building": "chemistry", "value": 4200, "quantity": 1, "time": 1800, "needed": {"aluminiumbottle": 1, "grape": 2}}, "sodium": {"type": "chemical", "building": null, "value": 100, "quantity": 0, "time": 0, "needed": {}}, "silicon": {"type": "chemical", "building": null, "value": 100, "quantity": 0, "time": 0, "needed": {}}, "sulfur": {"type": "chemical", "building": null, "value": 100, "quantity": 0, "time": 0, "needed": {}}, "sulfuricacid": {"type": "chemical", "building": "chemistry", "value": 3500, "quantity": 1, "time": 1800, "needed": {"sulfur": 2, "cleanwater": 1}}, "rubber": {"type": "chemical", "building": "chemistry", "value": 4000, "quantity": 2, "time": 1800, "needed": {"liana": 1}}, "cleanwater": {"type": "chemical", "building": "chemistry", "value": 1200, "quantity": 1, "time": 600, "needed": {"labflask": 1, "water": 1}}, "liquidnitrogen": {"type": "chemical", "building": "chemistry", "value": 12500, "quantity": 4, "time": 120, "needed": {"aluminiumbottle": 1, "nitrogen": 10, "compressor": 1}}, "nitrogen": {"type": "chemical", "building": null, "value": 300, "quantity": 0, "time": 0, "needed": {}}, "oxygen": {"type": "chemical", "building": null, "value": 900, "quantity": 0, "time": 0, "needed": {}}, "hydrogen": {"type": "chemical", "building": "chemistry", "value": 400, "quantity": 2, "time": 900, "needed": {"cleanwater": 1}}, "water": {"type": "raw", "building": "smelting", "value": 5, "quantity": 10, "time": 120, "needed": {"ambercharger": 20, "cosmicice": 10}}, "plasticplate": {"type": "chemical", "building": "chemistry", "value": 40000, "quantity": 1, "time": 600, "needed": {"greenlaser": 1, "coal": 50, "refinedoil": 1}}, "aluminium": {"type": "raw", "building": null, "value": 5, "quantity": 0, "time": 0, "needed": {}}, "gold": {"type": "raw", "building": null, "value": 10, "quantity": 0, "time": 0, "needed": {}}, "oil": {"type": "raw", "building": null, "value": 21, "quantity": 0, "time": 0, "needed": {}}, "redberyl": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "helium3": {"type": "raw", "building": null, "value": 400, "quantity": 0, "time": 0, "needed": {}}, "winterfesttoy": {"type": "crafted", "building": "jewel", "value": 0, "quantity": 0, "time": 0, "needed": {}}, "winterfestglobe": {"type": "crafted", "building": "jewel", "value": 0, "quantity": 0, "time": 0, "needed": {}}, "magicbox": {"type": "crafted", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "candybatch": {"type": "crafted", "building": "crafting", "value": 350, "quantity": 1, "time": 25, "needed": {"greencandy": 3, "yellowcandy": 3, "redcandy": 3}}, "sockofcandies": {"type": "crafted", "building": "crafting", "value": 3000, "quantity": 1, "time": 30, "needed": {"candybatch": 2, "wintersock": 1}}, "wintersock": {"type": "crafted", "building": "crafting", "value": 600, "quantity": 1, "time": 150, "needed": {"magicbox": 1, "graphite": 10, "candybatch": 1}}, "purplegift": {"type": "crafted", "building": "crafting", "value": 0, "quantity": 1, "time": 1800, "needed": {"greencandy": 300, "magicbox": 1}}, "yellowgift": {"type": "crafted", "building": "crafting", "value": 0, "quantity": 1, "time": 1800, "needed": {"yellowcandy": 300, "magicbox": 1}}, "crimsongift": {"type": "crafted", "building": "crafting", "value": 0, "quantity": 1, "time": 1800, "needed": {"redcandy": 300, "magicbox": 1}}, "greencandy": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "yellowcandy": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "silver": {"type": "raw", "building": null, "value": 7, "quantity": 0, "time": 0, "needed": {}}, "redcandy": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "copperknife": {"type": "crafted", "building": "crafting", "value": 300, "quantity": 1, "time": 120, "needed": {"copperbar": 1, "pumpkin": 1}}, "defectivepumpkin": {"type": "crafted", "building": null, "value": 100, "quantity": 0, "time": 0, "needed": {}}, "carvedpumpkin": {"type": "crafted", "building": "crafting", "value": 1100, "quantity": 1, "time": 240, "needed": {"copperknife": 1, "pumpkin": 1}}, "pumpkin": {"type": "raw", "building": null, "value": 50, "quantity": 0, "time": 0, "needed": {}}, "obsidian": {"type": "raw", "building": null, "value": 20, "quantity": 0, "time": 0, "needed": {}}, "amethyst": {"type": "raw", "building": null, "value": 18, "quantity": 0, "time": 0, "needed": {}}, "titaniumore": {"type": "raw", "building": null, "value": 19, "quantity": 0, "time": 0, "needed": {}}, "alexandrite": {"type": "raw", "building": null, "value": 19, "quantity": 0, "time": 0, "needed": {}}, "ruby": {"type": "raw", "building": null, "value": 15, "quantity": 0, "time": 0, "needed": {}}, "sapphire": {"type": "raw", "building": null, "value": 16, "quantity": 0, "time": 0, "needed": {}}, "diamond": {"type": "raw", "building": null, "value": 18, "quantity": 0, "time": 0, "needed": {}}, "topaz": {"type": "raw", "building": null, "value": 14, "quantity": 0, "time": 0, "needed": {}}, "platinum": {"type": "raw", "building": null, "value": 13, "quantity": 0, "time": 0, "needed": {}}, "emerald": {"type": "raw", "building": null, "value": 12, "quantity": 0, "time": 0, "needed": {}}, "megapumpkin": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 300, "needed": {"carvedpumpkin": 4500}}, "stageiwinglet": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"aluminiumbar": 8888, "steelplate": 1111, "gear": 100}}, "sasmodule": {"type": "quest", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "electroniccomponents": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 10800, "needed": {"solarpanel": 65, "accumulator": 2555}}, "rocketengine": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"ironbar": 22250, "wire": 10000, "rubber": 90}}, "nozzleii": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"graphite": 15250, "aluminiumbar": 6450, "titaniumbar": 20}}, "nozzleil": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"graphite": 15100, "aluminiumbar": 6250, "titaniumbar": 25}}, "nozzleir": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"graphite": 15100, "aluminiumbar": 6250, "titaniumbar": 25}}, "nozzleic": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"graphite": 15100, "aluminiumbar": 6250, "titaniumbar": 25}}, "decoupleriii": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"coppernail": 33350, "rubber": 25, "steelplate": 777}}, "decouplerii": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"coppernail": 33350, "rubber": 25, "steelplate": 777}}, "decoupleri": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"coppernail": 33350, "steelplate": 777, "rubber": 25}}, "maincapsule": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 10800, "needed": {"aluminiumbar": 1250, "diamondcutter": 225, "rubber": 45}}, "stageiiwinglet": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"steelplate": 777, "aluminiumbar": 6250, "gear": 85}}, "stageiii": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 10800, "needed": {"aluminiumbar": 1250, "diamondcutter": 225, "rubber": 45}}, "rocketles": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"aluminiumbar": 3200, "steelbar": 1060}}, "node": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 10800, "needed": {"lamp": 1900, "glass": 1600, "copperbar": 9555}}, "engineil": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"aluminiumbar": 3120, "diamondcutter": 310, "rubber": 25}}, "engineir": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"aluminiumbar": 3120, "diamondcutter": 310, "rubber": 25}}, "engineic": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 3600, "needed": {"rubber": 25, "diamondcutter": 310, "aluminiumbar": 3120}}, "stagei": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 10800, "needed": {"aluminiumbar": 1250, "diamondcutter": 225, "rubber": 45}}, "dryice": {"type": "crafted", "building": "crafting", "value": 140000, "quantity": 1, "time": 120, "needed": {"graphite": 1000, "compressor": 1, "greenlaser": 10}}, "magnet": {"type": "crafted", "building": "crafting", "value": 300000, "quantity": 1, "time": 120, "needed": {"magnetitebar": 1}}, "electricalengine": {"type": "crafted", "building": "crafting", "value": 745000, "quantity": 1, "time": 300, "needed": {"insulatedwire": 50, "magnet": 1, "aluminiumbar": 20}}, "magnetitebar": {"type": "crafted", "building": "smelting", "value": 137000, "quantity": 1, "time": 60, "needed": {"magnetiteore": 5}}, "magnetiteore": {"type": "chemical", "building": "chemistry", "value": 12500, "quantity": 1, "time": 360, "needed": {"oxygen": 5, "ironbar": 10, "greenlaser": 5}}, "enhancedhelium3": {"type": "chemical", "building": "chemistry", "value": 190000, "quantity": 1, "time": 1800, "needed": {"aluminiumbottle": 1}}, "stageii": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 10800, "needed": {"aluminiumbar": 1250, "diamondcutter": 225, "rubber": 45}}, "toxicbomb": {"type": "chemical", "building": "chemistry", "value": 77500, "quantity": 10, "time": 120, "needed": {"sulfuricacid": 10}}, "hydrochloricacid": {"type": "chemical", "building": "chemistry", "value": 12000, "quantity": 4, "time": 120, "needed": {"sulfuricacid": 1, "sodiumchloride": 20}}, "rockettypea": {"type": "crafted", "building": null, "value": 100, "quantity": 0, "time": 0, "needed": {}}, "chipset": {"type": "crafted", "building": "crafting", "value": 40000, "quantity": 1, "time": 60, "needed": {"silverbar": 1, "hydrochloricacid": 1, "circuits": 3}}, "shardsofeternity": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofeternity": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"sulfur": 100, "rubber": 3, "shardsofeternity": 100}}, "shardsofradiation": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofradiation": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"sulfur": 100, "rubber": 3, "shardsofradiation": 100}}, "shardsofentropy": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofentropy": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"sulfur": 100, "rubber": 3, "shardsofentropy": 100}}, "shardsofempathy": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofempathy": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"sulfur": 100, "rubber": 3, "shardsofempathy": 100}}, "shardsofshine": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofshine": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"rubber": 3, "shardsofshine": 100, "sulfur": 100}}, "shardsofmistakes": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofmistakes": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"sulfur": 100, "rubber": 3, "shardsofmistakes": 100}}, "shardsofkindness": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofkindness": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"sulfur": 100, "rubber": 3, "shardsofkindness": 100}}, "shardsofstrength": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofstrength": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 18000, "needed": {"shardsofstrength": 100, "sulfur": 100, "rubber": 3}}, "shardsofwisdom": {"type": "raw", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}, "stoneofwisdom": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 1200, "needed": {"shardsofwisdom": 100, "rubber": 3, "sulfur": 100}}, "researchbeam": {"type": "quest", "building": "crafting", "value": 0, "quantity": 1, "time": 1800, "needed": {"accumulator": 100, "chipset": 50, "lutetiumbar": 40}}, "lutetiumbar": {"type": "crafted", "building": "smelting", "value": 68000, "quantity": 1, "time": 60, "needed": {"lutetium": 5}}, "zipdrive": {"type": "crafted", "building": "crafting", "value": 2200, "quantity": 1, "time": 30, "needed": {"circuits": 1, "magicbox": 1}}, "lutetium": {"type": "chemical", "building": "chemistry", "value": 13500, "quantity": 1, "time": 600, "needed": {"sulfuricacid": 1, "lutetiumore": 20}}, "cosmicice": {"type": "raw", "building": null, "value": 100, "quantity": 0, "time": 0, "needed": {}}, "sodiumchloride": {"type": "raw", "building": null, "value": 100, "quantity": 0, "time": 0, "needed": {}}, "lutetiumore": {"type": "raw", "building": null, "value": 500, "quantity": 0, "time": 0, "needed": {}}, "rockettypeb": {"type": "crafted", "building": "crafting", "value": 100, "quantity": 1, "time": 1800, "needed": {"titaniumbar": 10, "insulatedwire": 100, "moonstone": 1}}, "honorbadge": {"type": "crafted", "building": null, "value": 0, "quantity": 0, "time": 0, "needed": {}}} \ No newline at end of file diff --git a/modules/deeptownOptimizer/mines.json b/modules/deeptownOptimizer/mines.json index 8eca240..a5e39cc 100644 --- a/modules/deeptownOptimizer/mines.json +++ b/modules/deeptownOptimizer/mines.json @@ -1,31 +1,10 @@ { - "0": { - "coal": 0, - "copper": 0, - "iron": 0, - "amber": 0, - "gold": 0, - "aluminium": 0, - "silver": 0, - "emerald": 0, - "ruby": 0, - "diamond": 0, - "topaz": 0, - "sapphire": 0, - "amethyst": 0, - "alexandrite": 0, - "titanium": 0, - "uranium": 0, - "platinum": 0, - "helium3": 0, - "obsidian": 0 - }, "1": { - "coal": 1 + "coal": 1.0 }, "2": { - "coal": 0.70, - "copper": 0.30 + "coal": 0.7, + "copper": 0.3 }, "3": { "coal": 0.595, @@ -42,13 +21,657 @@ "gold": 0.0075 }, "5": { - "coal": 0.4900, + "coal": 0.49, "copper": 0.3667, "iron": 0.1133, - "amber": 0.0200, - "gold": 0.0100 + "amber": 0.02, + "gold": 0.01 + }, + "6": { + "coal": 0.4375, + "copper": 0.4083, + "iron": 0.1242, + "amber": 0.0175, + "gold": 0.0125 + }, + "7": { + "copper": 0.45, + "coal": 0.385, + "iron": 0.135, + "amber": 0.015, + "gold": 0.015 + }, + "8": { + "copper": 0.4917, + "coal": 0.3325, + "iron": 0.1458, + "gold": 0.0175, + "amber": 0.0125 + }, + "9": { + "copper": 0.5333, + "coal": 0.28, + "iron": 0.1567, + "gold": 0.02, + "amber": 0.01 + }, + "10": { + "copper": 0.575, + "coal": 0.2275, + "iron": 0.1675, + "gold": 0.0225, + "amber": 0.0075 + }, + "11": { + "copper": 0.6167, + "iron": 0.1783, + "coal": 0.175, + "gold": 0.025, + "amber": 0.005 + }, + "12": { + "copper": 0.6583, + "iron": 0.1892, + "coal": 0.1225, + "gold": 0.0275, + "amber": 0.0025 }, "13": { - "copper": 1 + "copper": 1.0 + }, + "14": { + "copper": 0.7, + "iron": 0.3 + }, + "15": { + "copper": 0.5832999999999999, + "iron": 0.195, + "amber": 0.1, + "coal": 0.0583, + "aluminium": 0.0333, + "gold": 0.025, + "silver": 0.005 + }, + "16": { + "copper": 0.525, + "iron": 0.1925, + "amber": 0.15, + "coal": 0.0525, + "aluminium": 0.05, + "gold": 0.0225, + "silver": 0.0075 + }, + "17": { + "copper": 0.4667, + "amber": 0.2, + "iron": 0.19, + "aluminium": 0.0667, + "coal": 0.0467, + "gold": 0.02, + "silver": 0.01 + }, + "18": { + "copper": 0.4083, + "amber": 0.25, + "iron": 0.1875, + "aluminium": 0.0833, + "coal": 0.0408, + "gold": 0.0175, + "silver": 0.0125 + }, + "19": { + "copper": 0.35, + "amber": 0.3, + "iron": 0.185, + "aluminium": 0.1, + "coal": 0.035, + "gold": 0.015, + "silver": 0.015 + }, + "20": { + "amber": 0.35, + "copper": 0.2917, + "iron": 0.1825, + "aluminium": 0.1167, + "coal": 0.0292, + "silver": 0.0175, + "gold": 0.0125 + }, + "21": { + "amber": 0.4, + "copper": 0.23329999999999998, + "iron": 0.18, + "aluminium": 0.1333, + "coal": 0.0233, + "silver": 0.02, + "gold": 0.01 + }, + "22": { + "amber": 0.45, + "iron": 0.1775, + "copper": 0.175, + "aluminium": 0.15, + "silver": 0.0225, + "coal": 0.0175, + "gold": 0.0075 + }, + "23": { + "amber": 0.5, + "iron": 0.175, + "aluminium": 0.16670000000000001, + "copper": 0.1167, + "silver": 0.025, + "coal": 0.011699999999999999, + "gold": 0.005 + }, + "24": { + "amber": 0.55, + "aluminium": 0.1833, + "iron": 0.1725, + "copper": 0.0583, + "silver": 0.0275, + "coal": 0.0058, + "gold": 0.0025 + }, + "25": { + "amber": 1.0 + }, + "26": { + "amber": 0.7, + "aluminium": 0.3 + }, + "27": { + "amber": 0.5, + "aluminium": 0.2667, + "iron": 0.1917, + "silver": 0.0417 + }, + "28": { + "amber": 0.45, + "aluminium": 0.3, + "iron": 0.2025, + "silver": 0.0475 + }, + "29": { + "amber": 0.4, + "aluminium": 0.3333, + "iron": 0.2133, + "silver": 0.0533 + }, + "30": { + "aluminium": 0.3667, + "amber": 0.35, + "iron": 0.2242, + "silver": 0.0592 + }, + "31": { + "aluminium": 0.4, + "amber": 0.3, + "iron": 0.235, + "silver": 0.065 + }, + "32": { + "aluminium": 0.43329999999999996, + "amber": 0.25, + "iron": 0.2458, + "silver": 0.0708 + }, + "33": { + "aluminium": 0.4667, + "iron": 0.25670000000000004, + "amber": 0.2, + "silver": 0.0767 + }, + "34": { + "aluminium": 0.5, + "iron": 0.2675, + "amber": 0.15, + "silver": 0.0825 + }, + "35": { + "aluminium": 0.5333, + "iron": 0.2783, + "amber": 0.1, + "silver": 0.0883 + }, + "36": { + "aluminium": 0.5667, + "iron": 0.2892, + "silver": 0.0942, + "amber": 0.05 + }, + "37": { + "aluminium": 1.0 + }, + "38": { + "aluminium": 0.7, + "iron": 0.3 + }, + "39": { + "aluminium": 0.5, + "iron": 0.25, + "silver": 0.1117, + "gold": 0.1, + "emerald": 0.0383 + }, + "40": { + "aluminium": 0.45, + "iron": 0.225, + "gold": 0.15, + "silver": 0.1175, + "emerald": 0.0575 + }, + "41": { + "aluminium": 0.4, + "gold": 0.2, + "iron": 0.2, + "silver": 0.1233, + "emerald": 0.0767 + }, + "42": { + "aluminium": 0.35, + "gold": 0.25, + "iron": 0.175, + "silver": 0.1292, + "emerald": 0.0958 + }, + "43": { + "aluminium": 0.3, + "gold": 0.3, + "iron": 0.15, + "silver": 0.135, + "emerald": 0.115 + }, + "44": { + "gold": 0.35, + "aluminium": 0.25, + "silver": 0.1408, + "emerald": 0.13419999999999999, + "iron": 0.125 + }, + "45": { + "gold": 0.4, + "aluminium": 0.2, + "emerald": 0.1533, + "silver": 0.1467, + "iron": 0.1 + }, + "46": { + "gold": 0.45, + "emerald": 0.1725, + "silver": 0.1525, + "aluminium": 0.15, + "iron": 0.075 + }, + "47": { + "gold": 0.5, + "emerald": 0.1917, + "silver": 0.1583, + "aluminium": 0.1, + "iron": 0.05 + }, + "48": { + "gold": 0.55, + "emerald": 0.2108, + "silver": 0.1642, + "aluminium": 0.05, + "iron": 0.025 + }, + "49": { + "gold": 1.0 + }, + "50": { + "gold": 0.7, + "emerald": 0.3 + }, + "51": { + "gold": 0.5, + "emerald": 0.2583, + "silver": 0.1417, + "ruby": 0.05, + "diamond": 0.0333, + "topaz": 0.0167 + }, + "52": { + "gold": 0.45, + "emerald": 0.2725, + "silver": 0.1275, + "ruby": 0.075, + "diamond": 0.05, + "topaz": 0.025 + }, + "53": { + "gold": 0.4, + "emerald": 0.2867, + "silver": 0.1133, + "ruby": 0.1, + "diamond": 0.0667, + "topaz": 0.0333 + }, + "54": { + "gold": 0.35, + "emerald": 0.30079999999999996, + "ruby": 0.125, + "silver": 0.0992, + "diamond": 0.0833, + "topaz": 0.0417 + }, + "55": { + "emerald": 0.315, + "gold": 0.3, + "ruby": 0.15, + "diamond": 0.1, + "silver": 0.085, + "topaz": 0.05 + }, + "57": { + "emerald": 0.3433, + "ruby": 0.2, + "gold": 0.2, + "diamond": 0.1333, + "topaz": 0.0667, + "silver": 0.0567 + }, + "58": { + "emerald": 0.3575, + "ruby": 0.225, + "gold": 0.15, + "diamond": 0.15, + "topaz": 0.075, + "silver": 0.0425 + }, + "60": { + "emerald": 0.3858, + "ruby": 0.275, + "diamond": 0.1833, + "topaz": 0.0917, + "gold": 0.05, + "silver": 0.014199999999999999 + }, + "61": { + "emerald": 1.0 + }, + "62": { + "emerald": 0.7, + "ruby": 0.3 + }, + "65": { + "ruby": 0.3333, + "emerald": 0.2667, + "topaz": 0.16670000000000001, + "diamond": 0.1333, + "sapphire": 0.0667, + "amethyst": 0.0333 + }, + "66": { + "ruby": 0.3417, + "emerald": 0.23329999999999998, + "topaz": 0.1833, + "diamond": 0.1167, + "sapphire": 0.0833, + "amethyst": 0.0417 + }, + "67": { + "ruby": 0.35, + "emerald": 0.2, + "topaz": 0.2, + "diamond": 0.1, + "sapphire": 0.1, + "amethyst": 0.05 + }, + "68": { + "ruby": 0.3583, + "topaz": 0.2167, + "emerald": 0.16670000000000001, + "sapphire": 0.1167, + "diamond": 0.0833, + "amethyst": 0.0583 + }, + "70": { + "ruby": 0.375, + "topaz": 0.25, + "sapphire": 0.15, + "emerald": 0.1, + "amethyst": 0.075, + "diamond": 0.05 + }, + "71": { + "ruby": 0.3833, + "topaz": 0.2667, + "sapphire": 0.16670000000000001, + "amethyst": 0.0833, + "emerald": 0.0667, + "diamond": 0.0333 + }, + "72": { + "ruby": 0.3917, + "topaz": 0.2833, + "sapphire": 0.1833, + "amethyst": 0.0917, + "emerald": 0.0333, + "diamond": 0.0167 + }, + "73": { + "ruby": 1.0 + }, + "74": { + "ruby": 0.7, + "topaz": 0.3 + }, + "75": { + "ruby": 0.3333, + "topaz": 0.25, + "sapphire": 0.16670000000000001, + "amethyst": 0.15, + "alexandrite": 0.045 + }, + "81": { + "amethyst": 0.3, + "alexandrite": 0.18 + }, + "83": { + "amethyst": 0.35, + "alexandrite": 0.225 + }, + "84": { + "amethyst": 0.375, + "alexandrite": 0.2475 + }, + "85": { + "amethyst": 1.0 + }, + "86": { + "amethyst": 0.7, + "alexandrite": 0.3 + }, + "87": { + "amethyst": 0.3333, + "alexandrite": 0.225 + }, + "88": { + "amethyst": 0.3, + "alexandrite": 0.2025 + }, + "89": { + "amethyst": 0.2667, + "obsidian": 0.2, + "alexandrite": 0.18 + }, + "90": { + "obsidian": 0.25, + "amethyst": 0.23329999999999998 + }, + "91": { + "obsidian": 0.3, + "amethyst": 0.2 + }, + "92": { + "obsidian": 0.35, + "amethyst": 0.16670000000000001 + }, + "93": { + "obsidian": 0.4, + "amethyst": 0.1333 + }, + "94": { + "obsidian": 0.45 + }, + "95": { + "obsidian": 0.5, + "diamond": 0.125 + }, + "96": { + "obsidian": 0.55, + "diamond": 0.1375, + "sapphire": 0.11 + }, + "97": { + "obsidian": 1.0 + }, + "98": { + "obsidian": 0.7, + "diamond": 0.3 + }, + "99": { + "obsidian": 0.5, + "diamond": 0.125, + "iron": 0.11, + "sapphire": 0.1 + }, + "100": { + "obsidian": 0.45, + "iron": 0.165, + "diamond": 0.1125, + "sapphire": 0.09 + }, + "101": { + "obsidian": 0.4, + "iron": 0.22, + "diamond": 0.1, + "sapphire": 0.08 + }, + "102": { + "obsidian": 0.35, + "iron": 0.275, + "diamond": 0.0875, + "coal": 0.0833, + "sapphire": 0.07 + }, + "103": { + "iron": 0.33, + "obsidian": 0.3, + "coal": 0.1, + "diamond": 0.075, + "silver": 0.06, + "sapphire": 0.06 + }, + "104": { + "iron": 0.385, + "obsidian": 0.25, + "coal": 0.1167, + "silver": 0.07, + "diamond": 0.0625, + "sapphire": 0.05 + }, + "105": { + "iron": 0.44, + "obsidian": 0.2, + "coal": 0.1333, + "silver": 0.08, + "diamond": 0.05, + "sapphire": 0.04 + }, + "106": { + "iron": 0.495, + "obsidian": 0.15, + "coal": 0.15, + "silver": 0.09, + "diamond": 0.0375, + "sapphire": 0.03 + }, + "107": { + "iron": 0.55, + "coal": 0.16670000000000001, + "obsidian": 0.1, + "silver": 0.1, + "diamond": 0.025, + "sapphire": 0.02 + }, + "108": { + "iron": 0.605, + "coal": 0.1833, + "silver": 0.11, + "obsidian": 0.05 + }, + "109": { + "iron": 0.66, + "coal": 0.2, + "silver": 0.12 + }, + "110": { + "iron": 0.655, + "coal": 0.1833, + "silver": 0.11 + }, + "111": { + "iron": 0.65, + "coal": 0.16670000000000001, + "silver": 0.1 + }, + "112": { + "iron": 0.645, + "coal": 0.15, + "silver": 0.09 + }, + "113": { + "iron": 0.64, + "coal": 0.1333, + "silver": 0.08 + }, + "114": { + "iron": 0.635, + "coal": 0.1167, + "gold": 0.0833 + }, + "115": { + "iron": 0.63, + "coal": 0.1, + "gold": 0.1 + }, + "116": { + "iron": 0.625, + "gold": 0.1167 + }, + "117": { + "iron": 0.62, + "gold": 0.1333 + }, + "118": { + "iron": 0.615, + "gold": 0.15 + }, + "119": { + "iron": 1.0 + }, + "120": { + "iron": 0.5, + "coal": 0.5 + }, + "0": { + "coal": 0, + "copper": 0, + "iron": 0, + "amber": 0, + "gold": 0, + "aluminium": 0, + "silver": 0, + "emerald": 0, + "ruby": 0, + "diamond": 0, + "topaz": 0, + "sapphire": 0, + "amethyst": 0, + "alexandrite": 0, + "obsidian": 0 } } \ No newline at end of file diff --git a/modules/deeptownOptimizer/optimizer.py b/modules/deeptownOptimizer/optimizer.py index b0df433..eed373c 100644 --- a/modules/deeptownOptimizer/optimizer.py +++ b/modules/deeptownOptimizer/optimizer.py @@ -31,34 +31,38 @@ class Optimizer(): def to_make(self, item, quantity=1): if item not in self.items.keys(): raise ValueError("{item} is not a correct item.".format(item=item)) - number_of_craft = int(quantity / self.items[item]["quantity"]) + if self.items[item]["quantity"] != 0: + number_of_craft = int(quantity / self.items[item]["quantity"]) + else: + number_of_craft = int(quantity) if number_of_craft % 1 != 0: number_of_craft = int((number_of_craft // 1) + 1) time = self.items[item]["time"] * number_of_craft value = self.items[item]["value"] * number_of_craft * self.items[item]["quantity"] needed = {} - for resource, quantity in self.items[item]["required"].items(): + for resource, quantity in self.items[item]["needed"].items(): needed.update({resource: quantity * number_of_craft}) return {"time": time, "value": value, "needed": needed} def recursive_to_make(self, item, quantity=1): if item in self.items.keys(): needed = self.to_make(item, quantity) - results = [(item, quantity, needed["time"])] + results = [(self.items[item]["type"], item, quantity, needed["time"])] for needed_item, needed_quantity in needed["needed"].items(): needed_result = self.recursive_to_make(needed_item, needed_quantity) already_crafted = [result[0] for result in results] index = 0 - for i, q, t in needed_result: + for item_type, i, q, t in needed_result: if i in already_crafted: results[already_crafted.index(i)] = ( results[already_crafted.index(i)][0], - results[already_crafted.index(i)][1] + q, - results[already_crafted.index(i)][2] + t + results[already_crafted.index(i)][1], + results[already_crafted.index(i)][2] + q, + results[already_crafted.index(i)][3] + t ) else: - results.append((i, q, t)) + results.append((item_type, i, q, t)) index += 1 return results else: - return [(item, quantity, 0)] + return [(self.items[item]["type"], item, quantity, 0)] diff --git a/modules/deeptownOptimizer/update_data.py b/modules/deeptownOptimizer/update_data.py index b26bc6d..bb9aa5c 100644 --- a/modules/deeptownOptimizer/update_data.py +++ b/modules/deeptownOptimizer/update_data.py @@ -1,27 +1,15 @@ +import json import os -import random - -from fs.ftpfs import FTPFS from fs.osfs import OSFS -from fs import path import re import requests -import bs4 fileSystem = None -if os.environ.get("FTP_ADDRESS", False) and os.environ.get("FTP_USER", False) and os.environ.get("FTP_PASS", False): - print("FTP") - fileSystem = FTPFS(os.environ["FTP_ADDRESS"], user=os.environ["FTP_USER"], passwd=os.environ["FTP_PASS"], - timeout=600) -else: - print("OS") - fileSystem = OSFS(os.getcwd()) - def format_string(text): text = text.replace(" ", "").replace("-", "").replace("_", "").lower() - return text + return str(text) def get_all_item_urls(): @@ -41,6 +29,7 @@ def get_item_info(url): "building": None, "value": None, "quantity": 0, + "time": 0, "needed": {}} page = requests.get(url) texte = str(page.content).replace(" ", "").replace("\n", "").replace(r"\n", "") @@ -72,7 +61,7 @@ def get_item_info(url): r"yload\"/>\w*[0-9]*([0-9]|,)*([0-9]+|Seconds?|Minutes?|" r"Hours?)+[0-9]+") needed_regex = re.compile(r"(\w+(
)?)+") + r"ata-src=\"/images/ui/([a-zA-Z]|-|\.)+\"alt=\"\w*\"class=\"\w*\"/>(\w|,)+
)+") type_iter = type_regex.finditer(str(texte)) value_iter = value_regex.finditer(str(texte)) @@ -121,7 +110,7 @@ def get_item_info(url): time += int(number) * 60 elif unit == "Hour": time += int(number) * 60 * 60 - print(time) + result['time'] = int(time) result["quantity"] = int(str(re.sub("\w*iscrea" @@ -136,12 +125,15 @@ def get_item_info(url): "", quantity_iter.__next__().group(0)))) needed_text = re.sub(r"", "", needed_iter.__next__().group(0)) + item_name_iter = re.finditer(r"[A-Za-z]+[0-9]+", str(needed_text)) + item_quantity_iter = re.finditer(r"class=\"\w*\"/>[A-Za-z]+([0-9]|,)+", str(needed_text)) for item_name_match, item_quantity_match in zip(item_name_iter, item_quantity_iter): item_name = re.sub(r"[A-Za-z]+", "", item_quantity_match.group(0))) + item_quantity = int( + re.sub(r"class=\"\w*\"/>[A-Za-z]+", "", item_quantity_match.group(0)).replace(",", "").replace( + ".", "")) result["needed"].update({format_string(item_name): item_quantity}) @@ -150,23 +142,62 @@ def get_item_info(url): return result + def get_sector_info(): - page = requests.get("https://deeptownguide.com/Items") + page = requests.get("https://deeptownguide.com/Areas/Resources") + texte = str(page.content).replace(" ", "").replace("\n", "").replace(r"\n", "") + line_regex = re.compile(r"[0-9]+((
\w*
([0-9]|\.|%)+| ))+") num_regex = re.compile(r"[0-9]+") + item_regex = re.compile(r"(
\w*
([0-9]|\.|%)+| )" + r"") + item_name_regex = re.compile(r"(([0-9]|\.)+") + + line_iter = line_regex.finditer(texte) + + etages = {} + liste_items = [] + for line in line_iter: + etage_iter = num_regex.finditer(line.group(0)) + etage = int(re.sub(r"", "", etage_iter.__next__().group(0))) + item_iter = item_regex.finditer(line.group(0)) + items = {} + for item in item_iter: + name_iter = item_name_regex.finditer(item.group(0)) + name = str(re.sub(r"(", "", quantity_iter.__next__().group(0))) / 100 + items.update({name: quantity}) + if name not in liste_items: + liste_items.append(name) + etages.update({str(etage): items}) + etages.update({"0": {name: 0 for name in liste_items}}) + return etages - -def update_data(file_system): +def update_data(): items = {} urls_item = get_all_item_urls() + print(len(urls_item)) + a = 0 for item_url in urls_item: + a += 1 items.update({ - format_string(re.sub("https://deeptownguide.com/Items/Details/[0-9]+/", "", item_url)): get_item_info( - item_url) + str(format_string(re.sub("https://deeptownguide.com/Items/Details/[0-9]+/", "", item_url))): + get_item_info(item_url) }) + print(a * 100 / len(urls_item), "%") + with open('items.json', "w") as dest_file: + json.dump(items, dest_file) + with open('mines.json', "w") as dest_file: + json.dump(get_sector_info(), dest_file) return None - if __name__ == "__main__": + print(get_item_info('https://deeptownguide.com/Items/Details/702/stage-ii')) update_data() diff --git a/traductions.py b/traductions.py index 550f1d8..a5168c7 100644 --- a/traductions.py +++ b/traductions.py @@ -116,7 +116,13 @@ tr = { ("`{prefix}to_make_recursive copperNail 100`", "Donne les resources pour faire 100 copperNail, càd 10 copperBar et 50 copper."), ], - + }, + "reload_optimizer": { + "description": "Recharge les quantités deressources nécessaires, réservé aux admins", + "example": [ + ("`{prefix}reload_optimizer`", "Recharge les quantités de ressources nécessaires pour faire " + "les différents items.") + ] } }, "best_place_mine": "Voici les meilleurs emplacements pour le minerais {ore}\n```\n", @@ -124,7 +130,7 @@ tr = { "de la production est {value}.", "recursive_to_make": { "header": "Pour faire {quantity} {item} il vous faudra:\n```", - "line": "{item:20} | {quantity} | {time}" + "line": "{item:20} | {quantity:8} | {time}" }, }, "help": {