Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
ns.tail()
ns.disableLog('ALL')
ns.enableLog('print')
ns.clearLog()
var exit = ns.args[0] || 'CSEC'
var path = []
ns.print('The path is (paste this into terminal):')
if (exit == 'home') {
ns.print('home')
return
}
if (ns.scan(exit)[0] == 'home') {
ns.print(`home; connect ${exit}`)
return
}
var scanServer = exit
while (ns.scan(scanServer)[0] != 'home') {
path.push(ns.scan(scanServer)[0])
scanServer = ns.scan(scanServer)[0]
}
path.reverse()
path.push(exit)
ns.print(`home; ${'connect ' + path.join("; connect ") + ";"}`)
}
may or may not have made my own teleport
it relies on the parent of the server being the first item in the array, then just does the parents for a while until it reaches Home
ctr = 0;
for (var server of Object.values(servers)) {
if (server.parent != null) {
for (var link of server.links) {
if (servers[link].parent == null) {
servers[link].parent = server.name
ctr++
}
}
}
}
Makes it so that doesn't seem to work.
I removed ctr=0, and changed ctr++ to ctr--
while (ctr > 0) {
for (var server of Object.values(servers)) {
if (server.parent != null) {
for (var link of server.links) {
if (servers[link].parent == null) {
servers[link].parent = server.name
ctr--
}
}
}
}
Which seems to have fixed the issue.
I use a modified (and FAR more complex) version on my game than here, so I can't really check all that easily.
Changes made:
It now WRITES instead of APPENDS to the dump file
Corrected function and library names to match in this example.
dump-trace.txt
{"error":{},"servers":{"home":{"name":"home","links":["n00dles","foodnstuff","sigma-cosmetics","joesguns","hong-fang-tea","harakiri-sushi","iron-gym","darkweb","pserv-0","pserv-2","pserv-4","pserv-6","pserv-8","pserv-10","pserv-12","pserv-14","pserv-16","pserv-18","pserv-20","pserv-22","pserv-24","pserv-26","pserv-28","pserv-30","pserv-32","pserv-34","pserv-36","pserv-38","pserv-40","pserv-42","pserv-44","pserv-46","pserv-48"],"parent":"home"},"n00dles":{"name":"n00dles","links":["home"],"parent":"home"},"foodnstuff":{"name":"foodnstuff","links":["home","nectar-net"],"parent":"home"},"nectar-net":{"name":"nectar-
...
I feel you use a different version of the lib.
let me fix that and retry.
Can you try again with the updated script and see if it works?