Bitburner-Scripts/servers/home/programs.ts

24 lines
440 B
TypeScript
Raw Normal View History

2023-11-03 21:53:18 -03:00
import { recursiveHackingRequired, recursiveScan } from "./utils"
2023-11-03 21:57:09 -03:00
export async function main(ns: NS) {
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
default:
2023-11-03 21:57:09 -03:00
ns.tprint("Invalid program name")
break
}
}
2023-11-03 21:57:09 -03:00
function getServers(ns: NS) {
2023-11-03 21:57:09 -03:00
ns.tprint(recursiveScan(ns))
}
2023-11-03 21:57:09 -03:00
2023-11-03 21:53:18 -03:00
function getHackingLevels(ns: NS) {
ns.tprint(recursiveHackingRequired(ns))
}