From 31c08544ffa7c12b9f6daa54cb9917777e16b371 Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 7 Oct 2024 09:49:02 +0200 Subject: [PATCH] working on the corp-control --- Ramses/home/CorpControl.js | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Ramses/home/CorpControl.js b/Ramses/home/CorpControl.js index 4ed2131..f4840c0 100644 --- a/Ramses/home/CorpControl.js +++ b/Ramses/home/CorpControl.js @@ -1,14 +1,33 @@ /** @param {NS} ns */ -export async function main(ns) { +export async function main(ns, reset) { let cities = ["Sector-12", "Aevum", "Volhaven", "Chongqing", "New Tokyo", "Ishima"]; - let corpName = "AgraNeo"; - //ns.tprint(ns.corporation.getConstants()) - //ns.corporation.getMaterial(); - //ns.corporation.buyMaterial(); + let corpName = "Agri-Ram"; + if (reset === true || !ns.fileExists("CorpStatus.txt")){ + ns.write("CorpStatus.txt",JSON.stringify({step: 0}),"w"); + }; + let corpStatus = JSON.parse(ns.read("CorpStatus.txt")) || {step: 0}; + let step = corpStatus.step; + while (step < 99) { + step = corpStatus.step; + switch (step) { + case 0: + case 10: + case 20: + case 30: + case 40: + case 50: + case 60: + case 70: + case 80: + case 90: + case 100: + default: + + } for (let city of cities) { await ns.run("/corp/Smart.js",1,corpName,city); await ns.tprint(ns.run("/corp/UpgradeOffice.js",1,corpName,city)); await ns.sleep(1000) } - + } } \ No newline at end of file