下载客户端

我的《网络骇客》新手笔记、批处理脚本与部署方案

2026-02-16 01:00:15
发布在Bitburner
转载

AI智能总结导读

这是一份《BitBurner》新手向笔记,包含游戏教程命令、help命令详解、示例黑客脚本、多线程操作说明,还有批量终止服务器脚本、批量删除脚本及部署负载脚本等实用批处理脚本,能帮助新手快速上手游戏内的骇客操作。

Useful for beginners, this guide provides: -The Tutorial Commands in order -Contents of the "help" command -Sample Hack Script -Multi-threading explanation and instructions -Batch Script for killing all scripts on all servers -Batch Script for deleting all scripts from all servers, except home -Deployment / Payload Script combo Introduction Welcome! I am a lifetime artist with over 3 decades of experience in: -Digital Painting and Graphic Design -Music Production -Lyricism -Video Editing I decided recently that I would make my own video game universe, complete with lore and stories so that I could begin to build games. Which brings me to BitBurner! I am obviously a novice, but this guide is an exact copy of the .txt notes I created while learning the game! Hoping you find some use from this! Enjoy! Important things to know: //Double "//" are used to indicate important notes/details in scripts. //The script will come first, and the notes will be below the script //Quotation marks ("") in the commands below, represent a place in the command where you should //insert your own definitions for server names and script names //For example run "YourCustomScript.exe" //is not an actual command. //if you have a script you have created, and it is saved as NUKE.exe //the command above would be run NUKE.exe //Notice the quotation marks are left out. Tutorial Commands, in order This section is just for the commands that you use while working your way through the tutorial of BitBurner! ///------ ========= Tutorial Commands ========= ------/// help //list of all available Terminal commands ls //shows files on the computer scan //shows all available network connections scan-analyze //shows more detailed information about each server scan-analyze 2 //see information about all servers that are up to two nodes away connect "server name" //Connect to designated server analyze //show useful information about hacking the server run NUKE.exe //root access script execution run "YourCustomScript.exe" //run designated script hack //attempts hacking current server grow //increases $ stored on server weaken //weaken server security level nano //create a new script nano "YourCustomScript.exe" //edit existing script free //check free ram on selected machine tail "YourCustomScript.exe" //dump script logs kill "YourCustomScript.exe" //stops a script from running The "help" command list and explanation function ///------ ========= Help Command ========= ------/// // typing "help" into your command line will dump the LONG list below alias [-g] [name="value"] Create or display Terminal aliases analyze Get information about the current machine backdoor Install a backdoor on the current machine buy [-l/-a/program] Purchase a program through the Dark Web cat [file] Display a .msg, .lit, or .txt file cd [dir] Change to a new directory check [script] [args...] Print a script's logs to Terminal clear Clear all text on the terminal cls Same as 'clear' command connect [hostname] Connects to a remote server cp [src] [dest] Copy a file download [script/text file] Downloads scripts or text files to your computer expr [math expression] Evaluate a mathematical expression free Check the machine's memory (RAM) usage grep [opts]... pattern [file]... Search for PATTERN (string/regular expression) in FILE and print results to terminal [-O] [target file] grow Spoof money in a servers bank account, increasing the amount available. hack Hack the current machine help [command] Display this help text, or the help text for a command history [-c] Display the terminal history home Connect to home computer hostname Displays the hostname of the machine kill [script/pid] [args...] Stops the specified script on the current server killall Stops all running scripts on the current machine ls [dir] [--grep pattern] Displays all files on the machine lscpu Displays the number of CPU cores on the machine mem [script] [-t n] Displays the amount of RAM required to run the script mv [src] [dest] Move/rename a text or script file nano [files...] Text editor - Open up and edit one or more scripts or text files ps Display all scripts that are currently running rm [OPTIONS]... [FILE]... Delete a file from the server run [script] [-t n] [--tail] Execute a program or script [--ram-override n] [args...] scan Prints all immediately-available network connections scan-analyze [d] [-a] Prints info for all servers up to d nodes away scp [files...] [server] Copies a file to a destination server sudov Shows whether you have root access on this computer tail [script] [args...] Displays dynamic logs for the specified script top Displays all running scripts and their RAM usage unalias [alias name] Deletes the specified alias vim [files...] Text editor - Open up and edit one or more scripts or text files in vim mode weaken Reduce the security of the current machine wget [url] [target file] Retrieves code/text from a web server // I'm sure a lot of that doesnt make sense. // But that's OK! You can use the "help" command to get more information! // I had trouble figuring out the "alias" command, so we will use it as an example! In your command line, type: "help alias" It will dump this into your window: Usage: alias [-g] [name="value"] Create or display aliases. An alias enables a replacement of a word with another string. It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following command line entry: alias nuke="run NUKE.exe" Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For example, if the following alias was set: alias worm="HTTPWorm.exe" and then you tried to run the following terminal command: run worm This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag, like this: alias -g worm="HTTPWorm.exe" Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form 'alias NAME=VALUE' on the Terminal. The 'unalias' command can be used to remove aliases. NOTE: The --all alias is reserved for removal. See!! Eazy! Simple, Sample Looped Hacking Script ///------ ================= Sample Hack Script ================= ------/// //The "await" keyword is needed for hack() / grow() / weaken() because these commands take time to //execute, unlike the others. If you forget to await these commands, you will get an exception //saying you tried to do multiple things at once, because your code will immediately finish the //function call without waiting for the operation to be done. Also important is that await can //only be used in functions marked async (note that main() is marked async). /** @param {NS} ns */ export async function main(ns) { const target = "n00dles"; // Defines the "target server", which is the server that we're going to hack. In this case, it's "n00dles" const moneyThresh = ns.getServerMaxMoney(target); // Defines how much money a server should have before we hack it. In this case, it is set to the maximum amount of money. const securityThresh = ns.getServerMinSecurityLevel(target); // Defines the minimum security level the target server can have. If the target's security level is higher than this, we'll weaken it before doing anything else if (ns.fileExists("BruteSSH.exe", "home")) { ns.brutessh(target);} // If we have the BruteSSH.exe program, use it to open the SSH Port // on the target server ns.nuke(target); // Get root access to target server while(true) { if (ns.getServerSecurityLevel(target) > securityThresh) { // If the server's security level is above our threshold, weaken it await ns.weaken(target); } else if (ns.getServerMoneyAvailable(target) < moneyThresh) { // If the server's money is less than our threshold, grow it await ns.grow(target); } else { // Otherwise, hack it await ns.hack(target); } } } // Infinite loop that continously hacks/grows/weakens the target server Multi-Threading ///------ ================= Multi-threading ================= ------/// mem "YourCustomScript.js" // This command: Checks a scripts RAM usage on a selected server // You can also view the script RAM usage at the bottom of the "Script Editor" //the "early-hack-template.js" that is provided by the tutorial uses 2.6GB of RAM, and can //run 6 threads on a 16GB server. //Now, to run our script on all of these servers, we have to do the following: //1. Use the scp command to copy our script to each server. //2. Use the connect command to connect to a server. //3. Use the run command to run the NUKE.exe program and gain root access. //4. Use the run command again to run our . //5. Repeat steps 2-4 for each server. //Here's the sequence of Terminal commands and scripts I used in order to achieve this. //The format is: "scp [scripts/files...] [server]" //KEEP IN MIND: the script/file name is the name of MY scripts. Use your own. //KEEP IN MIND: the server names are custom to your game. Use the "scan" or "scan-analyze" commands to find servers you can use. Look for servers that have high ram and do not require any open ports in order to run NUKE.exe home scp hack1tem.js n00dles scp hack1tem.js foodnstuff connect n00dles run NUKE.exe run hack1tem.js -t 1 home connect foodnstuff run NUKE.exe run hack1tem.js -t 6 //When running our scripts with the "run early-hack-template.js -t 6" command, the "-t 6" //specifies that the should be run with 6 threads. Bulk Scripts ///------ ================= Bulk Scripts ================= ------/// //Sometimes, you might need to kill all scripts on all of your servers, so you can deploy new ones //I call this script "ServerKill.js" /** @param {NS} ns */ export async function main(ns) { const targets = ["n00dles", "foodnstuff", "sigma-cosmetics", "joesguns", "hong-fang-tea", "harakiri-sushi"]; // Define the target servers for (const target of targets) { // Loop through each target server if (ns.hasRootAccess(target)) { // Check if we have root access to the target server ns.killall(target); // Kill all scripts running on the target server ns.tprint(`Killed all scripts on ${target}`); } else { ns.tprint(`No root access on ${target}. Cannot kill scripts.`); } } } //Sometimes you might need to clean up and remove bad scripts from your servers //I call this script "RemoteScriptDelete.js" /** @param {NS} ns */ export async function main(ns) { // Get all servers const servers = scanAllServers(ns); for (const server of servers) { if (ns.hasRootAccess(server) && server !== "home") { // Check if you have root access and exclude "home" ns.tprint(`Deleting scripts on ${server}...`); const scripts = ns.ls(server); // Get the list of scripts on the server for (const script of scripts) { // Exclude the script that is currently running this main script if (script !== "deleteScripts.js") { // Delete the scripts await ns.rm(script, server); ns.tprint(`Deleted ${script} from ${server}`); } } } else if (server === "home") { ns.tprint(`Skipping home server.`); } else { ns.tprint(`No root access on ${server}. Skipping...`); } } } /** @param {NS} ns */ function scanAllServers(ns) { let serversToScan = ["home"]; let scannedServers = []; while (serversToScan.length > 0) { let server = serversToScan.pop(); if (!scannedServers.includes(server)) { scannedServers.push(server); let connectedServers = ns.scan(server); for (let connected of connectedServers) { if (!scannedServers.includes(connected)) { serversToScan.push(connected); } } } } return scannedServers; } Deployments and Payloads ///------ ================= Deployments & Payloads ================= ------/// //Deployment Scripts can be used to target multiple servers, send a 2nd script, known as a payload, to each of them and execute the second script //Im sure they can do much more, but I am n00b //Deployment Script //A script that copies and executes a 2nd script "hack2tem.js" to world based servers with variety in multi-threading //I call this one "GroupHack2.js" /** @param {NS} ns */ export async function main(ns) { //Define the target servers and the # of threads to run on each const targets = { "n00dles": 1, //n00dles has 4GB ram, //hack2tem.js uses 2.65GB ram per thread "foodnstuff": 6, "sigma-cosmetics": 6, "joesguns": 6, "hong-fang-tea": 6, "harakiri-sushi": 6 //The other servers all have 16GB ram, //hack2tem.js still uses 2.65GB per thread }; for (const [target, threadCount] of Object.entries(targets)) { if (ns.hasRootAccess(target)) { // Check if you have root access to the target server ns.killall(target); // Kill any scripts currently running on the target server ns.tprint(`Killed all scripts on ${target}`); await ns.scp("hack2tem.js", target); // Copy the hack2tem.js script to the target server ns.exec("hack1tem.js", target, threadCount); // Execute the script on the target server with the specified number of threads ns.tprint(`Deployed hack1tem.js to ${target} with ${threadCount} threads`); } else { ns.tprint(`No root access on ${target}`); } } } //Payload Script //The 2nd script is deployed to designated servers by the 1st script "GroupHack2.js" //I call this script "hack2tem.js" /** @param {NS} ns */ export async function main(ns) { const target = ns.getHostname(); // Defines the target server, which is the server that this script is run on const moneyThresh = ns.getServerMaxMoney(target); // Defines how much money a server should have before we hack it // In this case, it is set to the maximum amount of money. const securityThresh = ns.getServerMinSecurityLevel(target); // Defines the minimum security level the target server can have. // If the target's security level is higher than this, we'll weaken it before doing anything else. if (ns.fileExists("BruteSSH.exe")) { ns.brutessh(target); // If we have the BruteSSH.exe program, use it to open the SSH Port on the current server } ns.nuke(target); // Get root access to target server let threads = 2; // Default value // Determine the number of threads based on the target server switch (target) { case "n00dles": threads = 1; break; case "foodnstuff": case "sigma-cosmetics": case "joesguns": case "hong-fang-tea": case "harakiri-sushi": threads = 6; break; default: ns.tprint(`No specific thread allocation for ${target}. Defaulting to ${threads} threads.`); // Assign the appropriate number of threads for each target server } while (true) { if (ns.getServerSecurityLevel(target) > securityThresh) { // Infinite loop that continuously hacks/grows/weakens the target server await ns.weaken(target, { threads }); } else if (ns.getServerMoneyAvailable(target) < moneyThresh) { // If the server's security level is above our threshold, weaken it await ns.grow(target, { threads }); // If the server's money is less than our threshold, grow it } else { await ns.hack(target, { threads }); // Otherwise, hack it } await ns.sleep(100); // Sleep for a brief moment to avoid overloading the server } }

