Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-starter.js doesn't get to run hack command #36

Open
rfsjim opened this issue Jul 8, 2023 · 0 comments
Open

auto-starter.js doesn't get to run hack command #36

rfsjim opened this issue Jul 8, 2023 · 0 comments

Comments

@rfsjim
Copy link

rfsjim commented Jul 8, 2023

I stumbled across the YouTube series and BitBurner late, and I am running BitBurner v2.3.1
I have tested this script (commit 874e690)

Running the auto-starter.js script using run auto-starter.js the targets get selected, the virus script gets distributed as expected, the grow and weaken commands get run and the servers get purchased.

However, I have not seen any hack commands run and no online production rate is reported. The targets change too quickly for hack to be called.

If I use run auto-deploy.js n00dles instead hack is called quickly and online production is increased

The workaround I have implemented to change this was to take on board a tip from the Getting Started Guide for Beginner Programmers — Bitburner 2.2.2 documentation that said - "As a rule of thumb, your hacking target should be the server with highest max money that’s required hacking level is under 1/2 of your hacking level."

Based on that tip I suggest changing the utils.js function canHack() to
/** @param {NS} ns **/ export function canHack(ns, server) { var pHackLvl = ns.getHackingLevel(); // player var sHackLvl = ns.getServerRequiredHackingLevel(server); return pHackLvl >= 2*sHackLvl; }

This should only select servers that have half the required hacking level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant