Need a quick route to a particular destination? I’ve created a script that’ll give you the directions.
No more feeling like a lost tourist looking for a node again.
시작하기
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… think again.
The scanner only goes to a range of 10 nodes and no further, which means finding the more distant nodes (최대 *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.
메모, I’m not going to give away server names here.. that’s more an exercise for the reader.
The Script
/** @param {NS} ns **/ 비동기 함수 메인 내보내기(ns) { ns.disableLog("모두"); ns.tail(); var src = ns.getHostname(); var tgt = ns.args[0]; var servers = {}; var queue = [src]; var route = [tgt]; var ptr = tgt; servers[src] = "START"; ~하는 동안 (queue.length) { var s = queue.pop(); var links = ns.scan(에스); ~을 위한 (var i = 0; 나 < links.length; i++) { 만약에 (!servers[links[나]]) { queue.push(links); servers[links[나]] = s; } }; } ~하는 동안 (ptr != src) { ptr = servers[ptr]; route.push(ptr); } route.pop(); ns.print("연결하다 " + route.reverse().join("; 연결하다 ")); }[/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
이것이 오늘 우리가 공유하는 모든 것입니다. 비트버너 가이드. 이 가이드는 원래 작성자가 작성하고 작성했습니다. WhiskeyFur. 이 가이드를 업데이트하지 못한 경우, 다음을 수행하여 최신 업데이트를 찾을 수 있습니다. 링크.
Should be
queue.push(links[나]);