corpSync
This commit is contained in:
@@ -2,6 +2,4 @@
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity] = ns.args;
|
||||
ns.writePort(ns.pid, ns.corporation.getOffice(sDivName, sCity))
|
||||
|
||||
ns.tprint(ns.corporation.getOffice(sDivName, sCity))
|
||||
}
|
||||
@@ -3,19 +3,19 @@ export async function main(ns) {
|
||||
let [sDivName, sCity, oCurrentOffice, oWorkerDistribution] = ns.args;
|
||||
oCurrentOffice = JSON.parse(oCurrentOffice);
|
||||
let aWorkerDistribution = JSON.parse(oWorkerDistribution).nWorkerNumbers;
|
||||
ns.tprint(aWorkerDistribution);
|
||||
let nTotalWorkers = 0;
|
||||
const len = aWorkerDistribution.length;
|
||||
for (let i = 0; i < len; i++) nTotalWorkers += aWorkerDistribution[i];
|
||||
ns.tprint(typeof(oCurrentOffice.employeeJobs["Research & Development"]))
|
||||
|
||||
while (oCurrentOffice.numEmployees < oCurrentOffice.size && oCurrentOffice.numEmployees < nTotalWorkers) {
|
||||
let i = 0;
|
||||
while (oCurrentOffice.numEmployees < oCurrentOffice.size && oCurrentOffice.numEmployees < nTotalWorkers && i < 1) {
|
||||
(oCurrentOffice.employeeJobs.Operations < aWorkerDistribution[0]) ? ns.corporation.hireEmployee(sDivName, sCity, "Operations") : "";
|
||||
(oCurrentOffice.employeeJobs.Engineer < aWorkerDistribution[1]) ? ns.corporation.hireEmployee(sDivName, sCity, "Engineer") : "";
|
||||
(oCurrentOffice.employeeJobs.Business < aWorkerDistribution[2]) ? ns.corporation.hireEmployee(sDivName, sCity, "Business") : "";
|
||||
(oCurrentOffice.employeeJobs.Management < aWorkerDistribution[3]) ? ns.corporation.hireEmployee(sDivName, sCity, "Management") : "";
|
||||
(oCurrentOffice.employeeJobs.Research & Development < aWorkerDistribution[4]) ? ns.corporation.hireEmployee(sDivName, sCity, "Research & Development") : "";
|
||||
(oCurrentOffice.employeeJobs["Research & Development"] < aWorkerDistribution[4]) ? ns.corporation.hireEmployee(sDivName, sCity, "Research & Development") : "";
|
||||
(oCurrentOffice.employeeJobs.Intern < aWorkerDistribution[5]) ? ns.corporation.hireEmployee(sDivName, sCity, "Intern") : "";
|
||||
ns.sleep(1)
|
||||
i += 1;
|
||||
};
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
3
Ramses/home/corp/PriceCalcCheatsheet.txt
Normal file
3
Ramses/home/corp/PriceCalcCheatsheet.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
getMaterial() -> material.marketPrice
|
||||
|
||||
ns.corporation.getMaterialData() -> baseMarkup
|
||||
@@ -4,4 +4,4 @@ export async function main(ns) {
|
||||
oCurrentGoods = JSON.parse(oCurrentGoods);
|
||||
ns.corporation.limitMaterialProduction(sDivName, sCity, oCurrentGoods.sMaterialName,50);
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user