Bitburner

Bitburner

61 个评价
Bitburner Scripts for Dummies
由 Zac Starfire 制作
This is a collection of intermediate level scripts I have created/found for Bitburner. They are based on many of the scripts in my previous guides.
2
   
奖励
收藏
已收藏
取消收藏
Lookup Metadata
Metadata is basically data that cannot be derived by database or mathematical function. I’ve built out a metadata structure for lookup of a company’s server or stock symbol to company name or server name or visa versa. This is data that cannot be derived from the game itself directly. I’ve included all companies as well as their servers and stock symbols. Think of it as kind of an in-memory mini database for a script. All you need is one property of a company and you can look up its other two properties. Many of the following scripts require this data to function properly. I recommend integrating it to your own scripts as it is very useful and it takes some effort to create a functioning metadata structure.




To us the metadata, simply add this line to the very top of your script outside of the main() function:

import { companyMeta } from '/scripts/companyMeta.js';

Now to access the data, you can use these example blocks of code:

for (const company of companyMeta) { let companyName = company.companyName; let serverName = company.serverName; let stockSymbol = company.stockSymbol; … the rest of your code … }

To do a search in Metadata you can use:

const company = companyMeta.find(company => company.stockSymbol === stockSumbol);

Just substitute what property you're looking up for ‘company.stockSymbol’ and replace ‘stockSumbol’ with the property to search for.

To sort the array of companies by max money you can use this block of code:

for (const company of companyMeta) { // Add the company’s max money to the company’s structure if (company.serverName != 'NoServer') company.maxMoney = ns.getServerMaxMoney(company.serverName); } let orderedCompanies = companyMeta.sort((a, b) => { return b.maxMoney - a.maxMoney; });

And to display it you would do:

for (const company of orderedCompanies) { ns.tprint(`Company: ${company.companyName}`); ns.tprint(`Max Money: ${company.maxMoney}`); }

or

orderedCompanies.forEach((company) => {ns.tprint(`${company.companyName} ${company.maxMoney}`);


You can download the complete Bitburner Company Metadata script from Github:
https://github.com/zacstarfire/bitburner/blob/main/scripts/companyMetadata.js
Function Library
A Function Library is a library of functions common to a group of programs to avoid duplicating code and provide a central file for ease of maintenance. lib.js currently only contains 2 functions for formatting displayed money correctly, but I’m sure it will grow in time as I produce more complex scripts.



https://github.com/zacstarfire/bitburner/blob/main/scripts/lib.js
Improved Stock Trader with Stock Growing

------------------------------------------------------------------------------------------------
Stock Trader Code:
https://github.com/zacstarfire/bitburner/blob/main/stocks/stockTrader.js

Helper Script:
https://github.com/zacstarfire/bitburner/blob/main/stocks/growStock.js

Note:
This script requires companyMetadata.js and lib.js from above.
Auto Infiltrator

*** UPDATED ***

Updated Version By fallouthirteen (Build V2 Alpha?):
https://raw.githubusercontent.com/cPetros/bitburner/patch-1/scripts/infiltrate.js

Original Script that was being maintained on Reddit by Unknown:
https://github.com/zacstarfire/bitburner/blob/main/scripts/infiltrate.js
Improved Connection Script - rconnect
60 条留言
Discordman 5 月 29 日 下午 11:44 
Auto Infiltrator is detected by game.
SimpingPanam 3 月 15 日 下午 6:00 
fallouthirteens Auto Infiltrator gets you auto hospitalized bcs the minigames seem to detect the attemp considering the "You were hispitalized! Do not try to automate infiltration!" msg. ":D :steamthis:
Long Knight 2024 年 12 月 8 日 下午 6:46 
Thanks Much!
Zac Starfire  [作者] 2024 年 12 月 8 日 下午 6:02 
@Long Knight - I'll see what I can do in a few weeks and try to get back into the game. There has been many updates to Bitburner so yes, all the guides could use a major update. Just give me a bit of time, I have many new projects going on, but I should be able to have time to bring this one back to life. Thx. :Dune:
Long Knight 2024 年 10 月 30 日 下午 9:13 
I am new to the game, I love your guides, but please update them. Both your infiltrate script is broken and your stock trader crashes with errors like: of threats < 0 and
"run: threads should be a positive integer, was 785.0496988121264", though I love the advancements in it.
hpf3 2024 年 7 月 31 日 下午 3:04 
seems like the new automation detection measures broke it
Mithrun 2024 年 5 月 31 日 上午 3:57 
fixed it, infiltration.js working in game v2.6.1 is at https://github.com/herrxyz/Bitburner
Mithrun 2024 年 5 月 26 日 下午 12:57 
additional, in the version where you can select "auto" and "rep" or "money", it doens't autoselect "faction rep" as expected
run infiltrate.js --faction Daedalus --auto true
doesnt select reward
Mithrun 2024 年 5 月 26 日 上午 3:13 
there is a problem in version 2.6.1 with infiltratescrit in part "enter the code", it only enters 1 char instead of all
[SLA] Creator of Death 2024 年 3 月 30 日 下午 6:58 
"With the match symbols" infiltration
How would you change the code to use arrow keys insead of numpad if your on laptop or lack numpad?