idk
This commit is contained in:
@@ -163,22 +163,22 @@ export async function purchaseAndUpgradeServers(ns) {
|
||||
ns.disableLog("getServerMaxRam");
|
||||
let maxPurchasedServers = ns.getPurchasedServerLimit();
|
||||
let purchasedServers = [];
|
||||
let count = listPurchasedServers(ns).length;
|
||||
let pServcount = listPurchasedServers(ns).length;
|
||||
let currentMoney = 0;
|
||||
let serverList = {};
|
||||
while (count < maxPurchasedServers) {
|
||||
while (pServcount < maxPurchasedServers) {
|
||||
purchasedServers = listPurchasedServers(ns);
|
||||
currentMoney = ns.getServerMoneyAvailable("home");
|
||||
let targetRamInitial = 16;
|
||||
if (ns.getPurchasedServerCost(targetRamInitial) < currentMoney) {
|
||||
let sFrontZero = "0";
|
||||
if (nServers >= 9) {
|
||||
if (pServcount > 9) {
|
||||
sFrontZero = "";
|
||||
}
|
||||
let hostname = ns.purchaseServer("pserv-" + sFrontZero + (aServers.length), targetRamInitial);
|
||||
let hostname = ns.purchaseServer("pserv-" + sFrontZero + pServcount, targetRamInitial);
|
||||
ns.tprint("Purchased " + cCyan + hostname + cReset);
|
||||
ns.toast("Purchased " + hostname, "info", 10000);
|
||||
count = listPurchasedServers(ns).length;
|
||||
pServcount = listPurchasedServers(ns).length;
|
||||
serverList = JSON.parse(ns.read("serverList.txt"));
|
||||
serverList[hostname] = {
|
||||
serverName: hostname,
|
||||
|
||||
Reference in New Issue
Block a user