Bitburner-Scripts/no-ports/auto-upgrade.js

13 lines
268 B
JavaScript
Raw Normal View History

2023-11-02 11:04:03 -03:00
/** @param {NS} ns */
export async function main(ns) {
let level = ns.getHackingLevel()
while (level < 999) {
let newLevel = ns.getHackingLevel()
if (newLevel !== level) {
ns.run("run.js")
}
level = newLevel
await ns.sleep(10 * 1000) // 10 seconds
}
}