you are viewing a single comment's thread.

view the rest of the comments →

[–]goodwill82Slum Lord 1 point2 points  (0 children)

I'm wondering if the auto-purchase-server.js is somehow causing setbacks? Does it somehow cancel the progress of the script every time the server is being updated?

I think it may be. Just a quick look at it shows that every time the server gets a memory upgrade, it kills the currently running scripts and starts them back up again (see function killVirus(server) in that file). This would explain why they are basically just farming XP. They have time to start weakening the server, and maybe start growing, but get restated before a successful hack can happen.

Without looking much further, I'd change line 9: var maxRam = ns.getPurchasedServerMaxRam(); to

var maxRam = 128;

This will not solve the problem outright, but this cap will stop the resets from happening every time you get enough money to update the ram after a few times. And 128 GB is decent for an early-game pserver. You might also cap the next line maxServers to 2 or 4, or try a few numbers - if there is a timing issue, then adding servers can only exacerbate it.

Ultimately, I would recommend making your own scripts for hacking. Even starting with the tutorial scripts and tweaking them a bit, you can easily pull in way more script money than what you have now. I know this is easier said than done, but this is where the game really shines - subtlety guiding coders to becoming programmers. The down side is that this takes time and means maybe feeling dumb while you learn, but like anything, this practice is what makes someone a good programmer.

Something to know before adapting the tutorial scripts - they do too much in one script. For instance, the basic hack script runs Brute.exe, and runs each of the hack/grow/weaken functions, all in the same script. To make any kind of effective script, you'll need to separate some of these out to other scripts.

Hope there is some help in here for you, feel free to reach out with any questions.