![]() ![]() Let minRam = 8 // Smallest server I'm willing to purchase to get started. Let cash = ns.getServerMoneyAvailable("home") ** ns **/Ĭonst startingCash = ns.getServerMoneyAvailable("home") I don't claim it's perfect, but it is MUCH faster. I also added a call at the end if my money decreased over the run, but I've decided that's bad logic because it doesn't account for money I'm making in the background. You’re encouraged to inspect the DOM, and even look at the source code itself. Poking Around This game encourages you to look beyond the UI, beyond the documentation. Customise your stats HUD using secret built-in hooks, and a little bit of scripting. You can tell my coding has evolved a little bit, I'm now taking arguments instead of editing the program for the values I want. Bitburner: How to Add Custom Stats to the HUD (Heads up Display) Decemby James. I just wanted a way to easily upgrade each or start fresh after installing augmentations. Var instances = parseInt(minRam / payloadSize) Var instances = parseInt(ram / payloadSize) Var minRam = 8 // Smallest server I'm willing to purchase to get started. If yes, kill scripts on them and buy up new ones with more ram. It is awesome from start to finish from what Im seeing. It looks at the size of the hack script I want to instance on each machine, then looks to see if I've purchased servers. I havent seen this program here on steam discussions so I want to share it. This is an old version of my purchaseServer.script. Note that all of the scripts listed require that you are using ns2. Here's an example that was dramatically sped up for me (though I take no blame for it being a terrible program). Listed below is the name of each available script and a short description of what it does. weaken(target) is about as small of a program as you can write. While I don't expect you to be at the point where you could test this, the NS1 version of this takes me ~2300 ms, and the NS2 version takes ~1 ms, which is a very noticeable difference for a small script.Īlso, the GB values should be the same between NS1 and 2. Tprint("Script completed in " + d2 + " ms.") Now, you might rightly say that ~1/3 of a second isn't that bad, and the script I wrote does nothing. The NS1 takes ~1400 ms, and the NS2 takes ~1005 MS. If I were to tweak it to use getTime(), rather than now() var q = new Date() When I run it, it typically takes ~1300 ms to run. Here's a quick script that grabs the time, sleeps for a bit, grabs the new time, and tells you how many milliseconds it took. And passed args around like they were candy. ![]() but I do understand that they aren't lying when they talk about a speed difference.ĮDIT: And then I converted all my scripts to NS2. I'm not yet interested in going down the javascript rabbit hole, and I don't actually understand the differences. This means that Netscript’s syntax is identical to that of JavaScript, but it does not implement some of the features that JavaScript has. Netscript is simply a subset of JavaScript. When you write scripts in Bitburner, they are written in the Netscript language. Holy crap, but NS2 makes a tremendous speed difference. Netscript is the programming language used in the world of Bitburner. ![]() Then I went to look at active scripts and they were all running the way I expected. If you already have some progression, you can just start off with this script. A good chunk of it is just built off the tutorials/docs. It must have terminated without telling me why." These are my core basic scripts for automating in the game Bitburner (NS2). "This can't be right! This script takes thirty seconds to run. and put await in front of the occasional hack/grow/weaken/scp that existed. However, exec in NS2 returns a true value, but does nothing. I wrote something in NS2 and was planning on using exec to restart the hack script on the newly hacked servers. But I wanted to write a replicating type hack script. (Solved) Im new to the game, so surely Im doing something wrong. I literally only prefixed the functions with ns. Netscript exec works in NS1, but not in NS2. So I did the bare minimum of work, converting my universal manipulator and universal hacker from NS1 to NS2. I don't know what an async is or why I'd await for it, but what else are you going to do? Work?" "Well, why not convert one or two of your low end scripts to NS2? It's not like you have to learn javascript. Then I found myself with time to kill while rep grinding. Feels a little like telehack but without getting bossed around by truly entrenched players." Var moneyThresh = getServerMaxMoney(target) * 0.I kicked and screamed and thought "Well, NS1 is just fine. Personally, I run this as my hacking script: var target = "joesguns" ns)? ns1 (.script) is a lot slower than ns2, albeit a lot easier to use, so it's important to run only important lines. What are you running for your hacking script? and are you using ns1 or ns2 (i.e. ![]()
0 Comments
Leave a Reply. |