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

라이엇 비트

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

비트버너 – 서버구매봇

에 게시됨 01/09/2022 에 의해 Meng 1 논평 ~에 비트버너 – 서버구매봇
  • 제목: 비트버너
  • 출시일:
  • 개발자:
  • 발행자:
Bitburner에 대한 정보는 아직 불완전합니다.. 이것을 사용하여 게임의 세부 정보를 입력할 수 있도록 도와주세요. 문의 양식.

This is an automated script for midgame (or SF1+ games) that buys and rebuys servers. It has editable variables for extra customization.

About this Bot

This is a bot that will:

  • Buy servers of RAM you specify (default is half your home RAM, minimum of 32GB)
  • Upload and execute a script of your choosing
  • Template for uploading additional scripts of your choosing (즉. if your main script calls 3x scripts like mine does)
  • If you have max servers (25) and they are weak (<25% of your home RAM) and have sufficient money to upgrade, it will prompt a yes/no box to upgrade them. This deletes and rebuys.

Due to the logic inside, it is quite hefty at 13.3GB of RAM required, as such it is not really suited for a very early game.

There is some basic technical knowledge required to change a few lines of code to suit your setup. Read the how-to carefully.

You can force a server rebuy by running it with the ‘f’ argument (즉. “run servers.js f”)

The Script

// Server purchasing script for Bitburner - https://danielyxie.github.io/bitburner/ , written by steamid/Meng
// Runs until satisfied, will rebuy servers money is sufficient and server is worse than 25% of ram. Run with 'f' argument to force rebuy

// 버전 1.22
// Added additional comments and MAIN_SCRIPT variable so that the code will be usable for others

export async function main(ns) {

    // ~~~~~~~~~Editable variables~~~~~~~~~~~
    const SVRNAME = "plex";             // What hostname your purchased servers will have
    const MIN_RAM = 32;                 // Minimum RAM you want to buy for a server
    const SVR_RAM_RATIO = 2;            // Target RAM for server is "집" 숫양, divided by SVR_RAM_RATIO, must = power of 2 (0.5, 1, 2, 4...). 예를 들어. '2' is 50% of home RAM
    const MAIN_SCRIPT = "breaker.js"    // Name of your main script that you want to upload
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    let currentServers = ns.getPurchasedServers();
    let ram = calculateRam();   // Calculates how much RAM to buy for the server
    let i = currentServers.length;
    const serverMax = 25;       // hardcoded max servers as of Bitburner v1.3

    // Check and ensure servers are running scripts (recover after a forced reboot)
    // if server is not running scripts, overwrite existing breaker and run.
    ns.print('Starting scripts on existing servers...')
    ~을 위한(let x = 0; 엑스 < currentServers.length; x++){
        만약에 (!ns.isRunning(MAIN_SCRIPT, currentServers[엑스])){ 
            await ns.scp(MAIN_SCRIPT, currentServers[엑스]);
            ns.exec(MAIN_SCRIPT, currentServers[엑스], 1);
        }
    };

    // Server purchase info
    const serverPriceInfoText = (ns.getPurchasedServerCost(ram) / 1000000).toFixed(2);
    ns.toast(`Server price is ${serverPriceInfoText} M`, "정보");
    ns.print(`about to start buying servers @ ${ram}gb for ${serverPriceInfoText}`);
    ns.sleep을 기다리세요(15000)
    
    // then Continuously try to purchase servers until we've reached the maximum
    while (나 < serverMax) { // Check if we have enough money to purchase a server if (ns.getServerMoneyAvailable("집") > ns.getPurchasedServerCost(ram)) {
            // if sufficient money, buy server, name it, upload scripts and exec MAIN_SCRIPT
            let hostname = ns.purchaseServer(SVRNAME + 나, ram);
            await ns.scp(MAIN_SCRIPT, hostname);
            // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            // Add any extra scripts you want to upload here, or delete the lines
            // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            await ns.scp("hackscript.js", hostname);
            await ns.scp("growscript.js", hostname);
            await ns.scp("weakscript.js", hostname);
            // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            ns.exec(MAIN_SCRIPT, hostname, 1);
            ns.toast(`Server ${hostname} was purchased`, "success")
            ++나;
        }
        또 다른 {
            ns.print(`cannot buy yet - price is `+ ns.getPurchasedServerCost(ram))
            ns.sleep을 기다리세요(20000)
        }
    } // end of while  (ns.getPurchasedServerCost(ram) * 13) ){ // if money is sufficient for upgrade..
            let areYouSure = await ns.prompt(`do you want to rebuy servers? Est Cost: $ ${((ns.getPurchasedServerCost(ram) * 25)/1000000000).toFixed(2)} B`);
            만약에 (areYouSure){
                ~을 위한 (let i = 0; 나 < currentServers.length; i ++){ // Delete all existing servers ns.killall(currentServers); ns.deleteServer(currentServers); } ns.spawn("servers.js", 1); // Kills and Restarts this script to start buy process } } ns.sleep을 기다리세요 (900000); } function calculateRam() { // Calculate how much RAM to buy for the server (set to SVR_RAM_RATIO) const myRam = ns.getServerMaxRam("집"); const maxPossRam = 1048576; // Hardcoded value for maximum purchasable server ram @ Bitburner v1.3 if (myRam > maxPossRam){return maxPossRam}
        else if (myRam <= MIN_RAM){return MIN_RAM}
        또 다른 {반품 (myRam / SVR_RAM_RATIO)};
        }
    } // end of script

