2023-11-03 21:53:18 -03:00
|
|
|
import { recursiveHackingRequired, recursiveScan } from "./utils"
|
2023-11-03 21:38:12 -03:00
|
|
|
|
2023-11-03 21:57:09 -03:00
|
|
|
export async function main(ns: NS) {
|
2023-11-03 21:38:12 -03:00
|
|
|
switch (ns.args[0]) {
|
|
|
|
case "getServers":
|
2023-11-03 21:57:09 -03:00
|
|
|
getServers(ns)
|
|
|
|
break
|
2023-11-03 21:53:18 -03:00
|
|
|
case "getHackingLevels":
|
2023-11-03 21:57:09 -03:00
|
|
|
getHackingLevels(ns)
|
|
|
|
break
|
2023-11-03 21:38:12 -03:00
|
|
|
default:
|
2023-11-03 21:57:09 -03:00
|
|
|
ns.tprint("Invalid program name")
|
|
|
|
break
|
2023-11-03 21:38:12 -03:00
|
|
|
}
|
|
|
|
}
|
2023-11-03 21:57:09 -03:00
|
|
|
|
2023-11-03 21:38:12 -03:00
|
|
|
function getServers(ns: NS) {
|
2023-11-03 21:57:09 -03:00
|
|
|
ns.tprint(recursiveScan(ns))
|
2023-11-03 21:38:12 -03:00
|
|
|
}
|
2023-11-03 21:57:09 -03:00
|
|
|
|
2023-11-03 21:53:18 -03:00
|
|
|
function getHackingLevels(ns: NS) {
|
|
|
|
ns.tprint(recursiveHackingRequired(ns))
|
|
|
|
}
|