Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
since it doesn't take current values into account, if you 'prep' a server (get it to maxMoney and minSecurity), it won't care, and might choose a server that hasn't been prepped. This makes the function non-universal, as early-game doesn't have the time (nor ram) to properly prep most/all servers with money. You can just hard-code it so that, if your hacking level is below, like, 750, then it returns n00dles (a decent server), as beyond 750 you either have a solution or the resources. part 2
i found a formula that agrees with conventional logic, but it's up to you if you want to use it.
maxMoney / (minSecurity * Math.log2(Math.abs(hackingReq + 2 - playerHacking)))
explanation is:
you start off the difference in hacking levels - hackingReq + 2 - playerHacking. You take the absolute value, and then take the log2 of that - this makes the level difference worth less the further away it is. The log2 is why you add 2. Then, you multiply that value (at most like 17 or smthn) by the server's minSecurity. This number is the divisor for maxMoney, because high level difference || high minSecurity is bad, but high maxMoney is good. Then, finally, that is the server's value. Add it to an array, Math.max(...arr), and you have the best server to hack. part 1
alternatively, use math and function calls. It straight up tells you how long a grow will last, but the problem is planning. Therefore, spend five billion on Formulas.exe, and use ns.formulas.hacking.growTime(), and simulate the changes done to the server by using a variable instead of ns.getServer().
Definitely go to the games documentation and look through its API. There's a lot there.
The other things, like the port openers such as BrutesSSH.exe, and the ServerProfiler.exe can be used with the "run" command the same as running a script or coding contract. For example: "run ServerProfiler.exe n00dles". The same as using the Nuke.exe. To make it easier you can start typing their names in all lowercase and press Tab for it to auto-complete the names.
"Then, find a way to wait until it finishes. Repeat this process for grow() and hack()."
I can't find a way to 'wait'. I thought the await or ns.sleep commands were it, but they just crash the game for me.
Any advice?