Script
//EDIT 2022-01-06: Added the line 'money = ns.getPlayer().money;' to the end of the for-loop to update the 'money' variable in the argument.
var ram = Math.pow(2,20);
var list = ns.getPurchasedServers();
var money = ns.getPlayer().money;
var ramCost = ns.getPurchasedServerCost(ram);
var i;
for( i = list.length; i < 25 && money >= ramCost; i++ )
{
ns.purchaseServer("H" + parseInt(i+1),ram);
ns.tprint("Purchased server H" + parseInt(i+1));
money = ns.getPlayer().money;
}
list = ns.getPurchasedServers();
ns.tprint("Total Purchased Servers: " + list.length);
Source: https://steamcommunity.com/sharedfiles/filedetails/?id=2709244193
More Bitburner guilds
- All Guilds
- Hacknet Manager
- Easy offline money from scripts
- Using React to create custom UI components
- How To FInd All Servers (Script) (Clickbait)
- Backdoor script without SF4
- Auto Hack Scripts - Kraken edition
- (Kind of) Simple Imageboard API Grabber
- Library - ScanUtils // Infinite-depth scan, infinite-depth connect.
- AutoServerHackV2-2Kays.js
- Automatic nodes Version 2.0 and V 3.0