updated my corp from ramses corp
This commit is contained in:
@@ -11,7 +11,9 @@ export async function main(ns) {
|
|||||||
let nListenPID = 0;
|
let nListenPID = 0;
|
||||||
let oCorpData = {};
|
let oCorpData = {};
|
||||||
let oDivisionData = {};
|
let oDivisionData = {};
|
||||||
let oOfficeData = {}
|
let oOfficeData = {};
|
||||||
|
let oWarehouseData = {};
|
||||||
|
let bUnlockStatus = false;
|
||||||
ns.tprint(oCorpStatus);
|
ns.tprint(oCorpStatus);
|
||||||
while (nStep < 199) {
|
while (nStep < 199) {
|
||||||
nStep = oCorpStatus.nStep;
|
nStep = oCorpStatus.nStep;
|
||||||
@@ -40,6 +42,25 @@ export async function main(ns) {
|
|||||||
oCorpStatus.nStep = 20;
|
oCorpStatus.nStep = 20;
|
||||||
break;
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
|
nListenPID = ns.run("/corp/HasUnlock.js", 1, "Smart Supply");
|
||||||
|
await ns.nextPortWrite(nListenPID);
|
||||||
|
bUnlockStatus = ns.readPort(nListenPID);
|
||||||
|
if (!bUnlockStatus) {
|
||||||
|
await ns.nextPortWrite(ns.run("/corp/BuyUnlock.js", 1, "Smart Supply"));
|
||||||
|
}
|
||||||
|
for (let sCity of aCitites) {
|
||||||
|
nListenPID = ns.run("/corp/GetWarehouseData.js", 1, sDivisionName, sCity);
|
||||||
|
await ns.nextPortWrite(nListenPID);
|
||||||
|
oWarehouseData = ns.readPort(nListenPID);
|
||||||
|
if (!oWarehouseData) {
|
||||||
|
await ns.nextPortWrite(ns.run("/corp/PurchaseWarehouses.js", 1, sDivisionName, sCity));
|
||||||
|
}
|
||||||
|
await ns.nextPortWrite(ns.run("/corp/SetSmartSupply.js", 1, sDivisionName, sCity));
|
||||||
|
};
|
||||||
|
|
||||||
|
oCorpStatus.nStep = 30;
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
let nTargetSize = 4;
|
let nTargetSize = 4;
|
||||||
for (let sCity of aCitites) {
|
for (let sCity of aCitites) {
|
||||||
nListenPID = ns.run("/corp/GetOfficeData.js", 1, sDivisionName, sCity);
|
nListenPID = ns.run("/corp/GetOfficeData.js", 1, sDivisionName, sCity);
|
||||||
@@ -47,21 +68,19 @@ export async function main(ns) {
|
|||||||
oOfficeData = ns.readPort(nListenPID);
|
oOfficeData = ns.readPort(nListenPID);
|
||||||
await ns.nextPortWrite(ns.run("/corp/UpgradeOffice.js", 1, sDivisionName, sCity, nTargetSize, oOfficeData.size))
|
await ns.nextPortWrite(ns.run("/corp/UpgradeOffice.js", 1, sDivisionName, sCity, nTargetSize, oOfficeData.size))
|
||||||
}
|
}
|
||||||
oCorpStatus.nStep = 30;
|
oCorpStatus.nStep = 40;
|
||||||
break;
|
break;
|
||||||
case 30:
|
case 40:
|
||||||
for (let sCity of aCitites) {
|
for (let sCity of aCitites) {
|
||||||
nListenPID = ns.run("/corp/GetOfficeData.js", 1, sDivisionName, sCity);
|
nListenPID = ns.run("/corp/GetOfficeData.js", 1, sDivisionName, sCity);
|
||||||
await ns.nextPortWrite(nListenPID);
|
await ns.nextPortWrite(nListenPID);
|
||||||
oOfficeData = ns.readPort(nListenPID);
|
oOfficeData = ns.readPort(nListenPID);
|
||||||
ns.tprint(oOfficeData);
|
ns.tprint(oOfficeData);
|
||||||
nListenPID = ns.run("/corp/HireWorkers.js", 1, sDivisionName, sCity, oOfficeData);
|
nListenPID = ns.run("/corp/HireWorkers.js", 1, sDivisionName, sCity, JSON.stringify(oOfficeData));
|
||||||
await ns.nextPortWrite(nListenPID);
|
await ns.nextPortWrite(nListenPID);
|
||||||
}
|
}
|
||||||
oCorpStatus.nStep = 200;
|
oCorpStatus.nStep = 200;
|
||||||
break;
|
break;
|
||||||
case 40:
|
|
||||||
break;
|
|
||||||
case 50:
|
case 50:
|
||||||
break;
|
break;
|
||||||
case 60:
|
case 60:
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let cities = ["Sector-12", "Aevum", "Volhaven", "Chongqing", "New Tokyo", "Ishima"];
|
|
||||||
let corpName = "AgraNeo";
|
|
||||||
ns.tprint(ns.corporation.getMaterial(corpName,cities[0],"Plants"))
|
|
||||||
ns.corporation.sellMaterial()
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let [sDivName, sCity] = ns.args;
|
|
||||||
ns.corporation.expandCity(sDivName, sCity)
|
|
||||||
ns.writePort(ns.pid, true);
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let [newDivName,industry] = ns.args;
|
|
||||||
ns.corporation.expandIndustry(industry, newDivName);
|
|
||||||
ns.writePort(ns.pid,true);
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
ns.writePort(ns.pid,ns.corporation.getCorporation())
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
ns.writePort(ns.pid,ns.corporation.getDivision(ns.args[0]))
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let [sDivName, sCity] = ns.args;
|
|
||||||
ns.writePort(ns.pid, ns.corporation.getOffice(sDivName, sCity))
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
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") : "";
|
|
||||||
(oCurrentOffice.employeeJobs.Business < 1) ? ns.corporation.hireEmployee(sDivName, sCity,"Business") : "";
|
|
||||||
(oCurrentOffice.employeeJobs.Management < 1) ? ns.corporation.hireEmployee(sDivName, sCity,"Management") : "";
|
|
||||||
};
|
|
||||||
ns.writePort(ns.pid, true);
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let cities = ["Sector-12", "Aevum", "Volhaven", "Chongqing", "New Tokyo", "Ishima"];
|
|
||||||
let corpName1 = ["AgraNeo","Plants"];
|
|
||||||
let corpName2 = ["ChemNeo","Chemicals"];
|
|
||||||
let exportString = "IPROD*-1"
|
|
||||||
for (let city of cities) {
|
|
||||||
ns.corporation.cancelExportMaterial(corpName1[0],city,corpName2[0],city,corpName1[1]);
|
|
||||||
ns.corporation.cancelExportMaterial(corpName2[0],city,corpName1[0],city,corpName2[1]);
|
|
||||||
ns.corporation.exportMaterial(corpName1[0],city,corpName2[0],city,corpName1[1],exportString);
|
|
||||||
ns.corporation.exportMaterial(corpName2[0],city,corpName1[0],city,corpName2[1],exportString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let [corpName, city] = ns.args;
|
|
||||||
//ns.corporation.setSmartSupply(corpName, city, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let [sDivName, sCity, nTargetSize, nCurrentSize] = ns.args;
|
|
||||||
if (nCurrentSize < nTargetSize) {
|
|
||||||
ns.corporation.upgradeOfficeSize(sDivName, sCity, nTargetSize - nCurrentSize);
|
|
||||||
};
|
|
||||||
ns.writePort(ns.pid, true);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user