Move call outside the scope of watcher

This commit is contained in:
Isaac Shoebottom 2023-11-03 21:56:55 -03:00
parent 92ad2da7b7
commit 90fef7e53a
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,5 @@
export async function main(ns: NS) { export async function main(ns: NS) {
ns.run('watcher.js') ns.run("hackallservers.js")
ns.run('hacknet.js') ns.run("watcher.js")
ns.run("hacknet.js")
} }

View File

@ -1,7 +1,6 @@
import { recursiveHackingRequired } from "./utils" import { recursiveHackingRequired } from "./utils"
export async function main(ns: NS) { export async function main(ns: NS) {
ns.run('hackallservers.js')
let levels = recursiveHackingRequired(ns) let levels = recursiveHackingRequired(ns)
let hackingLevel: number let hackingLevel: number
do { do {
@ -10,9 +9,9 @@ export async function main(ns: NS) {
// remove the level from the list, so we don't try to hack it again // remove the level from the list, so we don't try to hack it again
levels.splice(levels.indexOf(hackingLevel), 1) levels.splice(levels.indexOf(hackingLevel), 1)
ns.tprint(`Hacking level increased to ${hackingLevel}`) ns.tprint(`Hacking level increased to ${hackingLevel}`)
ns.run('killall.js') ns.run("killall.js")
await ns.sleep(1000) // 1 second await ns.sleep(1000) // 1 second
ns.run('hackallservers.js') ns.run("hackallservers.js")
} }
// Wait 1 second before checking again // Wait 1 second before checking again
await ns.sleep(1000) await ns.sleep(1000)