Skip to content

cyguin/bitburner-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

180 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cyguin's Bitburner Scripts

Forked from alainbryden/bitburner-scripts - massive thanks to alainbryden for the original framework. Go star his repo.

This is a different approach from Alain's. His autopilot is a monolithic do-it-all with deep faction logic, job grinding, and study scheduling built in. Ours is a lightweight orchestrator that delegates to specialized scripts. The autopilot's job is to pick a phase, launch the right sub-scripts, detect when the BN is beatable, and advance to the next one. Each sub-script (gangs.js, bladeburner.js, work-for-factions.js, etc.) handles its own domain.

The tradeoff: less built-in intelligence (we don't grind company jobs or optimize study schedules), but clearer separation, easier to modify individual pieces, and better at the things Alain's didn't cover - BN15 darknet, BN12 recursion scaling at level 332+, a DOM-injected HUD, and v3.0.1 API compatibility. No tail window spam - status lives in the game's right sidebar.

Alain might keep his up to date long after we've wandered off to do something else. One of us has 9000+ hours in this game and it's still not a competition. Use whatever works for you.

~46% of the JS code is new or substantially rewritten as of 2026-06-29.

Quick Start

run git-pull.js
run autopilot.js

That's it. Autopilot checks if you have SF4. If not, it drops into bootstrap mode (nuke servers, buy TOR, grind toward SF4). If you do, it goes full bore: gangs, bladeburner, stocks, sleeves, darknet, the works. It will handle everything from start to BN destruction - earning faction invites, working for rep, buying augs, detecting when the BN is beatable, and advancing to the next source file.

Phase detection is smart about BN12 too. At recursion level 332 where 1.02^332 ≈ 717x difficulty, it prioritizes Stanek's Gift (which scales up with difficulty), keeps daemon in XP-only mode, and skips useless subsystems like stock market.

Aliases

alias start="run autopilot.js"
alias stop="kill autopilot.js; kill daemon.js; run kill-all-scripts.js"
alias scan="run scan.js"
alias darknet="run scan.js --darknet"
alias stock="run stockmaster.js --noisy"
alias facman="run faction-manager.js --purchase"
alias graft="run grafting-helper.js --auto"
alias analyze="run analyze-hack.js"
alias crime="run crime.js"
alias work="run work-for-factions.js --fast-crimes-only"
alias do="run run-command.js"
alias reserve="run reserve.js"

How It Works

The Loop

Autopilot runs on a 5s tick. Each tick it:

  1. Reads player state, reset info, source files
  2. Picks a phase: early (XP grind) → mid (money) → late (augs + install)
    • If you have 10+ maxed source files, it skips straight to mid - no chicken-and-egg aug problem
  3. Launches or restarts daemon, gangs, bladeburner, sleeves, etc. based on what's relevant
  4. Checks for new faction invites and auto-joins them
  5. Routes Daedalus rushing (reserves $100B, liquidates stocks, switches daemon to XP-only)
  6. Cycles daemon between XP mode and money mode on an interval
  7. Spends hacknet hashes on money
  8. Checks if the BN can be destroyed (WD hackable or bladeburner win)
  9. Checks if it's time to install augs and advance the BN

Phase Detection

Phase Triggers Daemon Mode What Runs
early Low hack/money, no augs XP-only (single hack loop) Casino, karma grind
mid Hack > 500 or money > $1B, and (augs > 0 or 10+ SFs) HWGW batch schedule Gangs, stocks, sleeves, hacknet
late Augs > 0, hack > 2000, money > $1T HWGW batch schedule + faction-manager, grafting, bladeburner

BN-Specific Behavior

BitNode Strategy Win Path What Changes
BN1 Standard Hack WD -
BN2 Standard Hack WD Gangs start immediately
BN3 Corp $50b corp valuation Corporation.js prioritized, valuation check in BN completion
BN4 Standard Hack WD Cheaper singularity API
BN5 Standard Hack WD Formulas API
BN6 Bladeburner Black Ops Daedalus BB primary win path, BB scripts prioritized
BN7 Bladeburner Black Ops Daedalus Same as BN6
BN8 Standard Hack WD Stock manipulation focus, stockmaster at $10M
BN9 Standard Hack WD Hacknet servers
BN10 Sleeves + Graft Hack WD Grafting prioritize, block install until sleeve memory maxed
BN11 Bladeburner Black Ops Daedalus $1B cap: can't buy TRP, daemon XP-only, grafting assist
BN12 Recursion Hack WD XP-only daemon, stock/bb disabled, Stanek prioritized, phase thresholds scaled by 1.02^level
BN13 Standard Hack WD Stanek fragments
BN14 Standard Hack WD IPvGO board
BN15 Darknet Hack WD TRP in Eternal Lab labyrinth, not Daedalus. Daedalus work skipped.

Every BN falls back to the standard WD hack path if the primary win condition isn't met.

Pass --generic to run the same standard loop on any BN, ignoring BN-specific strategies.

Autonomous BN Lifecycle

Autopilot handles the full install/destroy cycle without intervention:

  1. Phase detection: early → mid → late based on hack level, money, augs, and SF count
  2. Daedalus rush: When you have 10+ augs, hack >= 2500, and $100B+, it reserves money, liquidates stocks, and switches daemon to XP-only until the invite comes
  3. 4S Data waiting: Optionally delays install until 4S stock data is purchased (configured with --wait-for-4s-threshold)
  4. XP mode cycling: Daemon alternates between XP mode and money mode on a timer (--xp-mode-interval-minutes / --xp-mode-duration-minutes)
  5. BN completion detection: Checks if w0r1d_d43m0n is hackable or if bladeburner Black Ops Daedalus is done
  6. Config persistence: Settings are saved to autopilot.js.config.txt so they survive resets
  7. Destroy or Install: Tries destroyW0r1dD43m0n first (advances BN), falls back to installAugmentations (stays in same BN)

Scripts

Core (Auto-Started)

Script What It Does
autopilot.js Master orchestrator. Picks phase, manages all sub-scripts, handles Daedalus rushing, 4S waiting, XP cycling, faction invites, install/destroy cycles, and BN progression. Truly autonomous - start it and it handles everything.
monitor.js Injects a HUD into the game's right sidebar via DOM hooks. Shows BN, stats, money, scripts, gang, BB, darknet. Every row has a hover tooltip with details. No tail window needed.
daemon.js HWGW batch scheduler. Uses additionalMsec for precise timing (no sleep-based misfires). Supports XP-only, stock manipulation, looping mode, share power. Reduced to 4 max batches by default.
bootstrap.js Pre-SF4 survival mode. Nukes servers, runs basic HWGW, buys programs, grinds toward source files.
bn15-sidecar.js Hunts the World Daemon on BN15. Tracks 3 defeats for SF15.3.
sleeves-sidecar.js BN15 sleeve manager - university for hack XP early, heists for money late.
darknet.js Full BN15 automation: password cracking, network probe/mutation, stasis, cache files, phishing, stock promotion, labyrinth navigation.
darknet-virus.js Self-replicating cracker. Spreads to every reachable darknet server, learns passwords from logs via heartbleed.
darknet-looter.js 0.5GB reward collector. Opens .cache files, runs phishing, frees blocked RAM. Deployed by the virus.
labyrinth.js Navigates darknet labyrinths at depth 7+. BFS on radar data, collects caches.

Management (On-Demand or Phase-Gated)

Script Purpose
gangs.js Tasks, equipment, ascension, wanted control. Auto-ascends all members for massive stat multipliers.
stockmaster.js Trades stocks with 4S forecasts, position sizing, short selling. Liquidate mode for install prep.
bladeburner.js Skill upgrades, city switching, contracts/ops, stamina management.
faction-manager.js Scans all factions for affordable augs and buys them. Supports grafting. Runs in late phase.
work-for-factions.js Auto faction work with invite checking, faction joining, and crime efficiency. --prioritize-invites calls checkFactionInvitations and joins every eligible faction.
sleeve.js Crime/hacking/faction work assignment with shock recovery, sync, and stat training.
grafting-helper.js BN10 grafting. Auto-grafts cheapest available augs.
corporation.js BN3 corp automation. Creates divisions, hires, researches.
stanek.js Places charge+booster fragments in optimal 3x3 grid. Silently exits if gift isn't installed.
go.js BN14 IPvGO. Picks moves based on territory scoring. Only runs in late phase with interval.
crime.js Continuous crime with efficiency-ranked selection.
spend-hacknet-hashes.js Sells hashes for money, boosts servers, bladeburner/corp exchanges.
hacknet-upgrade-manager.js Upgrades hacknet nodes by ROI.
host-manager.js Buys/upgrades cloud servers based on RAM utilization.
ascend.js Pre-install prep - prioritizes home RAM, buys augs, auto-installs.

Utilities

Script What It Does
scan.js Full network tree with hack reqs, money, security, RAM. Pass --darknet for BN15.
analyze-hack.js Best hack targets ranked by $/sec.
stats.js One-shot player overview (tprint-based, not persistent - use monitor.js for live HUD).
git-pull.js Self-updates from this repo.
run-command.js Run arbitrary ns expressions: run run-command.js ns.getPlayer()
grep.js Search script contents: run grep.js --search hacknet
farm-intelligence.js Int XP farming.
cleanup.js Remove /Temp/ files.
cheat-tool.js Dev menu --dev, bypass --bypass, reality --reality, rainbow --rainbow. Exposed intentionally by the game devs.
kill-all-scripts.js Kill everything, everywhere.
reserve.js Set money reserve: run reserve.js 10b
casino.js Blackjack with save-scumming.
sync-scripts.js Push scripts to purchased servers.

Remote Scripts (Remote/)

Spawned by daemon.js. These all use additionalMsec for timing so the game engine knows the expected completion time upfront.

Script Does
hack-target.js Single hack with stock flag
grow-target.js Single grow with stock flag
weak-target.js Single weaken
share.js Continuous share loop
manualhack-target.js Continuous hack loop

Task Scripts (Tasks/)

Script Purpose
contractor.js 26 coding contract solvers, lazy-loaded to Temp/
crack-host.js Open ports + nuke
backdoor-all-servers.js Backdoor everything accessible
ram-manager.js Buy/upgrade home RAM and cloud servers
tor-manager.js Buy TOR + darkweb programs
program-manager.js Create programs via singularity
run-with-delay.js Run a script after N ms
write-file.js Write content to a file

The HUD

monitor.js injects data into the game's built-in overview panel. No tail window, no popup, no terminal spam.

You get 10 compact rows, every one with a hover tooltip:

Row Shows Hover for
BN Current BN + phase Full SF list
Stats Hack level All combat stats + int + XP/sec
Money Cash Income/sec, home RAM %, cloud servers
Stocks Portfolio value Only visible when > 0
Augs Aug count / faction count Faction names
Time Time since install BN entry time, karma, city
Procs Running process count Per-script status
Gang Respect + territory% Income, power, members, wanted
BB Bladeburner rank SP, current action
Hacknet Nodes and $/s Total production

BN15 - Dark Net

The Red Pill is not sold by Daedalus on BN15. It's found in the Eternal Lab (5th darknet labyrinth, depth 29, 3000+ charisma). You navigate through 4 prior labyrinths (Normal → Cruel → Merciless → Uber) before reaching Eternal Lab for TRP.

labyrinth.js handles maze navigation using ns.dnet radar BFS from any server. bn15-sidecar.js tracks 3 World Daemon defeats for SF15.3 after TRP is installed.

The autopilot automatically skips Daedalus work on BN15 and focuses on darknet scripts.

The darknet.js script handles the rest of the BN15 experience:

  • Password cracking - All 24+ models solved by crackers.js as a shared module (single source of truth, imported by all 4 darknet scripts)
  • Network navigation - probes neighbors, tracks mutation events, induces migration on shallow servers
  • Memory reallocation - frees blocked RAM on authenticated servers
  • Cache files - auto-opens .cache for money, shares, programs, contracts
  • Heartbleed - extracts password hints from logs
  • Phishing - scheduled attacks for charisma XP and cache files
  • Stock promotion - boosts volatility on held stocks
  • Labyrinth - auto-navigates at depth 7+ via radar BFS

BN12 - The Recursion

BN12 is unique: every destroy makes the next run harder by 1.02^level. All progress values (money, XP, rep) shrink, all costs grow. At level 332, that's 1.02^332 ≈ 717x.

Autopilot handles this by:

  • Scaling phase thresholds so you can actually leave early phase
  • Prioritizing Stanek's Gift - it scales up with difficulty (the game's compensation mechanic)
  • Keeping daemon in XP-only - server money caps shrink quadratically, HWGW is useless
  • Disabling stock and bladeburner - both get double-squeezed by the multipliers
  • Speeding up install cycles - countdown scales inversely, you install with roughly 1 aug

