moriakaice / bitburner

Collection of scripts for https://danielyxie.github.io/bitburner/
ISC License
114 stars 145 forks source link

RUNTIME ERROR #8

Open CozyRocket opened 2 years ago

CozyRocket commented 2 years ago

Just tried to run this on a brand new instance on version 1.0.0 and it errors with.

RUNTIME ERROR mainHack.ns@home

Concurrent calls to Netscript functions not allowed! Did you forget to await hack(), grow(), or some other promise-returning function? (Currently running: scp tried to run: hasRootAccess)

tylort69 commented 2 years ago

image

pacmanninja998 commented 2 years ago

I tried adding await around the mentions of ns.hasRootAccess, but I'm not too savvy to get it working. Anybody know how to fix it?

Hordeq commented 2 years ago

If you take a look at Pull Requests up above, there is a patch from another developer fixing the errors to make it work with the latest version. It's not committed to this git but it's all there. You'll need to remove the * 1000 multipliers to get hack/grow/weaken timers as they return milliseconds now instead of seconds.

BasTijs commented 2 years ago

@Hordeq Thanks for the tip, that helps to make it run. Do you mean also remove the *1000 from the pull request version? I'm a new player and running the main script doesnt do much, it goes all the time into sleep and grow/weaken without making money. Do you have any advice on which settings to use for new players?

Hordeq commented 2 years ago

@BasTijs > @Hordeq Thanks for the tip, that helps to make it run. Do you mean also remove the *1000 from the pull request version? I'm a new player and running the main script doesnt do much, it goes all the time into sleep and grow/weaken without making money. Do you have any advice on which settings to use for new players?

Change: const hackTime = ns.getHackTime(bestTarget) 1000 const growTime = ns.getGrowTime(bestTarget) 1000 const weakenTime = ns.getWeakenTime(bestTarget) * 1000 ~lines 179-182 into: const hackTime = ns.getHackTime(bestTarget) const growTime = ns.getGrowTime(bestTarget) const weakenTime = ns.getWeakenTime(bestTarget)

(Do not remove the *1000s from the top lines of the script, they are needed now that everything is converted into milliseconds)

Those three functions were updated to return milliseconds already instead of seconds so *1000 just makes it wait a thousand times longer than it should. The only thing I can really recommend is changing the reserved ram options at the top if you need more ram free on your home to run other scripts. Otherwise, it services well enough to get to all the augment restarts to finish the storyline up to bitnodes. It will not use any extra space efficiently, once it has cleared out everything it'll do one full hack/grow/weaken pass and just waste dump the remaining threads into whatever. This is plenty of money to get everything done though.

Actually, I know early on the playerServers autobuy will drain all your money. So, I suggest killing it after a few upgrades then turn it back on after you get all the port hacking EXEs. Or leave it off once you get enough threads to do a full cycle then get a stock trader script to dump all your money into.

Eugney commented 2 years ago

Do you know any good stock trader scripts?

Hordeq commented 2 years ago

@Eugney > Do you know any good stock trader scripts?

Good? No, but there's a passable one on Reddit. And if you rewrite the 4S one from this repo, it works well enough. Just replace all 'ns.getStock' with 'ns.stock.get' and 'ns.buy/sellStock' with 'ns.stock.buy/sell' then comment out the Short sections and it's good to go.