Getting started
How to Write Your First Useful Script in Bitburner
Your first useful Bitburner script should copy a manual hack/grow/weaken loop you already understand—then scale it with RAM and threads.
Bitburner rewards scripts that replace clicks you already make. The first useful script is not a perfect HWGW optimizer—it is a tiny loop that targets a server you can already hack manually and repeats the actions you trust.
If you cannot explain what the script will do on a named host, you are not ready to automate. Bitburner punishes mystery scripts with silent failure and wasted RAM. Clarity first, elegance later.
Treat the editor like a notepad for a habit you already practiced. The game’s power is repetition at machine speed—not pasting a late-game batch you cannot read.
Your first script is a lab notebook entry, not a portfolio piece. Name the host, list the actions you already clicked, and translate them into ns calls one at a time while the in-game docs stay open. If an error appears, fix that line before adding the next idea. This slow translation is how Bitburner teaches you; mega-pastes skip the lesson and leave you unable to repair outages later. When money rises on one thread, you have graduated from clicking—to a loop you own. Only then is RAM a scaling tool instead of a shopping distraction.
Record the manual sequence first
Pick one server. Hack, grow, and weaken by hand until you see money and security move. Write those calls into a script in the same order. Automation should clone a proven habit, not invent a strategy you cannot debug.
Use a hostname you can actually hack with your current hacking level. Targeting a glamorous endgame server on day one teaches nothing except error messages. Weak and readable beats famous and locked.
Keep the first file short: target, loop, a few ns calls, maybe a print. If you need a guide to understand your own script, it is already too big for “first useful.”
Open in-game documentation for each function you use. API names can shift by version; the docs in your build beat any frozen blog snippet.
Run it, then scale RAM
Execute on home or a purchased server. If the script fails to launch for size, buy RAM—details in what RAM and threads buy you . Do not buy huge RAM before a five-line loop exists.
Confirm money moves with one thread before you dream about batches. A working one-thread loop is the foundation; threads are multipliers for that foundation.
When the loop is boringly reliable, add logging or a second target—still small. Faction automation and complex schedulers wait until this boredom feels like wasted potential, not until a forum says you are “behind.”
End early sessions with a rewrite-from-memory test: close the file and recreate the loop on a weak host you can hack. If you fail the test, you are still depending on paste, and more RAM will only scale confusion. Keep in-game docs open while you rebuild. Confirm money on one thread before any batch fantasy. Faction routes and optimizers wait until this boredom feels like wasted potential—not until a forum claims you are behind on GB.
First-script session
Situation: you keep clicking the same weak server. Create a script with a loop targeting that hostname, run one thread, confirm money rises, then add threads as RAM allows. Faction routes can wait until this loop is boringly reliable.
If the script errors, read the message and fix the call—do not immediately paste a different mega-script. Debugging your five lines teaches the API; swapping files teaches dependency on strangers.
End the session with a script you can rewrite from memory. That rewrite test is the real graduation. Copy-paste graduation is fake.
Only after that should you skim community helpers for ideas—and still adapt them to hosts and RAM you actually own.
Protect the owned loop before folklore. Until money rises on one thread from a script you can rewrite, ignore GB milestones, faction macros, and batch theory. Those tools amplify whatever you already have—including confusion. Keep hosts weak and readable. Keep files short. Keep docs open. Scale RAM only to add threads that still raise income on the machine that runs the payer. Everything else is optional noise wearing a progress costume.
First-script mistakes
Pasting a late-game batch script on day one. Ignoring ns documentation inside the game. Targeting servers you cannot hack yet. Treating a forum GB threshold as mandatory before any script runs. Writing a novel before a loop. Buying max RAM with no file to run. Calling a broken paste “your” script.