Configuration

Per-Script Config

Create scriptname.js.config.txt to override defaults:

{
  "reserve": 1000000000,
  "interval": 10000
}

CLI flags override config, config overrides source defaults.

Money Reservation

run reserve.js 1b

All auto-spenders (stockmaster, gangs, hacknet, etc.) check this.


BitNode Progression

Default order prioritizes unlocking key features first, then maxing levels:

 4.1 → 4.2 → 4.3    (Singularity)
 1.1 → 1.2 → 1.3    (Source Genesis)
 5.1 → 5.2 → 5.3    (Intelligence)
 2.1 → 2.2 → 2.3    (Gangs)
10.1 → 10.2 → 10.3  (Sleeves + Grafting)
 8.1 → 8.2 → 8.3    (Stocks)
15.1 → 15.2 → 15.3  (Dark Net)
13.1 → 13.2 → 13.3  (Stanek)
 7.1 → 7.2 → 7.3    (Bladeburner)
 9.1 → 9.2 → 9.3    (Hacknet)
14.1 → 14.2 → 14.3  (IPvGO)
 6.1 → 6.2 → 6.3    (Bladeburner alt)
11.1 → 11.2 → 11.3  (Big Crash)
 3.1 → 3.2 → 3.3    (Corporations)
12.9999              (Recursion)

