Przejdź do treści
Bity zamieszek

Bity zamieszek

  • Dom
  • Aktualności
  • Przewodniki
  • Przewodniki wideo
  • Opis zmian
  • Zgłoś nadużycie
  • Przełącz formularz wyszukiwania
Bitburnera

Bitburnera – Hacknet Manager for All Upgrades (Full Automation)

Wysłany dnia 01/01/2022 Przez Laingsta Brak komentarzy NA Bitburnera – Hacknet Manager for All Upgrades (Full Automation)
  • Tytuł: Bitburnera
  • Data wydania:
  • Wywoływacz:
  • Wydawca:
Informacje o Bitburner są nadal niekompletne. Pomóż nam wypełnić szczegóły gry za pomocą tego formularz kontaktowy.

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, zakup, rinse and repeat.

Notatka: 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

Przykład: nano hacknet_infinite.script

Notatka: 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("dom");
}

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

//  Create Function to Purchase Upgrade Based on 3 Flags for Node, Przedmiot, Qty 
//  # Note Qty is not utilised but the Framework is in Place to Future Proof
function purchase(węzeł, przedmiot, qty){
    var node = node, item = item, qty = qty;
    
    Jeśli (item == "New Node"){
        hacknet.purchaseNode();
        print("Purchasing New Node")
    }
    Jeśli (item == "LVL"){
        hacknet.upgradeLevel(węzeł , qty)
        print("Purchasing LVL Upgrade for Node: " + węzeł)
    }
    Jeśli (item == "BARAN"){
        hacknet.upgradeRam(węzeł , qty)
        print("Purchasing RAM Upgrade for Node: " + węzeł)
    }
    Jeśli (item == "CPU"){
        hacknet.upgradeCore(węzeł , qty)
        print("Purchasing CPU Upgrade for Node: " + węzeł)
    }
}

//  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 = "Domyślny";
    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; I < node_qty; i++) {
        var node_lvl = hacknet.getLevelUpgradeCost(I, 1);
        var node_ram = hacknet.getRamUpgradeCost(I, 1);
        var node_cpu = hacknet.getCoreUpgradeCost(I, 1);

        Jeśli (node_lvl < najtańsze) {
               cheapest = node_lvl;
               node = i;
               item = "LVL";
        }
        Jeśli (node_ram < najtańsze) {
              cheapest = node_ram;
               node = i;
               item = "BARAN";
        }
        Jeśli (node_cpu < najtańsze) {
               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             : " + węzeł);
    print("Przedmiot             : " + przedmiot);
    print("Qty              : " + qty);
    print("")
    print("Current Balance  : $" + myMoney());
    print("Upgrade Cost     : $" + najtańsze);
    print("")

    //  After Determining the Cheapest Upgrade we will wait for Balance to Increase Enough to Purchase (This is why we turned off logging)
    chwila (myMoney() < najtańsze) {
        print("Waiting for funds to increase")
        spać(3000);
    }
    
    //  Call the Purchase Function
    purchase(węzeł, przedmiot, qty);
}

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

Stosowanie

After saving the script you can run it by typing:

run nameOfYourScript.script

Przykład: 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.

Obecnie, 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.

To wszystko, co dzisiaj udostępniamy w tym celu Bitburnera przewodnik. Ten przewodnik został pierwotnie stworzony i napisany przez Laingsta. Na wypadek, gdybyśmy nie zaktualizowali tego przewodnika, możesz znaleźć najnowszą aktualizację, postępując zgodnie z tym połączyć.

Jeśli uważasz, że jakakolwiek treść na tej stronie narusza Twoje prawa, w tym Twoje prawa własności intelektualnej, prosimy o niezwłoczny kontakt za pomocą naszego formularza kontaktowego.
Przewodniki Tagi:Bitburnera

Nawigacja po wpisach

Poprzedni post: Dark Souls III Beginner’s Tips and Tricks for the Single and Multiplayer Mode
Następny post: Stacja Kosmiczna 14 – Door Hacking Guide (Walls and Windows Included)

Zostaw odpowiedź Anuluj odpowiedź

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są zaznaczone *

  • Tytuł: Bitburnera
  • Data wydania:
  • Wywoływacz:
  • Wydawca:
Informacje o Bitburner są nadal niekompletne. Pomóż nam wypełnić szczegóły gry za pomocą tego formularz kontaktowy.

Zastrzeżenie

Wszystkie cytowane treści pochodzą z odpowiednich źródeł. Jeśli uważasz, że wykorzystaliśmy Twoje treści bez pozwolenia, upewnij się, że się z nami skontaktujesz, a my potraktujemy to poważnie.
  • O nas
  • Skontaktuj się z nami
  • Polityka prywatności
  • Warunki usługi

Prawo autorskie © 2025 Bity zamieszek.

Zasilany przez Prasa Książka Aktualności Motyw WordPressa