Zum Inhalt springen
Riot-Bits

Riot-Bits

  • Heim
  • Nachricht
  • Führer
  • Videoanleitungen
  • Klebenotizzettel
  • Missbrauch melden
  • Suchformular umschalten
Bitburner

Bitburner – Hacknet Manager für alle Upgrades (Vollständige Automatisierung)

Veröffentlicht am 01/01/2022 Von Laingsta Keine Kommentare zu Bitburner – Hacknet Manager für alle Upgrades (Vollständige Automatisierung)
  • Titel: Bitburner
  • Veröffentlichungsdatum:
  • Entwickler:
  • Herausgeber:
Informationen zu Bitburner sind noch unvollständig. Bitte helfen Sie uns dabei, die Details des Spiels auszufüllen Kontaktformular.

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, kaufen, ausspülen und wiederholen.

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

Beispiel: nano hacknet_infinite.script

Notiz: 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("heim");
}

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

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

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

        Wenn (node_lvl < billigste) {
               cheapest = node_lvl;
               node = i;
               item = "LVL";
        }
        Wenn (node_ram < billigste) {
              cheapest = node_ram;
               node = i;
               item = "RAM";
        }
        Wenn (node_cpu < billigste) {
               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("Knoten             : " + Knoten);
    print("Artikel             : " + Artikel);
    print("Qty              : " + qty);
    print("")
    print("Current Balance  : $" + myMoney());
    print("Upgrade Cost     : $" + billigste);
    print("")

    //  After Determining the Cheapest Upgrade we will wait for Balance to Increase Enough to Purchase (This is why we turned off logging)
    während (myMoney() < billigste) {
        print("Waiting for funds to increase")
        schlafen(3000);
    }
    
    //  Call the Purchase Function
    purchase(Knoten, Artikel, qty);
}

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

Verwendung

After saving the script you can run it by typing:

run nameOfYourScript.script

Beispiel: 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.

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

Das ist alles, was wir heute dafür teilen Bitburner Führung. Dieser Leitfaden wurde ursprünglich erstellt und geschrieben von Laingsta. Für den Fall, dass wir diesen Leitfaden nicht aktualisieren können, Sie können das neueste Update finden, indem Sie diesem folgen Verknüpfung.

Wenn Sie der Meinung sind, dass der Inhalt dieser Website Ihre Rechte verletzt, einschließlich Ihrer geistigen Eigentumsrechte, Bitte kontaktieren Sie uns umgehend über unser Kontaktformular.
Führer Stichworte:Bitburner

Beitrags-Navigation

Vorherigen Post: Dark Souls III Beginner’s Tips and Tricks for the Single and Multiplayer Mode
Nächster Beitrag: Raumstation 14 – Door Hacking Guide (Walls and Windows Included)

Schreibe einen Kommentar Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

  • Titel: Bitburner
  • Veröffentlichungsdatum:
  • Entwickler:
  • Herausgeber:
Informationen zu Bitburner sind noch unvollständig. Bitte helfen Sie uns dabei, die Details des Spiels auszufüllen Kontaktformular.

Haftungsausschluss

Alle zitierten Inhalte stammen aus den jeweiligen Quellen. Wenn Sie der Meinung sind, dass wir Ihre Inhalte ohne Erlaubnis verwendet haben, Stellen Sie sicher, dass Sie uns erreichen, wir werden es ernst nehmen.
  • Über uns
  • Kontaktiere uns
  • Datenschutz-Bestimmungen
  • Nutzungsbedingungen

Urheberrechte © © 2025 Riot-Bits.

Bereitgestellt von PressBook News WordPress-Theme