评论

共0条评论
face
inputImg
相关阅读
最新更新

卡顿修复/启动时自动设置CPU亲和力

《迸发》是一款在八核心以上CPU上运行表现不佳的游戏,会出现严重卡顿。本指南将帮助你设置一个批处理脚本,使其在游戏启动时运行并自动设置CPU亲和力。该脚本会在后…

2026-03-20 10:000赞 · 0评论

【英/波】教程菜单

【教程菜单】 (开发中) 菜单: 主要教程: 如何开始游戏? 银行抢劫: 如何抢劫银行? 开发中内容: 帮派: 如何加入/创建帮派?

2026-04-07 10:000赞 · 0评论

游戏 堡垒之夜新手一条龙,解决服务器离线游戏不可用等问题fortnite

-

2025-09-25 09:320赞 · 0评论

新人 新手教程这一块

-

2025-08-22 13:210赞 · 0评论

新手实况教程 |16 蛇菇洞探险 海水过滤机 核反应堆 动力电池充电器碎片

转自B站玩家:电子楚门

2025-07-11 01:5118赞 · 2评论

入侵高分榜

《MINDHACK》黑客小游戏高分(作弊)快速指南,助你解锁额外内容。 困难但有趣的方式: 如果你在打字小游戏中遇到困难,比如因缺少空格、轻微的输入延迟、阅读障…

