콘텐츠로 건너뛰기
라이엇 비트

라이엇 비트

  • 집
  • 소식
  • 가이드
  • 비디오 가이드
  • 패치 노트
  • 남용 신고
  • 검색 양식 전환
비트버너

비트버너 – 최적화된 Hacknet 봇

에 게시됨 01/15/2022 에 의해 syw1 코멘트 없음 ~에 비트버너 – 최적화된 Hacknet 봇
  • 제목: 비트버너
  • 출시일:
  • 개발자:
  • 발행자:
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, if not, 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 + 에스)
  5. Back to the terminal
  6. Type ‘run hacknet-bot.js’

/** @param {NS} ns **/
비동기 함수 메인 내보내기(ns) {
	// helpers
	const getMoney = () => ns.getPlayer().돈;
	const getProd = (수준, ram, 코어) => (수준 * 1.5) * Math.pow(1.035, ram - 1) * ((코어 + 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 (let index = 0; index < ns.hacknet.numNodes(); index++) { // get current node stats const { 수준, ram, 코어, 생산 } = ns.hacknet.getNodeStats(index); hacknetProduction += production; // get upgrades cost const levelUpgradeCost = ns.hacknet.getLevelUpgradeCost(index); const ramUpgradeCost = ns.hacknet.getRamUpgradeCost(index); const coreUpgradeCost = ns.hacknet.getCoreUpgradeCost(index); // get prod. 성장 / cost ratios const levelUpgradeRatio = ((getProd(수준 + 1, ram, 코어) * PROD_MULTIPLIER) - 생산) / levelUpgradeCost; const ramUpgradeRatio = ((getProd(수준, ram * 2, 코어) * PROD_MULTIPLIER) - 생산) / ramUpgradeCost; const coreUpgradeRatio = ((getProd(수준, ram, 코어 + 1) * PROD_MULTIPLIER) - 생산) / coreUpgradeCost; // possible upgrades of current node const currentNodeUpgrades = [ {비율: levelUpgradeRatio, 비용: levelUpgradeCost, nodeIndex: index, 치받이: "수준"}, {비율: ramUpgradeRatio, 비용: ramUpgradeCost, nodeIndex: index, 치받이: "ram"}, {비율: coreUpgradeRatio, 비용: coreUpgradeCost, nodeIndex: index, 치받이: "core"} ]; // push current node upgrades to all upgrades ratios.push(...currentNodeUpgrades); } // get the most profitable upgrade const { 비용, nodeIndex, 치받이 } = ratios.sort((에이, 비) => b.ratio - a.ratio)[0];
		// wait until you have the money for upgrade
		while (getMoney() < 비용) { ns.sleep을 기다리세요(1); } // execute upgrade switch (치받이) { 사례 "수준": ns.hacknet.upgradelevel을 기다립니다(nodeIndex); 부서지다; 사례 "ram": ns.hacknet.upgraderam을 기다립니다(nodeIndex); 부서지다; 사례 "core": 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) {
				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
다음 게시물: 탈출 시뮬레이터 – Yonderland의 Wallace

답장을 남겨주세요 답장 취소

귀하의 이메일 주소는 공개되지 않습니다. 필수 입력란이 표시되어 있습니다 *

  • 제목: 비트버너
  • 출시일:
  • 개발자:
  • 발행자:
Bitburner에 대한 정보는 아직 불완전합니다.. 이것을 사용하여 게임의 세부 정보를 입력할 수 있도록 도와주세요. 문의 양식.

부인 성명

인용된 모든 콘텐츠는 해당 소스에서 파생됩니다.. 귀하의 콘텐츠를 허가 없이 사용했다고 생각되는 경우, 우리에게 연락하면 진지하게 받아 들일 것입니다..
  • 회사 소개
  • 문의하기
  • 개인 정보 정책
  • 서비스 약관

저작권 © 2025 라이엇 비트.

에 의해 구동 프레스북 뉴스 WordPress 테마