sync
This commit is contained in:
@@ -84,7 +84,6 @@ export async function main(ns) {
|
||||
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, JSON.stringify(oOfficeData));
|
||||
await ns.nextPortWrite(nListenPID);
|
||||
}
|
||||
@@ -92,19 +91,15 @@ export async function main(ns) {
|
||||
break;
|
||||
case 50:
|
||||
let aCurrentGoods = [
|
||||
{"sMaterialName":"Food","yAmount":"MAX","yPrice":"MP"},
|
||||
{"sMaterialName":"Plants","yAmount":"MAX","yPrice":"MP"}
|
||||
{ "sMaterialName": "Food", "yAmount": "MAX", "yPrice": "MP-1" },
|
||||
{ "sMaterialName": "Plants", "yAmount": "MAX", "yPrice": "MP-1" }
|
||||
]
|
||||
aCurrentGoods.forEach(async (entry) =>{
|
||||
for (let sCity of aCitites) {
|
||||
forEach
|
||||
nListenPID = ns.run("/corp/SetSalePrices.js", 1, sDivisionName, sCity, oCurrentGoods);
|
||||
await ns.nextPortWrite(nListenPID);
|
||||
oOfficeData = ns.readPort(nListenPID);
|
||||
ns.tprint(oOfficeData);
|
||||
nListenPID = ns.run("/corp/HireWorkers.js", 1, sDivisionName, sCity, JSON.stringify(oOfficeData));
|
||||
await ns.nextPortWrite(nListenPID);
|
||||
}})
|
||||
aCurrentGoods.forEach(async (entry) => {
|
||||
nListenPID = ns.run("/corp/SetSalePrices.js", 1, sDivisionName, sCity, JSON.stringify(entry));
|
||||
await ns.nextPortWrite(nListenPID);
|
||||
})
|
||||
}
|
||||
oCorpStatus.nStep = 200;
|
||||
break;
|
||||
case 60:
|
||||
|
||||
Reference in New Issue
Block a user