Override with run autopilot.js --next-bn 6.1.


Architecture

RAM Optimization

Scripts import only what they need:

Module Contents RAM
format.js Number/money/ram/duration formatting Minimal (no NS calls)
state.js Player state, source files, configuration Per-function NS cost
async.js Async utilities, retry, dynamic run Per-function NS cost
crackers.js BN15 darknet password solvers (all models) Single copy, imported by 4 scripts

A utility script like scan.js only imports format.js + state.js - it never pays for async.js functions it doesn't call.

Darknet Password Cracking (crackers.js)

BN15's password models are solved by a single shared module instead of four independent copies. Every solver returns the full ordered list of candidate passwords — callers try them all in one pass without an artificial attempt cap.

The old model (per-file copies, deleted):

Each of the 4 darknet scripts (darknet.js, darknet-virus.js, crack-ui.js, labyrinth.js) maintained its own copy of every password strategy. Bug fixes had to be applied independently in all 4 files and never stayed in sync. Each strategy was shaped as (hint, len, attempt, data) → oneGuess. Callers passed an incrementing attempt counter and gave up after 3 tries, regardless of whether the correct answer was candidate #4 in the solver's internal list.

The new model (crackers.js):

A single getCandidates(modelId, hint, len, data) function returns the full array of plausible passwords, most likely first. Callers simply:

