Scripts for Bitburner.
Hi! Welcome, please look around. You are absolutely welcome and free to copy/paste, fork, splat, or whatever. The initial startup script and copy-paste instructions below I borrowed from https://github.com/moriakaice/bitburner/tree/master. That repo (at the time of this edit) doesn't work out of the box, but they're trying to be pretty new-player friendly. I recommend checking it out.
This repo.... is not especially new-player-friendly. If you want to take my repo whole-hog and run it in your own game (following the instructions below), it is unlikely to work unless you've been playing for a while. I started this repo primarily for myself, and the code makes some assumptions about certain features that are not available to new players. I also assume that there is at least 32GB of ram on your home computer, which is not immediately available to new players.
Also, be aware, I am not primarily a Javascript programmer, though it is something I enjoy playing with. I don't follow best practices in the industry for this language. If somebody says that the way I did something was not good, it probably is not good and trust other resources before you trust my code for the best way if you're learning.
Good luck, and have fun out there.
- This is an unstable repo. I regularly push untested code. I'm a rebel, I know.
- This is an unstable repo. I change method signatures for the hell of it. Depend on nothing.
- I'm a flake. If I haven't commited in a few weeks, it probably means I'm bored or got stuck and found something else to play with.
- This does not work for new players. This repo uses methods that are locked behind game mechanics.
- This contains spoilers. If you don't like spoilers, well... I warned you.
Create a new script called start.js by issuing the following command: nano start.js. Make sure you are on your home server; if you are not you can quickly go home by running home in the console.
Paste the following content:
exportasyncfunctionmain(ns){if(ns.getHostname()!=="home"){thrownewException("Run the script from home");}letargs=ns.flags([['branch','main']])awaitns.wget(`https://raw.githubusercontent.com/Mac2/bitburner-scripts/${args.branch}/src/initStartup.js?ts=${newDate().getTime()}`,"initStartup.js");ns.spawn("initStartup.js",1,'--branch',args.branch);}Save and exit nano and write in console: run start.js then press enter.
// startup everything. If you've run this at least once and want to skip// downloading/overwriting files, do `run startup/run.js` insteadaliasstart="run start.js"// run arbitrary ns processes and helper functions, see doProcess for examplesaliasdo="run doProcess.js"// connect to any server by namealiasfind="run find.js"// get server data about what the best server to hack might be right nowaliasbest="run bestHack.js"// quickly tail the first personal server's moneymaking scriptaliastail0="connect pserv-0; tail breadwinner.js; home"// manipulate localStoragealiasget="run lsGet.js"aliasset="run lsSet.js"// force crime.js/workForFactions.js to stop, so you can play in-gamealiasworking="run lsSet.js working"aliasdone="run lsClear.js working"// set a reserve amount manually, above reserved money for buying programsaliasreserve="run lsSet.js reserve"// set a reserve amount of RAM on HOME, to ensure script exectionaliasreserveRam="run lsSet.js reserveRam"// set text search in filesaliasgrep="run grep.js"