Ir para o conteúdo
Riot Bits

Riot Bits

  • Lar
  • Notícias
  • Guias
  • Guias de vídeo
  • Notas do Patch
  • Denunciar abuso
  • Alternar formulário de pesquisa
Bitburner

Bitburner – Hacknet Manager for All Upgrades (Full Automation)

postado em 01/01/2022 Por Laingsta Sem comentários em Bitburner – Hacknet Manager for All Upgrades (Full Automation)
  • Título: Bitburner
  • Data de lançamento:
  • Desenvolvedor:
  • Editor:
Information about Bitburner is still incomplete. Por favor, ajude-nos a preencher os detalhes do jogo usando este formulário de contato.

This script will fully automate the purchase of all Hacknet upgrades in the fastest method possible. The fastest method is exponential returns awarded through selecting the cheapest upgrade at all times, therefore making your money work for you faster. Determine the cheapest upgrade, wait for funds, comprar, enxágue e repita.

Observação: RAM Usage is 5.7GB

Create ES5 Script

This script utilizes ES5 JavaScript interpreter, otherwise referenced as Netscript 1.0 meaning a file extension of .script is required.

While inside the Bitburner Terminal create a new script by typing the following:

nano nameOfYourFile.script

Exemplo: nano hacknet_infinite.script

Observação: This script requires 5.7GB of memory available

Script Code

Copy the contents of the script and save them into the new script file you just created.

//  Create Function to Return Balance
function myMoney() {
    return getServerMoneyAvailable("lar");
}

//  Disable Logging for the Following Commands Below (We Dont Want To See Them While we Wait for Our Balance to Grow)
disableLog("getServerMoneyAvailable");
disableLog("dormir");

//  Create Function to Purchase Upgrade Based on 3 Flags for Node, Item, Qty 
//  # Note Qty is not utilised but the Framework is in Place to Future Proof
function purchase(nó, item, qty){
    var node = node, item = item, qty = qty;
    
    se (item == "New Node"){
        hacknet.purchaseNode();
        print("Purchasing New Node")
    }
    se (item == "Lvl"){
        hacknet.upgradeLevel(nó , qty)
        print("Purchasing LVL Upgrade for Node: " + nó)
    }
    se (item == "BATER"){
        hacknet.upgradeRam(nó , qty)
        print("Purchasing RAM Upgrade for Node: " + nó)
    }
    se (item == "CPU"){
        hacknet.upgradeCore(nó , qty)
        print("Purchasing CPU Upgrade for Node: " + nó)
    }
}

//  Create Function to Find the Cheapest Upgrade and Set Flags to be Used by the Purchase Function
//  We will set the Default Flags to Purchase a New Node, Only to be Overwritten if a Cheaper Option is Available
function check_cheapest() {
    var new_node_cost = hacknet.getPurchaseNodeCost();
    var node = "Padrão";
    var item = "New Node";
    var qty = 1;
    var cheapest = new_node_cost;
    var node_qty = hacknet.numNodes();
    
    //  Iterate Through all Node Upgrade Options, Overwrite Flags if Cheaper Upgrade is Found
    for (var i = 0; eu < node_qty; eu++) {
        var node_lvl = hacknet.getLevelUpgradeCost(eu, 1);
        var node_ram = hacknet.getRamUpgradeCost(eu, 1);
        var node_cpu = hacknet.getCoreUpgradeCost(eu, 1);

        se (node_lvl < cheapest) {
               cheapest = node_lvl;
               node = i;
               item = "Lvl";
        }
        se (node_ram < cheapest) {
              cheapest = node_ram;
               node = i;
               item = "BATER";
        }
        se (node_cpu < cheapest) {
               cheapest = node_cpu;
               node = i;
               item = "CPU";
        }
}

    //  I am not a JavaScript Programmer so I am not Adept at String Manipulation in this Language
    //  Print a Summary Log of Cheapest Upgrade Found
    print("")
    print("Cheapest Hacknet Upgrade Available;")
    print("Node             : " + nó);
    print("Item             : " + item);
    print("Qty              : " + qty);
    print("")
    print("Current Balance  : $" + myMoney());
    print("Upgrade Cost     : $" + cheapest);
    print("")

    //  After Determining the Cheapest Upgrade we will wait for Balance to Increase Enough to Purchase (This is why we turned off logging)
    enquanto (myMoney() < cheapest) {
        print("Waiting for funds to increase")
        dormir(3000);
    }
    
    //  Call the Purchase Function
    purchase(nó, item, qty);
}

//  Run the Cheapest Upgrade Function in an Infinite Loop
while(verdadeiro) {
	check_cheapest()
}

Uso

After saving the script you can run it by typing:

run nameOfYourScript.script

Exemplo: run hacknet_infinity.script

Under the Hood

This script iterates through all upgrade options sets flags for the cheapest option and waits until there are enough funds to purchase.

Atualmente, it does not utilize the quantity function, as the cheapest option is always to purchase in single units to get your money working for you faster under the passive income method. This is why the variable Qty is set to 1 and not overwritten in the loop.

If you read through the Hacknet API on the official website there is an example script that uses a value of 10 when purchasing basic levels for Nodes. IMO buying single units will net you more money in the long run due to exponential returns from the smaller purchases of single levels.

I am not a JavaScript programmer, I went into this game with zero knowledge of this language only having a background in Python. Would appreciate it if somebody wants to do some string manipulation for me on the summary section of the script to tidy it up on fewer lines. \n\n 🙂

P.S This is not Asynchronous as there is no benefit in multi-threading this task. No matter how many resources you have your bottleneck is the bank balance. Therefore implementation through .script is not only appropriate it is optimal as it makes use of less memory-intensive commands.

Isso é tudo o que estamos compartilhando hoje para isso Bitburner guia. Este guia foi originalmente criado e escrito por Laingsta. Caso não atualizemos este guia, você pode encontrar a atualização mais recente seguindo este link.

Se você acredita que algum conteúdo deste site viola seus direitos, incluindo seus direitos de propriedade intelectual, entre em contato conosco imediatamente usando nosso formulário de contato.
Guias Tag:Bitburner

Navegação de artigos

Postagem anterior: Dark Souls III Beginner’s Tips and Tricks for the Single and Multiplayer Mode
próxima postagem: Estação Espacial 14 – Door Hacking Guide (Walls and Windows Included)

Deixe um comentário Cancelar resposta

O seu endereço de email não será publicado. Campos obrigatórios marcados com *

  • Título: Bitburner
  • Data de lançamento:
  • Desenvolvedor:
  • Editor:
Information about Bitburner is still incomplete. Por favor, ajude-nos a preencher os detalhes do jogo usando este formulário de contato.

Isenção de responsabilidade

Todo o conteúdo citado é derivado de suas respectivas fontes. Se você acha que usamos seu conteúdo sem permissão, certifique-se de entrar em contato conosco e levaremos isso a sério.
  • Sobre nós
  • Contate-nos
  • política de Privacidade
  • Termos de serviço

direito autoral © 2025 Riot Bits.

Distribuído por PressBook Notícias tema WordPress