fixes
This commit is contained in:
+3
-9
@@ -3,13 +3,7 @@
|
||||
export async function main(ns) {
|
||||
// ns.disableLog('ALL');
|
||||
|
||||
let excludeServers = ['home'];
|
||||
for (let index = 0; index < 25; index++) {
|
||||
excludeServers.push(`home-${index}`);
|
||||
}
|
||||
excludeServers.push('CSEC');
|
||||
excludeServers.push('avmnite-02h');
|
||||
|
||||
// TODO: add increasing threshold if no servers lower than current threshold
|
||||
async function scanServer(currentServer, previousServer = currentServer) {
|
||||
let availableServers = ns.scan(currentServer);
|
||||
|
||||
@@ -17,7 +11,7 @@ export async function main(ns) {
|
||||
let nextServer = availableServers[i];
|
||||
|
||||
if (nextServer != currentServer && nextServer != previousServer) {
|
||||
if (excludeServers.indexOf(nextServer) == -1 && ns.scriptRunning('simple-hack.js', nextServer)) {
|
||||
if (ns.scriptRunning('simple-hack.js', nextServer)) {
|
||||
let maxMoney = ns.getServerMaxMoney(nextServer);
|
||||
let currentMoney = ns.getServerMoneyAvailable(nextServer);
|
||||
|
||||
@@ -25,7 +19,7 @@ export async function main(ns) {
|
||||
await ns.grow(nextServer);
|
||||
}
|
||||
}
|
||||
await scanServer(nextServer, maxDepth, depth + 1, currentServer);
|
||||
await scanServer(nextServer, currentServer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user