Need a quick route to a particular destination? je’ve created a script that’ll give you the directions.
No more feeling like a lost tourist looking for a node again.
Commencer
This is something of a shortcut to finding some of those harder-to-reach nodes.
You might think your version 2 of the scan-analyzer might give you a way to directly connect to every node… réfléchis encore.
The scanner only goes to a range of 10 nodes and no further, which means finding the more distant nodes (jusqu'à *13* hops from home!) requires actually going a bit into the wilds and connecting further in before attempting that scan again.
I created this utility to find a path to those distant places, and to make it easier, even create a string you can cut and paste right into your terminal to take you right there.
Note, je’m not going to give away server names here.. que’s more an exercise for the reader.
Le script
/** @param {Ns} ns **/ export async function main(ns) { ns.disableLog("TOUS"); ns.tail(); var src = ns.getHostname(); var tgt = ns.args[0]; var servers = {}; var queue = [src]; var route = [tgt]; var ptr = tgt; serveurs[src] = "START"; alors que (queue.length) { var s = queue.pop(); var links = ns.scan(s); pour (var i = 0; je < links.length; i ++) { si (!serveurs[links[je]]) { queue.push(links); serveurs[links[je]] = s; } }; } alors que (ptr != src) { ptr = servers[ptr]; route.push(ptr); } route.pop(); ns.print("connecter " + route.reverse().rejoindre("; connecter ")); }[/code]
Example Usage
From home to omega-net,
[home ~/]> run find.ns omega-net
It will give you this in a window:
connect harakiri-sushi; connect max-hardware; connect omega-net
C'est tout ce que nous partageons aujourd'hui pour cela Brûleur de bits guide. Ce guide a été initialement créé et rédigé par WhiskeyFur. Si nous ne parvenons pas à mettre à jour ce guide, vous pouvez trouver la dernière mise à jour en suivant ceci lien.
Should be
queue.pousser(links[je]);