Fix hack all bug

This commit is contained in:
Isaac Shoebottom 2023-11-04 17:14:34 -03:00
parent f52af72140
commit 1af46c5d6f

View File

@ -6,6 +6,7 @@ export async function main(ns: NS) {
for (const server of servers) {
let numThreads = ns.getServerMaxRam(server) / ns.getScriptRam("hack.js")
numThreads = Math.floor(numThreads)
numThreads = Math.max(numThreads, 1) // Make sure we have at least 1 thread
executeScriptOnServerFromAnother(ns, server, "hack.js", numThreads, [server])
}
}