2023-11-03 21:57:09 -03:00
|
|
|
import { executeScriptOnServerFromAnother, recursiveScan } from "./utils"
|
2023-11-03 18:42:37 -03:00
|
|
|
|
|
|
|
export async function main(ns: NS) {
|
|
|
|
let servers: string[] = recursiveScan(ns)
|
|
|
|
|
|
|
|
for (const server of servers) {
|
2023-11-03 21:57:09 -03:00
|
|
|
let numThreads = ns.getServerMaxRam(server) / ns.getScriptRam("hack.js")
|
2023-11-03 18:42:37 -03:00
|
|
|
numThreads = Math.floor(numThreads)
|
2023-11-03 21:57:09 -03:00
|
|
|
executeScriptOnServerFromAnother(ns, server, "hack.js", numThreads, [server])
|
2023-11-03 18:42:37 -03:00
|
|
|
}
|
|
|
|
}
|