Servers had no money lol

This commit is contained in:
Isaac Shoebottom 2023-11-03 19:11:52 -03:00
parent 22ddbbde5d
commit 5d6063917b

View File

@ -2,9 +2,13 @@ export async function main(ns: NS) {
const server: string = <string> ns.args[0] const server: string = <string> ns.args[0]
while (true) { while (true) {
// Guide https://darktechnomancer.github.io/#glossary-of-terms // Guide https://darktechnomancer.github.io/#glossary-of-terms
if (ns.getServerSecurityLevel(server) > 5) {
await ns.weaken(server) await ns.weaken(server)
} else if (ns.getServerMoneyAvailable(server) < ns.getServerMaxMoney(server) * 0.95) {
await ns.grow(server) await ns.grow(server)
await ns.weaken(server) } else {
await ns.hack(server) await ns.hack(server)
} }
}
} }