コンテンツにスキップ
ライオットビット

ライオットビット

  • 家
  • ニュース
  • ガイド
  • ビデオガイド
  • パッチノート
  • 不正行為を報告する
  • 検索フォームを切り替え
ビットバーナー

ビットバーナー – Optimized Hacknet Bot

ポストする 01/15/2022 に syw1 コメントはありません の上 ビットバーナー – Optimized Hacknet Bot
  • タイトル: ビットバーナー
  • 発売日:
  • 開発者:
  • 出版社:
Bitburner に関する情報はまだ不完全です. これを使用してゲームの詳細を記入するのにご協力ください。 お問い合わせフォーム.

Simple Bot that uses math to choose the most profitable upgrade.

仕組み

The bot takes the following steps.

  1. Checks cost and production growth of all the possible upgrades
  2. Calculates profitable ratio of each upgrade
  3. Sorts elements by ratio descending
  4. Chooses the first element
  5. Checks if you can purchase upgrade now, そうでない場合, it waits to collect money
  6. Checks if you can buy a new node in less than 30 秒 (you can customize this time), もしそうなら, it buys it
  7. 繰り返す…

Profitable ratio = Production growth / upgrade cost
Production growth = Production after upgrade / current production

This guide is based on my previous “Automation for Hacknet Nodes”.

使用方法

Take the following steps.

  1. Run the terminal
  2. Type ‘nano hacknet-bot.js’
  3. Copy and paste the code below into this file
  4. ファイルを保存します (Ctrl + s)
  5. Back to the terminal
  6. Type ‘run hacknet-bot.js’

/** @param {NS} ns **/
非同期関数メインのエクスポート(ns) {
	// helpers
	const getMoney = () => ns.getPlayer().お金;
	const getProd = (レベル, ram, cores) => (レベル * 1.5) * Math.pow(1.035, ram - 1) * ((cores + 5) / 6);
	// your production multiplier
	const PROD_MULTIPLIER = ns.getHacknetMultipliers().生産;
	// maximum waiting time for collecting money for new node (default 30s)
	const WAITING_TIME = ns.args[0] || 30;

	その間 (真実) {
		const ratios = [];
		let hacknetProduction = 0;
		// loop through all nodes
		for (インデックス = にしてみましょう 0; 索引 < ns.hacknet.numNodes(); インデックス++) { // get current node stats const { レベル, ram, cores, 生産 } = ns.hacknet.getNodeStats(索引); hacknetProduction += production; // get upgrades cost const levelUpgradeCost = ns.hacknet.getLevelUpgradeCost(索引); const ramUpgradeCost = ns.hacknet.getRamUpgradeCost(索引); const coreUpgradeCost = ns.hacknet.getCoreUpgradeCost(索引); // get prod. 成長 / cost ratios const levelUpgradeRatio = ((getProd(レベル + 1, ram, cores) * PROD_MULTIPLIER) - 生産) / levelUpgradeCost; const ramUpgradeRatio = ((getProd(レベル, ram * 2, cores) * PROD_MULTIPLIER) - 生産) / ramUpgradeCost; const coreUpgradeRatio = ((getProd(レベル, ram, cores + 1) * PROD_MULTIPLIER) - 生産) / coreUpgradeCost; // possible upgrades of current node const currentNodeUpgrades = [ {比率: levelUpgradeRatio, 料金: levelUpgradeCost, nodeIndex: 索引, アップグレード: "レベル"}, {比率: ramUpgradeRatio, 料金: ramUpgradeCost, nodeIndex: 索引, アップグレード: "ram"}, {比率: coreUpgradeRatio, 料金: coreUpgradeCost, nodeIndex: 索引, アップグレード: "コア"} ]; // push current node upgrades to all upgrades ratios.push(...currentNodeUpgrades); } // get the most profitable upgrade const { 料金, nodeIndex, アップグレード } = ratios.sort((ある, b) => b.ratio - a.ratio)[0];
		// wait until you have the money for upgrade
		while (getMoney() < 料金) { await ns.sleep(1); } // execute upgrade switch (アップグレード) { 場合 "レベル": await ns.hacknet.upgradeLevel(nodeIndex); 壊す; 場合 "ram": await ns.hacknet.upgradeRam(nodeIndex); 壊す; 場合 "コア": await ns.hacknet.upgradeCore(nodeIndex); 壊す; デフォルト: 続く; } // check if you can purchase new node const purchaseNodeCost = ns.hacknet.getPurchaseNodeCost(); const missingMoneyForNewNode = purchaseNodeCost - getMoney(); もし (missingMoneyForNewNode > 0 && missingMoneyForNewNode < hacknetProduction * WAITING_TIME) {
			// if you need to wait for purchase node less than WAITING_TIME (in seconds) program waits to collect money
			while (getMoney() < purchaseNodeCost) {
				await ns.sleep(1);
			}
			ns.hacknet.purchaseNode();
		}

		// sleep 1ms to prevent crash because of infinite loop
		await ns.sleep(1);
	}
}

You can customize the time of waiting for purchase node (by default 30s) by passing an additional script argument. 例えば:

run hacknet-bot.js 120

これが今日私たちがこの目的で共有するすべてです ビットバーナー ガイド. このガイドは元々、次の者によって作成および執筆されました。 syw1. このガイドを更新できなかった場合, これに従って最新のアップデートを見つけることができます リンク.

このサイトのコンテンツがあなたの権利を侵害していると思われる場合, あなたの知的財産権を含む, お問い合わせフォームを使用してすぐにご連絡ください.
ガイド タグ:ビットバーナー

ポストナビゲーション

前の投稿: Thea 2: The Shattering – All Theopedia Terrain List
次の投稿: 脱出シミュレーター – ウォレス・イン・ヨンダーランド 攻略

返信を残す 返信をキャンセル

あなたのメールアドレスは公開されません. 必須フィールドにマークが付いています *

  • タイトル: ビットバーナー
  • 発売日:
  • 開発者:
  • 出版社:
Bitburner に関する情報はまだ不完全です. これを使用してゲームの詳細を記入するのにご協力ください。 お問い合わせフォーム.

免責事項

引用されたすべてのコンテンツはそれぞれの情報源から得られています. 当社があなたのコンテンツを許可なく使用したと思われる場合, 必ずご連絡ください。真剣に対応させていただきます.
  • 私たちに関しては
  • お問い合わせ
  • プライバシーポリシー
  • 利用規約

著作権 © 2025 ライオットビット.

搭載 プレスブックニュース ワードプレスのテーマ