Open arunk opened 2 months ago
https://github.com/Ero98/bitburnerHome/blob/4ed6c5c883885a492ced72ef9884800ada2323ec/hack/bat/masterV3.js#L92-L100 The code piece here checks if the player has the Formulas.exe program. If doesn't, it then try to grow all available servers to maximun money.
If the player have Formulas.exe installed(which I remember require buying it yourself), it will skip the grow to max action, and do the calculation first.
This selective behaviour is achieved using a facade script "/hack/bat/formulas.js", it basically chooses to do a rough calculation or delegates the call to the Formulas interface.
I will check again later to make sure I remember it correctly.
I checked a bit closer, ns.formulas.mockServer()
seems to return an empty Server object. I used a method which allows me to do less manual configurations. Check out the code piece below:
https://github.com/Ero98/bitburnerHome/blob/4ed6c5c883885a492ced72ef9884800ada2323ec/hack/bat/select-server.js#L295-L304
Where ns.getServer(dest)
also returns a Server object, but filled with the current status of a destination server. Then I set the values to the most ideal situation. After this chooseTargets
calculation is done, it will then grow the target servers to maximun money and weaken to lowest security.
The algorithm to grow and weaken a server certainly is too simple, and under certain conditions it may take way too long to finish...
Yes, maybe this script only works if your hacking is above a certain level. say 1500 or so. Then the grows and all that won't take as much time. Have you committed this new code for getServer? Can i check it out and test it?
True, I got back to the game recently, and starting fresh. Now I am stuck with about 240 hacking and the script not producing any money after running more than 8 hours(especially after I bought a lot of ram). So I am planing to seperate each target in the future(hack those which already grown to max first, rather than waiting for all targets growing to max).
As for the code I pasted earlier, those are links to the current code base actually. You can click on the link above each code piece to navigate to the file itself.
If you want to check what would theoretically be your values for a server given its max money and minimum security level, you can use the mockServer Formulas function, there is also a
mockPlayer
function that allows you to calculate for a theoretical hacking level and other player stats. Is this what you are trying to do, or are you doing something else? I just see all my threads used up growing servers, and some of them are going to take more than an hour to weaken or grow.