cleaning up my stuff a bit
This commit is contained in:
7
Mizzajl/home/corp/Autosell.js
Normal file
7
Mizzajl/home/corp/Autosell.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/** @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()
|
||||
}
|
||||
5
Mizzajl/home/corp/BuyUnlock.js
Normal file
5
Mizzajl/home/corp/BuyUnlock.js
Normal file
@@ -0,0 +1,5 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
ns.corporation.purchaseUnlock("Smart Supply")
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
6
Mizzajl/home/corp/CorpExpandCity.js
Normal file
6
Mizzajl/home/corp/CorpExpandCity.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity] = ns.args;
|
||||
ns.corporation.expandCity(sDivName, sCity)
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
6
Mizzajl/home/corp/CorpStart.js
Normal file
6
Mizzajl/home/corp/CorpStart.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [newDivName,industry] = ns.args;
|
||||
ns.corporation.expandIndustry(industry, newDivName);
|
||||
ns.writePort(ns.pid,true);
|
||||
}
|
||||
7
Mizzajl/home/corp/CreateCorp.js
Normal file
7
Mizzajl/home/corp/CreateCorp.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sCorpName] = ns.args;
|
||||
ns.corporation.createCorporation(sCorpName,true)
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
|
||||
4
Mizzajl/home/corp/GetCorpData.js
Normal file
4
Mizzajl/home/corp/GetCorpData.js
Normal file
@@ -0,0 +1,4 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
ns.writePort(ns.pid,ns.corporation.getCorporation())
|
||||
}
|
||||
4
Mizzajl/home/corp/GetDivisionsData.js
Normal file
4
Mizzajl/home/corp/GetDivisionsData.js
Normal file
@@ -0,0 +1,4 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
ns.writePort(ns.pid,ns.corporation.getDivision(ns.args[0]))
|
||||
}
|
||||
5
Mizzajl/home/corp/GetOfficeData.js
Normal file
5
Mizzajl/home/corp/GetOfficeData.js
Normal file
@@ -0,0 +1,5 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity] = ns.args;
|
||||
ns.writePort(ns.pid, ns.corporation.getOffice(sDivName, sCity))
|
||||
}
|
||||
9
Mizzajl/home/corp/GetWarehouseData.js
Normal file
9
Mizzajl/home/corp/GetWarehouseData.js
Normal file
@@ -0,0 +1,9 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity] = ns.args;
|
||||
if (ns.corporation.hasWarehouse(sDivName, sCity)) {
|
||||
ns.writePort(ns.pid, ns.corporation.getWarehouse(sDivName, sCity))
|
||||
} else {
|
||||
ns.writePort(ns.pid, false)
|
||||
};
|
||||
}
|
||||
5
Mizzajl/home/corp/HasCorp.js
Normal file
5
Mizzajl/home/corp/HasCorp.js
Normal file
@@ -0,0 +1,5 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
ns.writePort(ns.pid,ns.corporation.hasCorporation());
|
||||
}
|
||||
|
||||
4
Mizzajl/home/corp/HasUnlock.js
Normal file
4
Mizzajl/home/corp/HasUnlock.js
Normal file
@@ -0,0 +1,4 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
ns.writePort(ns.pid, ns.corporation.hasUnlock("Smart Supply"));
|
||||
}
|
||||
12
Mizzajl/home/corp/HireWorkers.js
Normal file
12
Mizzajl/home/corp/HireWorkers.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity, oCurrentOffice] = ns.args;
|
||||
oCurrentOffice = JSON.parse(oCurrentOffice)
|
||||
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);
|
||||
}
|
||||
6
Mizzajl/home/corp/PurchaseWarehouses.js
Normal file
6
Mizzajl/home/corp/PurchaseWarehouses.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity] = ns.args;
|
||||
ns.corporation.purchaseWarehouse(sDivName, sCity);
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
7
Mizzajl/home/corp/SetMaterialLimit.js
Normal file
7
Mizzajl/home/corp/SetMaterialLimit.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity, oCurrentGoods] = ns.args;
|
||||
oCurrentGoods = JSON.parse(oCurrentGoods);
|
||||
ns.corporation.limitMaterialProduction(sDivName, sCity, oCurrentGoods.sMaterialName,50);
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
7
Mizzajl/home/corp/SetSalePrices.js
Normal file
7
Mizzajl/home/corp/SetSalePrices.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity, oCurrentGoods] = ns.args;
|
||||
oCurrentGoods = JSON.parse(oCurrentGoods);
|
||||
ns.corporation.sellMaterial(sDivName,sCity,oCurrentGoods.sMaterialName,oCurrentGoods.yAmount,oCurrentGoods.yPrice);
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
6
Mizzajl/home/corp/SetSmartSupply.js
Normal file
6
Mizzajl/home/corp/SetSmartSupply.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let [sDivName, sCity] = ns.args;
|
||||
ns.corporation.setSmartSupply(sDivName, sCity, true);
|
||||
ns.writePort(ns.pid, true);
|
||||
}
|
||||
13
Mizzajl/home/corp/SetupExport.js
Normal file
13
Mizzajl/home/corp/SetupExport.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/** @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);
|
||||
}
|
||||
}
|
||||
8
Mizzajl/home/corp/UpgradeOffice.js
Normal file
8
Mizzajl/home/corp/UpgradeOffice.js
Normal file
@@ -0,0 +1,8 @@
|
||||
/** @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