small sync
This commit is contained in:
@@ -47,9 +47,18 @@ export async function main(ns) {
|
||||
oOfficeData = ns.readPort(nListenPID);
|
||||
await ns.nextPortWrite(ns.run("/corp/UpgradeOffice.js", 1, sDivisionName, sCity, nTargetSize, oOfficeData.size))
|
||||
}
|
||||
oCorpStatus.nStep = 200;
|
||||
oCorpStatus.nStep = 30;
|
||||
break;
|
||||
case 30:
|
||||
for (let sCity of aCitites) {
|
||||
nListenPID = ns.run("/corp/GetOfficeData.js", 1, sDivisionName, sCity);
|
||||
await ns.nextPortWrite(nListenPID);
|
||||
oOfficeData = ns.readPort(nListenPID);
|
||||
ns.tprint(oOfficeData);
|
||||
nListenPID = ns.run("/corp/HireWorkers.js", 1, sDivisionName, sCity, oOfficeData);
|
||||
await ns.nextPortWrite(nListenPID);
|
||||
}
|
||||
oCorpStatus.nStep = 200;
|
||||
break;
|
||||
case 40:
|
||||
break;
|
||||
@@ -69,6 +78,6 @@ export async function main(ns) {
|
||||
break;
|
||||
}
|
||||
ns.write("CorpStatus.txt", JSON.stringify(oCorpStatus), "w")
|
||||
await ns.sleep(1000)
|
||||
await ns.sleep(1)
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
{"nStep":200}
|
||||
{"nStep":30}
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity, nTargetSize] = ns.args;
|
||||
let oCurrentOffice = ns.corporation.getOffice(sDivName, sCity);
|
||||
let [sDivName, sCity, oCurrentOffice] = ns.args;
|
||||
if (oCurrentOffice.numEmployees < oCurrentOffice.size) {
|
||||
(oCurrentOffice.employeeJobs.Operations < 1) ? ns.corporation.hireEmployee(sDivName, sCity,"Operations") : "";
|
||||
(oCurrentOffice.employeeJobs.Engineer < 1) ? ns.corporation.hireEmployee(sDivName, sCity,"Engineer") : "";
|
||||
|
||||
Reference in New Issue
Block a user