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
This is not ok. There is a mechanism that makes you pay ram but using map access avoids it. So the game detects that and throws an error.
im just trying to start external function
thats external part of script, weach im trying to start from another script
scripts.ns
var serverHackReq = ns.getServerRequiredHackingLevel(hostName);
var myHackLVL = ns.getHackingLevel();
if (!ns.hasRootAccess(hostName)) {
ns.print('INFO: trying to get root.');
var files = ['BruteSSH', 'FTPCrack', 'HTTPWorm', 'relaySMTP', 'SQLInject'];
//var filess = ['brutessh', 'ftpcrack', 'httpworm', 'relaysmtp', 'sqlinject'];
for (var k = 0; k < files.length; k++) {
var file = files[k];
//ns.print('INFO: file:' + file + '.exe exist:' + ns.fileExists(file+'.exe', 'home'));
if (ns.fileExists(file+'.exe', 'home')) {
//ns.eval('ns.'+file.toLowerCase()+'('+hostName+')');
//var fSName = file.toLowerCase();
ns[file.toLowerCase()](hostName);
//eval('ns.scan');
//ns[]
//ns.eval
}
}
if (ns.fileExists('BruteSSH.exe', 'home')) {
ns.brutessh(hostName);
}
if (ns.fileExists('FTPCrack.exe', 'home')) {
ns.ftpcrack(hostName);
}
if (ns.fileExists('HTTPWorm.exe', 'home')) {
ns.httpworm(hostName);
}
if (ns.fileExists('relaySMTP.exe', 'home')) {
ns.relaysmtp(hostName);
}
if (ns.fileExists('SQLInject.exe', 'home')) {
ns.sqlinject(hostName);
}
try {
ns.nuke(hostName);
ns.print('INFO: ' + hostName + ' access');
} catch {
ns.print('ERROR: ' + hostName + ' not access');
continue;
}
}
if (ns.hasRootAccess(hostName) && serverHackReq <= myHackLVL) {
hostListWithAccess.push(hostName);
}
}
return hostListWithAccess;
}[/code]
and im start from another script
try it
ns[file.toLowerCase()](hostName);
You can't do map access on the ns object. It's a special rule about this game.
You have to do specifically
ns.brutessh
ns.ftpcrack
etc.
You could also simple add this to the top of the function
ns.brutessh;ns.ftpcrack;ns.relaysmtp;ns.httpworm;ns.sqlinect
just so that the game recognizes that you WILL eventually call these functions and calculate the correct ram cost for your script.
It's an annoying side effect of the game mechanics.
you do really nice game)
Now you should be able to run