Bitburner

Bitburner

View Stats:
New bug in 2.7.0
I've been running the same scanner and hack/grow/weaken scripts for ages now. All of a sudden, without changes, I keep getting an error message of:

"hack: Cannot hack home server because it is your server"

I don't know why this is suddenly popping up, but it's preventing me from loading up my home server. If I add a check to make sure that hack.js isn't running on my home server:

if (target != 'home')

...then the whole game locks up and needs to be killed and restarted.
< >
Showing 1-3 of 3 comments
sj123 1 Jan @ 2:04pm 
I think, I saw same message, when started BN9. Hack servers (unlike hack nodes) can run scripts and one of my hacking script traverse through all reachable servers and make them "hack themselves" which is caused error only when hack servers appeared.
There is a sub-forum for bug reports. It's called 'bug-report'. It is unlikely that what you are describing is an actual bug with the game, and is more likely a product of the the code you've written, but if you feel bold enough to back up your claim then you should try writing a proper bug report there. At a minimum you should provide the steps to reproduce the suspected bug. In this case, the text of the script that locks up the game would be very helpful.
Szendvics 12 Jan @ 10:59pm 
I think I know why is this happening, but my answer may not help, because lack of information. (full script code, etc.)

I assume your script is a while (true) loop, and your target variable is "home". When you call hack("home"), it can't run, because you can't steal money from yourself.
When you check if (target != "home"), the hack command won't run, but because you don't have an
await sleep(10)
your game freezes.

Your full code based on your description can be:
export async function main(ns) { const target = "home" // or ns.args[0], and you run your script like: script.js home while (true) { if (target != "home") { // hack/grow/weaken ns.hack(target) } } }
You can fix this by changing your target to other than home, and place the if outside the loop.
export async function main(ns) { if (target == "home") { ns.tprint("You can't steal money from yourself") ns.exit() } while (true) { // hack/grow/weaken ns.hack(target) ns.sleep(10) } }
Last edited by Szendvics; 12 Jan @ 11:08pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50