working on the corp-control
This commit is contained in:
@@ -1,14 +1,33 @@
|
|||||||
/** @param {NS} ns */
|
/** @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 cities = ["Sector-12", "Aevum", "Volhaven", "Chongqing", "New Tokyo", "Ishima"];
|
||||||
let corpName = "AgraNeo";
|
let corpName = "Agri-Ram";
|
||||||
//ns.tprint(ns.corporation.getConstants())
|
if (reset === true || !ns.fileExists("CorpStatus.txt")){
|
||||||
//ns.corporation.getMaterial();
|
ns.write("CorpStatus.txt",JSON.stringify({step: 0}),"w");
|
||||||
//ns.corporation.buyMaterial();
|
};
|
||||||
|
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) {
|
for (let city of cities) {
|
||||||
await ns.run("/corp/Smart.js",1,corpName,city);
|
await ns.run("/corp/Smart.js",1,corpName,city);
|
||||||
await ns.tprint(ns.run("/corp/UpgradeOffice.js",1,corpName,city));
|
await ns.tprint(ns.run("/corp/UpgradeOffice.js",1,corpName,city));
|
||||||
await ns.sleep(1000)
|
await ns.sleep(1000)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user