export async function main(ns) { // Iterator we'll use for our loop let i = 0; ns.tail(); while (i < ns.getPurchasedServerLimit()) { let hostname = "pserv-" + i; ns.purchaseServer(hostname, 32) // update this by powers of 2 as you get more money. i usually have it at 2048 ++i; await ns.sleep(100); } }