2026-03-18 22:001赞 · 0评论

如何让应用随游戏自动开启/关闭

介绍 每次玩游戏前都要打开这个应用,玩完后又得关闭,这非常烦人。为了解决这个问题,我制作了下面的批处理脚本。希望开发者将来能原生添加此功能。 要求 在自动化前将…

2026-02-19 10:000赞 · 0评论

新手教程:单位及机制详解

新手向进阶教程 0:引言 本文旨在帮助刚入坑及入坑不久的新人快速掌握游戏单位的各类定位与复杂机制。 注意:本文包含大量经验性总结,这些内容无法通过游戏面板直接获…

2026-02-19 10:000赞 · 0评论

航天模拟器 萌新不会放卫星,我来教你

什么!你居然还没有一个属于自己的卫星,我来教你

2026-01-31 15:030赞 · 0评论

我的世界 饥荒 mc 星露谷 泰拉瑞亚玩家新手教程

2026-01-03 08:080赞 · 0评论
暂无更多

最新更新

  • Bitburner 新手合约指南 — A short guide and simple working scripts for solving Bitburner Coding Contracts.…
  • Bitburner 新手脚本指南 — 这是我为《网络黑客》创建/找到的中级脚本集合。它们基于我之前指南中的许多脚本。 查找元数据 元数据基本上是无法通过数据库或数学函数推导的数据。我构建了一个元数据…
  • 为HUD(平视显示器)添加自定义数据 — 使用内置的隐藏钩子和少量脚本自定义你的状态显示界面。 探索发现 本游戏鼓励你超越用户界面和文档进行探索。你可以检查文档对象模型,甚至查看源代码本身。当你开始跳出…
  • 我的《网络骇客》新手笔记、批处理脚本与部署方案 — Useful for beginners, this guide provides: -The Tutorial Commands in order -Cont…
  • 派系与强化 — I asked for this. ㅤ * acquired only from this faction, grafting and certain gang…
  • 基础黑客网络管理器 — 一个用于管理你的黑客网络的基础代码,同时尽量避免花费过多资金 使用方法: 创建一个.js文件或.ns文件,这两种都可以,.script文件使用不同的标准,所以不…
  • 实用脚本【备份】 — I need some place to keep my very useful scripts. Feel free to copy them! Some o…
  • 简易黑客网络管理器 — 一个简单的黑客网络管理器,可高效为你购买所有黑客网络升级。 设置步骤: 1. 创建一个.js文件并粘贴以下代码 2. 输入命令:nano nameOfYourF…
  • 一些实用的别名 — 早期游戏中的一些实用别名 别名 正如游戏内帮助所述,别名功能允许用一个字符串替换另一个单词。游戏还提供了示例:alias "nuke=run NUKE.exe"…
  • 《比特燃烧者》新手黑客指南 — A short & comprehensive guide including simple working scripts for beginning…