Buy Server Script – Bitburner

admin

A short script that lets you fill up the entire server-list in one go. If you want to buy servers with less ram, just switch out the exponent X in Math.pow(2,X);

Script

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));

}

list = ns.getPurchasedServers();

ns.tprint(“Total Purchased Servers: ” + list.length);

Written by Ekis93

Here we come to an end for the Buy Server Script – Bitburner guide. I hope this guide has helped you with your gameplay. If you have something to add to this guide or believe we forgot some information to add, please let us know via comment! We check each comment manually by approving them!

TAGGED:
Share This Article