From c8b4aaa7439f4ae626410139c0d9c95704320aa8 Mon Sep 17 00:00:00 2001 From: Schemen Date: Wed, 27 Jan 2021 03:54:31 +0100 Subject: [PATCH] Oh Boy... --- .gitignore | 1 + .vscode/launch.json | 16 + README.md | 7 + data copy.json | 783 +++++++++++++++++++++++++++++++++++++++++++ dsp_calc.py | 103 ++++++ old_data.json | 793 ++++++++++++++++++++++++++++++++++++++++++++ output.json | 248 ++++++++++++++ requirements.txt | 1 + 8 files changed, 1952 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/launch.json create mode 100644 README.md create mode 100644 data copy.json create mode 100755 dsp_calc.py create mode 100644 old_data.json create mode 100644 output.json create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ceb386 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..87ba064 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "args": ["tree", "hydrogen"] + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..bcc5c7c --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +```x-sh +git clone ssh://git@git.ponz.io:10022/elia/dsp-calc.git && cd dsp-calc +virtualenv venv -p python3 +source venv/bin/activate +pip install -r requirements.txt +deactivate +``` diff --git a/data copy.json b/data copy.json new file mode 100644 index 0000000..f0fe7f4 --- /dev/null +++ b/data copy.json @@ -0,0 +1,783 @@ +{ +"components": { + "crude_oil":{ + "produced_with": "oil_extractor", + "requires": {} + }, + "iron_ore":{ + "produced_with": "mining_machine", + "requires": {} + }, + "water":{ + "produced_with": "water_pump", + "requires": {} + }, + "fire_ice":{ + "produced_with": "orbital_harvester", + "requires": {} + }, + "stone_ore":{ + "produced_with": "mining_machine", + "requires": {} + }, + "coal_ore":{ + "produced_with": "mining_machine", + "requires": {} + }, + "iron_ingot": { + "requires": { + "iron_ore": 1 + }, + "produced_with": "smelter", + "ppm": 60 + }, + "magnet": { + "requires": { + "iron_ore": 1 + }, + "produced_with": "smelter", + "ppm": 40 + }, + "gear": { + "requires": { + "iron_ingot": 1 + }, + "produced_with": "assembler", + "ppm": 60 + }, + "steel": { + "requires": { + "iron_ingot": 3 + }, + "produced_with": "smelter", + "ppm": 20 + }, + "plasma_exciter": { + "requires": { + "magnetic_coil": 4, + "prism": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "photon_combiner": { + "recipes": [ + { + "requires":{ + "prism": 2, + "circuit_board": 1 + }, + "ppm": 20, + "produced_with": "assembler" + }, + { + "requires":{ + "optical_grating_crystal": 1, + "circuit_board": 1 + }, + "ppm": 20, + "produced_with": "assembler", + "advanced": true + } + ]}, + "electromagnetic_matrix": { + "requires": { + "magnetic_coil": 1, + "circuit_board": 1 + }, + "produced_with": "matrix_lab", + "ppm": 20 + }, + "copper_ore":{ + "produced_with": "mining_machine", + "requires": {} + }, + "copper_ingot": { + "requires": { + "copper_ore": 1 + }, + "produced_with": "smelter", + "ppm": 60 + }, + "magnetic_coil": { + "requires": { + "copper_ingot": 1, + "magnet": 2 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "electric_motor": { + "requires": { + "magnetic_coil": 1, + "gear": 1, + "iron_ingot": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "electromagnetic_turbine": { + "requires": { + "magnetic_coil": 2, + "electric_motor": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "super-magnetic_ring": { + "requires": { + "electromagnetic_turbine": 2, + "magnet": 3, + "energetic_graphite": 1 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "energy_matrix": { + "requires": { + "hydrogen": 2, + "energetic_graphite": 2 + }, + "produced_with": "matrix_lab", + "ppm": 10 + }, + "high-purity_silicon": { + "requires": { + "silicon_ore": 2 + }, + "produced_with": "smelter", + "ppm": 30 + }, + "crystal_silicon": { + "recipes": [ + { + "requires":{ + "purity_silicon": 1 + }, + "ppm": 30, + "produced_with": "smelter" + }, + { + "requires":{ + "fractal_silicon": 1 + }, + "ppm": 15, + "produced_with": "smelter" + } + ]}, + "silicon_ore": { + "requires": { + "stone_ore": 10 + }, + "produced_with": "smelter", + "ppm": 0.6 + }, + "microcrystalline_comonent": { + "requires": { + "high-purity_silicon": 12, + "copper_ingot": 1 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "structure_matrix": { + "requires": { + "titanium_crystal": 1, + "diamond": 1 + }, + "produced_with": "matrix_lab", + "ppm": 7.5 + }, + "titanium_ingot": { + "requires": { + "titanium_ore": 2 + }, + "produced_with": "smelter", + "ppm": 30 + }, + "titanium_ore": { + "produced_with": "mining_machine", + "requires": {} + }, + "titanium_alloy": { + "requires": { + "titanium_ore": 4, + "steel": 4, + "sulfuric_acid": 8 + }, + "produced_with": "smelter", + "ppm": 5, + "amount": 4 + }, + "circuit_board": { + "requires": { + "iron_ingot": 2, + "copper_ingot": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "processor": { + "requires": { + "circuit_board": 2, + "microcrystalline_comonent": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "stone": { + "requires": { + "stone_ore": 1 + }, + "produced_with": "smelter", + "ppm": 60 + }, + "glass": { + "requires": { + "stone_ore": 2 + }, + "produced_with": "smelter", + "ppm": 30 + }, + "prism": { + "requires": { + "glass": 3 + }, + "produced_with": "assembler", + "ppm": 30, + "amount": 2 + }, + "energetic_graphite": { + "recipes": [ + { + "requires":{ + "coal_ore": 2 + }, + "ppm": 30, + "produced_with": "smelter" + }, + { + "requires":{ + "refined_oil": 1, + "hydrogen": 2 + }, + "ppm": 15, + "produced_with": "oil_refinery", + "recipe_name": "X-Ray Cracking" + } + ]}, + "diamond": { + "recipes": [ + { + "requires":{ + "energetic_graphite": 1 + }, + "ppm": 30, + "produced_with": "smelter" + }, + { + "requires":{ + "kimberlite_ore": 1 + }, + "ppm": 30, + "produced_with": "smelter", + "advanced": true + } + ]}, + "sulfuric_acid": { + "requires": { + "water": 4, + "stone_ore": 8, + "refined_oil": 6 + }, + "produced_with": "chemical_plant", + "ppm": 10, + "amount": 4 + }, + "particle_container": { + "recipes": [ + { + "requires":{ + "electromagnetic_turbine": 2, + "copper_ingot": 2, + "graphene": 2 + }, + "ppm": 15, + "produced_with": "assembler" + }, + { + "requires":{ + "copper_ingot": 2, + "unipolar_magnet": 10 + }, + "ppm": 15, + "produced_with": "assembler", + "advanced": true + } + ]}, + "hydrogen": { + "recipes": [ + { + "requires":{ + "crude_oil": 2 + }, + "ppm": 15, + "produced_with": "oil_refinery", + "recipe_name": "Plasma Refining" + }, + { + "requires":{ + "fire_ice": 2 + }, + "ppm": 30, + "produced_with": "chemical_plant", + "advanced": true + } + ]}, + "refined_oil": { + "requires":{ + "crude_oil": 2 + }, + "ppm": 15, + "produced_with": "oil_refinery", + "recipe_name": "Plasma Refining", + "amount": 2 + }, + "deuterium": { + "recipes": [ + { + "requires":{ + "hydrogen": 10 + }, + "ppm": 12, + "produced_with": "particle_colider" + }, + { + "requires":{ + "hydrogen": 1 + }, + "produced_with": "fractionator" + } + ]}, + "plastic": { + "requires": { + "refined_oil": 2, + "energetic_graphite": 1 + }, + "produced_with": "chemical_plant", + "ppm": 20 + }, + "organic_crystal": { + "recipes": [ + { + "requires":{ + "water": 1, + "refined_oil": 1, + "plastic": 2 + }, + "ppm": 10, + "produced_with": "chemical_plant" + }, + { + "requires":{ + "plant_fuel": 30, + "water": 10, + "log": 20 + }, + "ppm": 10, + "produced_with": "chemical_plant", + "original": true + } + ]}, + "graphene": { + "recipes": [ + { + "requires":{ + "energetic_graphite": 3, + "sulfuric_acid": 1 + }, + "ppm": 20, + "amount": 2, + "produced_with": "chemical_plant" + }, + { + "requires":{ + "fire_ice": 2 + }, + "ppm": 30, + "produced_with": "chemical_plant", + "advanced": true, + "amount": 2 + } + ]}, + "titanium_crystal": { + "requires": { + "titanium_ingot": 3, + "organic_crystal": 1 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "hydrogen_fuel_rod": { + "requires": { + "titanium_ingot": 1, + "hydrogen": 5 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "thruster": { + "requires": { + "steel": 2, + "copper_ingot": 3 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "logistics_drone": { + "requires": { + "iron_ingot": 5, + "processor": 2, + "thruster": 2 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "solar_sail": { + "requires": { + "graphene": 1, + "photon_combiner": 1 + }, + "produced_with": "assembler", + "ppm": 15, + "amount": 2 + }, + "deuteron_fuel_rod": { + "requires": { + "deuterium": 10, + "titanium_alloy": 1, + "super-magnetic_ring": 1 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "reinforced_thruster": { + "requires": { + "titanium_alloy": 5, + "electromagnetic_turbine": 5 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "logistics_vessel": { + "requires": { + "titanium_alloy": 10, + "reinforced_thruster": 5, + "processor": 10 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "foundation": { + "requires": { + "steel": 1, + "stone": 3 + }, + "produced_with": "assembler", + "ppm": 60 + } + }, +"buildings":{ + "tesla_tower": { + "requires": { + "iron_ingot": 2, + "magnetic_coil": 1 + }, + "produced_with": "assembler", + "ppm": 60 + }, + "wireless_power_tower": { + "requires": { + "tesla_tower": 1, + "plasma_exciter": 3 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "wind_turbine": { + "requires": { + "iron_ingot": 6, + "gear": 1, + "magnetic_coil": 3 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "thermal_power_station": { + "requires": { + "iron_ingot": 10, + "stone": 4, + "magnetic_coil": 4, + "gear": 4 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "solar_panel": { + "requires": { + "copper_ingot": 6, + "high-purity_silicon": 6, + "circuit_board": 4 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "accumulator": { + "requires": { + "iron_ingot": 6, + "super-magnetic_ring": 6, + "crystal_silicon": 4 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "ray_receiver": { + "requires": { + "steel": 20, + "super-magnetic_ring": 20, + "high-purity_silicon": 20, + "photon_combiner": 10, + "processor": 5 + }, + "produced_with": "assembler", + "ppm": 7.5 + }, + "mini_fusion_power_station": { + "requires": { + "titanium_alloy": 12, + "super-magnetic_ring": 10, + "carbon_nanotubes": 8, + "processor": 4 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "converyor_belt_mk1": { + "requires": { + "iron_ingot": 2, + "gear": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 3 + }, + "converyor_belt_mk2": { + "requires": { + "converyor_belt_mk1": 3, + "electromagnetic_turbine": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 3 + }, + "converyor_belt_mk3": { + "requires": { + "converyor_belt_mk2": 3, + "super-magnetic_ring": 1, + "graphene": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 3 + }, + "splitter": { + "requires": { + "iron_ingot": 3, + "gear": 2, + "circuit_board": 1 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "storage_mk1": { + "requires": { + "iron_ingot": 4, + "stone": 4 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "storage_mk2": { + "requires": { + "steel": 8, + "stone": 8 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "storage_tank": { + "requires": { + "iron_ingot": 8, + "stone": 4, + "glass": 4 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "em-rail_ejector": { + "requires": { + "steel": 20, + "gear": 20, + "processor": 5, + "super-magnetic_ring": 10 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "planetary_logistics_station": { + "requires": { + "steel": 40, + "titanium_ingot": 40, + "processor": 40, + "particle_container": 20 + }, + "produced_with": "assembler", + "ppm": 3 + }, + "sorter_mk1": { + "requires": { + "iron_ingot": 1, + "circuit_board": 1 + }, + "produced_with": "assembler", + "ppm": 60 + }, + "sorter_mk2": { + "requires": { + "sorter_mk1": 2, + "electric_motor": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "sorter_mk3": { + "requires": { + "sorter_mk2": 2, + "electromagnetic_turbine": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "mining_machine": { + "requires": { + "iron_ingot": 4, + "magnetic_coil": 2, + "gear": 2, + "circuit_board": 2 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "water_pump": { + "requires": { + "iron_ingot": 8, + "stone": 4, + "electric_motor": 4, + "circuit_board": 2 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "oil_extractor": { + "requires": { + "steel": 12, + "stone": 12, + "plasma_exciter": 4, + "circuit_board": 6 + }, + "produced_with": "assembler", + "ppm": 7.5 + }, + "oil_refinery": { + "requires": { + "steel": 10, + "stone": 10, + "plasma_exciter": 6, + "circuit_board": 6 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "interstellar_logistics_Station": { + "requires": { + "planetary_logistics_station": 1, + "titanium_alloy": 40, + "particle_container": 20 + }, + "produced_with": "assembler", + "ppm": 2 + }, + "assembling_machine_mk1": { + "requires": { + "iron_ingot": 4, + "gear": 8, + "circuit_board": 4 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "assembling_machine_mk2": { + "requires": { + "assembling_machine_mk1": 1, + "graphene": 8, + "processor": 4 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "smelter": { + "requires": { + "iron_ingot": 4, + "stone": 2, + "circuit_board": 4, + "magnetic_coil": 2 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "fractionator": { + "requires": { + "steel": 8, + "stone": 4, + "glass": 4, + "processor": 1 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "chemical_plant": { + "requires": { + "steel": 8, + "stone": 8, + "glass": 8, + "circuit_board": 2 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "matrix_lab": { + "requires": { + "iron_ingot": 8, + "magnetic_coil": 4, + "glass": 4, + "circuit_board": 4 + }, + "produced_with": "assembler", + "ppm": 20 + } + } +} \ No newline at end of file diff --git a/dsp_calc.py b/dsp_calc.py new file mode 100755 index 0000000..3841021 --- /dev/null +++ b/dsp_calc.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +import click +import json +import pprint + + +with open('data copy.json', 'r') as DATA_JSON: + data=DATA_JSON.read() + +try: + dsp_data = json.loads(data) +except ValueError as e: + click.echo("Error: %s"% e) + + + +@click.group() +def cli(): + pass + +@cli.command() +def verify(): + """verify your data.json""" + try: + dsp_data = json.loads(data) + except ValueError as e: + click.echo("Error: %s"% e) + else: + click.echo("Your data seems to be good.") + +@cli.command() +@click.argument('item') +def tree(item): + """ + Show the requirement tree of an item. + + Pass the item down lowercase, space replaced with a "_" underscore and MKII and mk3. + + Example: + $dsp_calc tree sorter_mk3 + + """ + click.echo(json.dumps(get_required(item), indent=4)) + + + +def get_required(item_name): + print("Item_name: "+ item_name) + dsp_data_combined = get_combined_data(dsp_data) + required_items = {} + item = dsp_data_combined[item_name] + print("item: " + str(item)) + + if not item.get("requires") and not item.get("recipes"): + print("this is and enditem 1") + return {} + + if item.get("recipes"): + print(item["recipes"]) + for i in item["recipes"]: + if not item.get("requires") and not item.get("recipes"): + print("this is and enditem 2") + return {} + + for req_name in i["requires"].items(): + sub_req_name = req_name[0] + sub_req = get_required(sub_req_name) + required_items[sub_req_name] = {**dsp_data_combined[sub_req_name], "recipes": [ sub_req ] } + + for req_name, amount in item["requires"].items(): + sub_req = get_required(req_name) + required_items[req_name] = {**dsp_data_combined[req_name], "amount": amount, "requires": sub_req} + return required_items + +def get_item_requirements(item): + item["children"] = {} + return item.get("requires") + + +def get_combined_data(data): + combined = data["components"] + combined.update(data["buildings"]) + return combined + + +def get_item_type(item): + if dsp_data["components"].get(item): + return "components" + elif dsp_data["buildings"].get(item): + return "buildings" + else: + click.echo("Item %s not found!" % item) + +def get_item(item): + if dsp_data["components"].get(item): + return dsp_data["components"].get(item) + elif dsp_data["buildings"].get(item): + return dsp_data["buildings"].get(item) + else: + click.echo("Item %s not found!" % item) + +if __name__ == '__main__': + cli() diff --git a/old_data.json b/old_data.json new file mode 100644 index 0000000..8f2b1be --- /dev/null +++ b/old_data.json @@ -0,0 +1,793 @@ +{ +"components": { + "crude_oil":{ + "produced_with": "oil_extractor", + "is_source": true + }, + "iron_ore":{ + "produced_with": "mining_machine", + "is_source": true + }, + "fire_ice":{ + "produced_with": "orbital_harvester", + "is_source": true + }, + "stone_ore":{ + "produced_with": "mining_machine", + "is_source": true + }, + "titanium_ingot":{ + "produced_with": "mining_machine", + "is_source": true + }, + "coal_ore":{ + "produced_with": "mining_machine", + "is_source": true + }, + "iron_ingot": { + "requires": { + "iron_ore": 1 + }, + "produced_with": "smelter", + "ppm": 60 + }, + "magnet": { + "requires": { + "iron_ore": 1 + }, + "produced_with": "smelter", + "ppm": 40 + }, + "gear": { + "requires": { + "iron_ingot": 1 + }, + "produced_with": "assembler", + "ppm": 60 + }, + "steel": { + "requires": { + "iron_ingot": 3 + }, + "produced_with": "smelter", + "ppm": 20 + }, + "plasma_exciter": { + "requires": { + "magnetic_coil": 4, + "prism": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "photon_combiner": { + "recipes": [ + { + "requires":{ + "prism": 2, + "circuit_board": 1 + }, + "ppm": 20, + "produced_with": "assembler" + }, + { + "requires":{ + "optical_grating_crystal": 1, + "circuit_board": 1 + }, + "ppm": 20, + "produced_with": "assembler", + "advanced": true + } + ]}, + "electromagnetic_matrix": { + "requires": { + "magnetic_coil": 1, + "circuit_board": 1 + }, + "produced_with": "matrix_lab", + "ppm": 20 + }, + "copper_ore":{ + "produced_with": "mining_machine", + "is_source": true + }, + "copper_ingot": { + "requires": { + "copper_ore": 1 + }, + "produced_with": "smelter", + "ppm": 60 + }, + "magnetic_coil": { + "requires": { + "copper_ingot": 1, + "magnet": 2 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "electric_motor": { + "requires": { + "magnetic_coil": 1, + "gear": 1, + "iron_ingot": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "electromagnetic_turbine": { + "requires": { + "magnetic_coil": 2, + "electric_motor": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "super-magnetic_ring": { + "requires": { + "electromagnetic_turbine": 2, + "magnet": 3, + "energetic_graphite": 1 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "energy_matrix": { + "requires": { + "hydrogen": 2, + "energetic_graphite": 2 + }, + "produced_with": "matrix_lab", + "ppm": 10 + }, + "high-purity_silicon": { + "requires": { + "silicon_ore": 2 + }, + "produced_with": "smelter", + "ppm": 30 + }, + "crystal_silicon": { + "recipes": [ + { + "requires":{ + "purity_silicon": 1 + }, + "ppm": 30, + "produced_with": "smelter" + }, + { + "requires":{ + "fractal_silicon": 1 + }, + "ppm": 15, + "produced_with": "smelter" + } + ]}, + "silicon_ore": { + "requires": { + "stone_ore": 10 + }, + "produced_with": "smelter", + "ppm": 0.6 + }, + "microcrystalline_comonent": { + "requires": { + "high-purity_silicon": 12, + "copper_ingot": 1 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "structure_matrix": { + "requires": { + "titanium_crystal": 1, + "diamond": 1 + }, + "produced_with": "matrix_lab", + "ppm": 7.5 + }, + "titanium_ignot": { + "requires": { + "titanium_ore": 2 + }, + "produced_with": "smelter", + "ppm": 30 + }, + "titanium_ore": { + "produced_with": "mining_machine", + "is_source": true + }, + "titanium_alloy": { + "requires": { + "titanium_ore": 4, + "steel": 4, + "sulfuric_acid": 8 + }, + "produced_with": "smelter", + "ppm": 5, + "amount": 4 + }, + "circuit_board": { + "requires": { + "iron_ingot": 2, + "copper_ingot": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "processor": { + "requires": { + "circuit_board": 2, + "microcrystalline_comonent": 2 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "stone": { + "requires": { + "stone_ore": 1 + }, + "produced_with": "smelter", + "ppm": 60 + }, + "glass": { + "requires": { + "stone_ore": 2 + }, + "produced_with": "smelter", + "ppm": 30 + }, + "prism": { + "requires": { + "glass": 3 + }, + "produced_with": "assembler", + "ppm": 30, + "amount": 2 + }, + "energetic_graphite": { + "recipes": [ + { + "requires":{ + "coal_ore": 2 + }, + "ppm": 30, + "produced_with": "smelter" + }, + { + "requires":{ + "refined_oil": 1, + "hydrogen": 2 + }, + "ppm": 15, + "produced_with": "oil_refinery", + "recipe_name": "X-Ray Cracking" + } + ]}, + "diamond": { + "recipes": [ + { + "requires":{ + "energetic_graphite": 1 + }, + "ppm": 30, + "produced_with": "smelter" + }, + { + "requires":{ + "kimberlite_ore": 1 + }, + "ppm": 30, + "produced_with": "smelter", + "advanced": true + } + ]}, + "sulfuric_acid": { + "requires": { + "water": 4, + "stone_ore": 8, + "refined_oil": 6 + }, + "produced_with": "chemical_plant", + "ppm": 10, + "amount": 4 + }, + "particle_container": { + "recipes": [ + { + "requires":{ + "electromagnetic_turbine": 2, + "copper_ingot": 2, + "graphene": 2 + }, + "ppm": 15, + "produced_with": "assembler" + }, + { + "requires":{ + "copper_ingot": 2, + "unipolar_magnet": 10 + }, + "ppm": 15, + "produced_with": "assembler", + "advanced": true + } + ]}, + "hydrogen": { + "recipes": [ + { + "requires":{ + "crude_oil": 2 + }, + "ppm": 15, + "produced_with": "oil_refinery", + "recipe_name": "Plasma Refining" + }, + { + "requires":{ + "refined_oil": 1, + "hydrogen": 2 + }, + "ppm": 15, + "produced_with": "oil_refinery", + "recipe_name": "X-Ray Cracking", + "amount": 3 + }, + { + "requires":{ + "fire_ice": 2 + }, + "ppm": 30, + "produced_with": "chemical_plant", + "advanced": true + } + ]}, + "refined_oil": { + "requires":{ + "crude_oil": 2 + }, + "ppm": 15, + "produced_with": "oil_refinery", + "recipe_name": "Plasma Refining", + "amount": 2 + }, + "deuterium": { + "recipes": [ + { + "requires":{ + "hydrogen": 10 + }, + "ppm": 12, + "produced_with": "particle_colider" + }, + { + "requires":{ + "hydrogen": 1 + }, + "produced_with": "fractionator" + } + ]}, + "plastic": { + "requires": { + "refined_oil": 2, + "energetic_graphite": 1 + }, + "produced_with": "chemical_plant", + "ppm": 20 + }, + "organic_crystal": { + "recipes": [ + { + "requires":{ + "water": 1, + "refined_oil": 1, + "plastic": 2 + }, + "ppm": 10, + "produced_with": "chemical_plant" + }, + { + "requires":{ + "plant_fuel": 30, + "water": 10, + "log": 20 + }, + "ppm": 10, + "produced_with": "chemical_plant", + "original": true + } + ]}, + "graphene": { + "recipes": [ + { + "requires":{ + "energetic_graphite": 3, + "sulfuric_acid": 1 + }, + "ppm": 20, + "amount": 2, + "produced_with": "chemical_plant" + }, + { + "requires":{ + "fire_ice": 2 + }, + "ppm": 30, + "produced_with": "chemical_plant", + "advanced": true, + "amount": 2 + } + ]}, + "titanium_crystal": { + "requires": { + "titanium_ingot": 3, + "organic_crystal": 1 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "hydrogen_fuel_rod": { + "requires": { + "titanium_ingot": 1, + "hydrogen": 5 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "thruster": { + "requires": { + "steel": 2, + "copper_ingot": 3 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "logistics_drone": { + "requires": { + "iron_ingot": 5, + "processor": 2, + "thruster": 2 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "solar_sail": { + "requires": { + "graphene": 1, + "photon_combiner": 1 + }, + "produced_with": "assembler", + "ppm": 15, + "amount": 2 + }, + "deuteron_fuel_rod": { + "requires": { + "deuterium": 10, + "titanium_alloy": 1, + "super-magnetic_ring": 1 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "reinforced_thruster": { + "requires": { + "titanium_alloy": 5, + "electromagnetic_turbine": 5 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "logistics_vessel": { + "requires": { + "titanium_alloy": 10, + "reinforced_thruster": 5, + "processor": 10 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "foundation": { + "requires": { + "steel": 1, + "stone": 3 + }, + "produced_with": "assembler", + "ppm": 60 + } + }, +"buildings":{ + "tesla_tower": { + "requires": { + "iron_ingot": 2, + "magnetic_coil": 1 + }, + "produced_with": "assembler", + "ppm": 60 + }, + "wireless_power_tower": { + "requires": { + "tesla_tower": 1, + "plasma_exciter": 3 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "wind_turbine": { + "requires": { + "iron_ingot": 6, + "gear": 1, + "magnetic_coil": 3 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "thermal_power_station": { + "requires": { + "iron_ingot": 10, + "stone": 4, + "magnetic_coil": 4, + "gear": 4 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "solar_panel": { + "requires": { + "copper_ingot": 6, + "high-purity_silicon": 6, + "circuit_board": 4 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "accumulator": { + "requires": { + "iron_ingot": 6, + "super-magnetic_ring": 6, + "crystal_silicon": 4 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "ray_receiver": { + "requires": { + "steel": 20, + "super-magnetic_ring": 20, + "high-purity_silicon": 20, + "photon_combiner": 10, + "processor": 5 + }, + "produced_with": "assembler", + "ppm": 7.5 + }, + "mini_fusion_power_station": { + "requires": { + "titanium_alloy": 12, + "super-magnetic_ring": 10, + "carbon_nanotubes": 8, + "processor": 4 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "converyor_belt_mk1": { + "requires": { + "iron_ingot": 2, + "gear": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 3 + }, + "converyor_belt_mk2": { + "requires": { + "converyor_belt_mk1": 3, + "electromagnetic_turbine": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 3 + }, + "converyor_belt_mk3": { + "requires": { + "converyor_belt_mk2": 3, + "super-magnetic_ring": 1, + "graphene": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 3 + }, + "splitter": { + "requires": { + "iron_ingot": 3, + "gear": 2, + "circuit_board": 1 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "storage_mk1": { + "requires": { + "iron_ingot": 4, + "stone": 4 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "storage_mk2": { + "requires": { + "steel": 8, + "stone": 8 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "storage_tank": { + "requires": { + "iron_ingot": 8, + "stone": 4, + "glass": 4 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "em-rail_ejector": { + "requires": { + "steel": 20, + "gear": 20, + "processor": 5, + "super-magnetic_ring": 10 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "planetary_logistics_station": { + "requires": { + "steel": 40, + "titanium_ingot": 40, + "processor": 40, + "particle_container": 20 + }, + "produced_with": "assembler", + "ppm": 3 + }, + "sorter_mk1": { + "requires": { + "iron_ingot": 1, + "circuit_board": 1 + }, + "produced_with": "assembler", + "ppm": 60 + }, + "sorter_mk2": { + "requires": { + "sorter_mk1": 2, + "electric_motor": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "sorter_mk3": { + "requires": { + "sorter_mk2": 2, + "electromagnetic_turbine": 1 + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "mining_machine": { + "requires": { + "iron_ingot": 4, + "magnetic_coil": 2, + "gear": 2, + "circuit_board": 2 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "water_pump": { + "requires": { + "iron_ingot": 8, + "stone": 4, + "electric_motor": 4, + "circuit_board": 2 + }, + "produced_with": "assembler", + "ppm": 15 + }, + "oil_extractor": { + "requires": { + "steel": 12, + "stone": 12, + "plasma_exciter": 4, + "circuit_board": 6 + }, + "produced_with": "assembler", + "ppm": 7.5 + }, + "oil_refinery": { + "requires": { + "steel": 10, + "stone": 10, + "plasma_exciter": 6, + "circuit_board": 6 + }, + "produced_with": "assembler", + "ppm": 10 + }, + "interstellar_logistics_Station": { + "requires": { + "planetary_logistics_station": 1, + "titanium_alloy": 40, + "particle_container": 20 + }, + "produced_with": "assembler", + "ppm": 2 + }, + "assembling_machine_mk1": { + "requires": { + "iron_ingot": 4, + "gear": 8, + "circuit_board": 4 + }, + "produced_with": "assembler", + "ppm": 30 + }, + "assembling_machine_mk2": { + "requires": { + "assembling_machine_mk1": 1, + "graphene": 8, + "processor": 4 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "smelter": { + "requires": { + "iron_ingot": 4, + "stone": 2, + "circuit_board": 4, + "magnetic_coil": 2 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "fractionator": { + "requires": { + "steel": 8, + "stone": 4, + "glass": 4, + "processor": 1 + }, + "produced_with": "assembler", + "ppm": 20 + }, + "chemical_plant": { + "requires": { + "steel": 8, + "stone": 8, + "glass": 8, + "circuit_board": 2 + }, + "produced_with": "assembler", + "ppm": 12 + }, + "matrix_lab": { + "requires": { + "iron_ingot": 8, + "magnetic_coil": 4, + "glass": 4, + "circuit_board": 4 + }, + "produced_with": "assembler", + "ppm": 20 + } + } +} \ No newline at end of file diff --git a/output.json b/output.json new file mode 100644 index 0000000..ad9d8bf --- /dev/null +++ b/output.json @@ -0,0 +1,248 @@ +{ + "sorter_mk2": { + "requires": { + "sorter_mk1": { + "requires": { + "iron_ingot": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 1 + }, + "circuit_board": { + "requires": { + "iron_ingot": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 2 + }, + "copper_ingot": { + "requires": { + "copper_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 1 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 1 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "electric_motor": { + "requires": { + "magnetic_coil": { + "requires": { + "copper_ingot": { + "requires": { + "copper_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 1 + }, + "magnet": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 40, + "amount": 2 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 1 + }, + "gear": { + "requires": { + "iron_ingot": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 1 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 1 + }, + "iron_ingot": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 2 + } + }, + "produced_with": "assembler", + "ppm": 30, + "amount": 1 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "electromagnetic_turbine": { + "requires": { + "magnetic_coil": { + "requires": { + "copper_ingot": { + "requires": { + "copper_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 1 + }, + "magnet": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 40, + "amount": 2 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 2 + }, + "electric_motor": { + "requires": { + "magnetic_coil": { + "requires": { + "copper_ingot": { + "requires": { + "copper_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 1 + }, + "magnet": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 40, + "amount": 2 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 1 + }, + "gear": { + "requires": { + "iron_ingot": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 1 + } + }, + "produced_with": "assembler", + "ppm": 60, + "amount": 1 + }, + "iron_ingot": { + "requires": { + "iron_ore": { + "produced_with": "mining_machine", + "is_source": true, + "amount": 1, + "requires": {} + } + }, + "produced_with": "smelter", + "ppm": 60, + "amount": 2 + } + }, + "produced_with": "assembler", + "ppm": 30, + "amount": 2 + } + }, + "produced_with": "assembler", + "ppm": 30, + "amount": 1 + } +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b98f660 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +click \ No newline at end of file