Filter instead of remove
This commit is contained in:
parent
c320b31ac3
commit
df2d550eb6
@ -9,7 +9,7 @@ export async function main(ns: NS) {
|
||||
do {
|
||||
if (Math.min(...levels) <= hackingLevel) {
|
||||
// remove the level from the list, so we don't try to hack it again
|
||||
levels.splice(levels.indexOf(hackingLevel), 1)
|
||||
levels = levels.filter(level => level > hackingLevel)
|
||||
ns.tprint(`Hacking level increased to ${hackingLevel}`)
|
||||
ns.tprint(`Remaining levels to hack: ${levels}`)
|
||||
ns.run("killall.js")
|
||||
|
Loading…
Reference in New Issue
Block a user