사용방법

Here’s how you can use this script

  • terminal > nano “servers.js”
  • paste the below code in
  • EDIT THE CODE – Line 13 + Lines 45-50
    • Line 13: Change “breaker.js” to whatever your main script filename is that you would like to execute on the remote server.
    • Lines 45-50: If you want to upload more scripts, then amend these lines as well, if you do not need them, then delete them between the lines. Note that these will not auto-execute, they assume that your main script calls them. If you need to execute them as well, then add extra lines of
      ns.exec("yourScriptNameHere.js", hostname, 1);
  • 구하다
  • terminal > run servers.js

메모: If you do not name the file servers.js, then you amend line 70 to whatever you name the file, or the rebuy function will not work.

이것이 오늘 우리가 공유하는 모든 것입니다. 비트버너 가이드. 이 가이드는 원래 작성자가 작성하고 작성했습니다. Meng. 이 가이드를 업데이트하지 못한 경우, 다음을 수행하여 최신 업데이트를 찾을 수 있습니다. 링크.

이 사이트의 콘텐츠가 귀하의 권리를 침해한다고 생각하는 경우, 귀하의 지적 재산권을 포함하여, 문의 양식을 사용하여 즉시 문의하십시오..
가이드 태그:비트버너

탐색 후

이전 게시물: Idle Superpowers Beginner’s Guide, 팁, 그리고 트릭
다음 게시물: Thrive – Long-term Cell Stage Survival Guide

논평 (1) on “Bitburner – 서버구매봇”

  1. soyaro 라고:
    01/31/2022 ~에 4:05 오전

    I just spent multiple minutes to fix the syntax errors before I was able to understand at least parts of it. I don’t know if the website messed it up or it was user error but like this nobody can execute it. almost all ifs are commented out, 예를 들어. the linebreaks are a mess, if there are any. Multiple ; are missing. At first I thought you tried to write while else (turned out to be another commented if). Why don’t you just use let scriptArray = [“script1.js”, “script2.js”,…,”scriptn.js”]; to be used in ns.scp(scriptArray, hostname);? Does need one scp instead of 3 while uploading every amount of scripts at once. And what the heck are you trying to do in the final loop? the condition (one value multiplied by 13) would always be true if it weren’t commented out. This script would constantly spam “do you want to rebuy servers?”, probably instant-spending all the players money. Maybe you should stick to reddit with your scripts, there you’ll get instant feedback and enhancement suggestions…

    회신하다

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

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

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

부인 성명

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

저작권 © 2025 라이엇 비트.

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