Bitburner: Early Hacknet Auto Management Script

Early Hacknet Auto Management Script.

 

Early Hacknet Auto Management Script

NOTE: This script will buy new nodes or upgrade your current nodes depending on which you can afford.

Create a script:
nano WhateverTheNameIs.js
Copy past the code:
/** @param {NS} ns **/
export async function main(ns) {
	while (true) {
		for (var i = 0; i < await ns.hacknet.numNodes(); i++) { if (await ns.getPlayer().money > await ns.hacknet.getLevelUpgradeCost(i, 1)) {
				await ns.hacknet.upgradeLevel(i, 1);
			}
			if (await ns.getPlayer().money > await ns.hacknet.getRamUpgradeCost(i, 1)) {
				await ns.hacknet.upgradeRam(i, 1);
			}
			if (await ns.getPlayer().money > await ns.hacknet.getCoreUpgradeCost(i, 1)) {
				await ns.hacknet.upgradeCore(i, 1);
			}
		}
		if (await ns.getPlayer().money > await ns.hacknet.getPurchaseNodeCost()) {
			await ns.hacknet.purchaseNode();
		}
		await ns.sleep(1000);
	}
}

Run the script:

run WhateverTheNameIs.js

NOTE: Better run it on your “home” machine.

screenshot of the code:

By Bloodly Hell Cat~

More Guides:

Leave a Comment

ArabicEnglishFrenchGermanItalianJapaneseKoreanPortugueseSpanish