save backup
This commit is contained in:
+2
-1
@@ -9,6 +9,7 @@ export async function main(ns) {
|
||||
let levelCap = 150;
|
||||
let ramCap = 64;
|
||||
let coreCap = 4;
|
||||
let nodeCap = 15;
|
||||
ns.tprint(`Bot started {nodeCostThreshold: ${nodeCostThreshold}, upgradeCostThreshold: ${upgradeCostThreshold}, upgradeCount: ${upgradeCount}}`);
|
||||
|
||||
while (true) {
|
||||
@@ -16,7 +17,7 @@ export async function main(ns) {
|
||||
let nodePurchaseCost = ns.hacknet.getPurchaseNodeCost();
|
||||
let nodeCount = ns.hacknet.numNodes();
|
||||
|
||||
if (nodePurchaseCost / Math.abs(currentMoney) < nodeCostThreshold) {
|
||||
if (nodeCount < nodeCap && nodePurchaseCost / Math.abs(currentMoney) < nodeCostThreshold) {
|
||||
ns.hacknet.purchaseNode();
|
||||
currentMoney = ns.getServerMoneyAvailable("home");
|
||||
++nodeCount;
|
||||
|
||||
Reference in New Issue
Block a user