
Prints one or more values or variables to the Terminal. Queue a toast (bottom-right notification). Terminate current script and start another in 10 seconds. Returns a boolean denoting whether or not the specified server exists. Get the list of servers connected to a server.Ĭheck if any script with a filename is running. Start another script on the current server. Prints a formatted string to the script’s logs. Prints one or more values or variables to the script’s logs. Get a copy of the data from a port without popping it. Returns whether the player has access to the darkweb.Ĭhecks the status of the logging for the given function. Get the security increase for a number of threads.Ĭheck if you have root access on a server. Get the chance of successfully hacking a server. Get the part of money stolen with a single thread. GrowthAnalyzeSecurity(threads, hostname, cores)Ĭalculate the security increase for a number of threads. Spoof money in a server's bank account, increasing the amount available.Ĭalculate the number of grow threads needed to grow a server by a certain multiplier. Get the execution time of a weaken() call. Returns the amount of time in milliseconds that have passed since you last installed Augmentations. Returns the required hacking level of the target server.Ĭalculate your share power. Returns the number of open ports required to successfully run NUKE.exe on the specified server. Returns the minimum security level of the target server. Get the maximum amount of RAM on a server. Get the maximum money available on a server. Defaults to the running script's server if host is not specified. Returns a server object for the given server. GetRunningScript(filename, hostname, args) Get an array of recently killed scripts across all servers. Get cost of upgrading a purchased server to the given ram. GetPurchasedServerUpgradeCost(hostname, ram) Returns an array with the hostnames of all of the servers you have purchased. Returns the maximum RAM that a purchased server can have. Returns the maximum number of servers you can purchase. Get information about the sources of income for this run. Returns a string with the hostname of the server that the script is running on. Returns the player’s current hacking level. Returns the amount of Faction favor required to be able to donate to a faction. Terminates the current script immediately. You should prefer 'sleep' over 'asleep' except when doing very complex UI work.Īdd callback function when the script dies Here is the results for my script(s) on BN1.2, and 0 augs, hitting the easier server foodnstuff.Export async function main ( ns ) Ns.exec('/newserver/weaken.script',server2,uweakenThreads,server,wsleep,i) ns.exec('/newserver/grow.script',server2,growThreads,server,gsleep,i) ns.exec('/newserver/hack.script',server2,hackThreads,server,hsleep,i) Īlso, this morning I had enough money to buy the Formulas.exe and was able to buy a single maxed out server.

If((runRamTotal>= (maxRam-UsedRam))=false)

Var sleepTime = (WeakenTime/(maxRam/totalRamForRun)) Var totalRamForRun = (hackscriptRam*hackThreads)+(growscriptRam*growThreads)+(weakenscriptRam*weakenThreads) Var uweakenThreads = Math.round((weakenThreads - (growThreads*0.004))) Var hackThreads = Math.round((50/HPercent)) Var growThreads = Math.round(((4/(GPercent-1))))

Some of the numbers in there are me just tweaking some settings to try and find a better balance. I'm not a coder and I didn't comment any of my script.
#Bitburner hack level formula full
I still haven't moved them yet as this script isn't useful on a full node restart That is why you'll see that my hack, grow, and weaken scripts aren't NS2. NOTE: This was my 2nd script that I transitioned to NS2. I loaded up my game from yesterday shortly before I took the red pill for the first time to gather the proof :) Then you divide WeakTime but that value to determine how many possible iteration of your processes you can have is, and use that to determine the sleep between restarting the cycle over again.įor me it was 585ms, so I ended up with a few hundred scripts running simultaneously. Then I calculated the max ram used for all scripts and threads and divided the systems max ram by that value. Weak threads are calculated based on servers minimum security level (you need less threads the higher the min security)grow threads are calculated based on 4/GrowPercent of 1 thread (trying to get 200-300% grow rate)hack thread is calculated on 50/(HackPercent*100), trying to get a hack of 50% funds so it doesn't drain it Start weakStart grow with sleep of WeakTime - GrowTimestart hack with sleep of WeakTime - HackTime Gather weaken time, grow time, hack time. I was getting 13b/s yesterday on 'the-hub' using that method.
