mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-07 16:17:49 +02:00
DOCUMENTATION: Fix incorrect cloud API example (#2738)
This commit is contained in:
@@ -377,7 +377,7 @@ Paste the following code into the [Script](../basic/scripts.md) editor:
|
||||
// amount of servers
|
||||
while (i < ns.cloud.getServerLimit()) {
|
||||
// Check if we have enough money to purchase access to a server
|
||||
if (ns.getServerMoneyAvailable("home") > ns.cloud.getRamLimit(ram)) {
|
||||
if (ns.getServerMoneyAvailable("home") > ns.cloud.getServerCost(ram)) {
|
||||
// If we have enough money, then:
|
||||
// 1. Purchase the server
|
||||
// 2. Copy our hacking script onto the newly purchased cloud server
|
||||
|
||||
@@ -37,7 +37,7 @@ Common infinite loop when translating the server purchasing script in starting g
|
||||
let i = ns.cloud.getServerNames().length;
|
||||
|
||||
while (i < ns.cloud.getServerLimit()) {
|
||||
if (ns.getServerMoneyAvailable("home") > ns.cloud.getRamLimit(ram)) {
|
||||
if (ns.getServerMoneyAvailable("home") > ns.cloud.getServerCost(ram)) {
|
||||
const hostname = ns.cloud.purchaseServer("cloud-server-" + i, ram);
|
||||
ns.scp("early-hack-template.js", hostname);
|
||||
ns.exec("early-hack-template.js", hostname, 3);
|
||||
|
||||
Reference in New Issue
Block a user