for (const pw of getCandidates(model, hint, pwLen, data)) {
    if (await dnet.authenticate(host, pw)) break;
}

No attempt counter, no 3-try ceiling. dnet.authenticate() has no cooldown — there was never a reason to ration guesses.

Bugs eliminated by the refactor:

  • CloudBlare(tm): Hardcoded .slice(0, 6) in one copy truncated passwords to 6 chars instead of using the actual password length. The other copies were correct. Now there's one copy, and it uses the real length.
  • Laika4: Indexing dogs[attempt] and returning the name at that index even if it didn't match the required password length. The fallback was always "fido" regardless of length. Now the list is filtered to matching lengths upfront before any candidate is returned.
  • PHP 5.4: Returned the sorted digit string (no permutation attempt) when the input was longer than 4 digits, even when the password was clearly a permutation of those digits. Now the full permutation set is generated and tried in order, with the input length cap raised from 4 to 6 (practical limit for factorial growth).
  • PR0verFL0: Returned "A".repeat(len) in two copies and a real word list in the other two. Now all copies get the same word list.
  • OpenWebAccessPoint: Three extra packet-sniffing patterns (--word--, Connecting to host:word, passcode: word.) were only implemented in crack-ui.js and never made it into the other three scripts. Now all four use the merged pattern set from getCandidates.
  • AccountsManager_4.2, NIL, Factori-Os, 2G_cellular: Same fragmentation across copies — one file returned something useful while the others returned "" or a useless default.

Where the model doesn't fully apply:

AccountsManager_4.2 (number guessing game) and 2G_cellular (timing side-channel) are interactive puzzles that need live feedback between guesses — they don't fit a static-candidate-list contract. getCandidates returns a reasonable spread of guesses across the range for AccountsManager, but the real fix for both is a dedicated interactive solver that reads authenticate() response text before generating the next guess.

Batch Scheduling

Daemon runs 4 overlapping HWGW batches per target using additionalMsec for timing. The game engine knows the expected completion time upfront, so no sleep-induced misfire.


Requirements

  • Bitburner v3.0.1+
  • Most scripts need SF4 (Singularity) for full automation
  • Casino needs ns.casino access (not available in all BNs)
  • Darknet features need BN15 access (SF15 or DarkscapeNavigator.exe)

Links

About

Custom Bitburner scripts with BN15 (Dark Net) support, optimized HWGW batching, and BN12 recursion scaling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors