mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
Fixed bugs in purchasing/upgrading hacknet nodes in Netscript. Fixed documentation for them as well
This commit is contained in:
parent
73c07841a3
commit
ea17334792
@ -281,9 +281,9 @@ CONSTANTS = {
|
||||
"a new hacknet node then the function will return an empty string. Does NOT work offline<br><br>" +
|
||||
"<i>upgradeHacknetNode(name)</i><br> Upgrades the level of a Hacknet Node. The argument passed in must be a string with the name of the Hacknet Node to upgrade. " +
|
||||
"If the Hacknet Node is successfully upgraded the function will return true. It will return false otherwise. Does NOT work offline. Example: <br>" +
|
||||
"var node = purchaseHacknetNode();<br>" +
|
||||
"node = purchaseHacknetNode();<br>" +
|
||||
"if (node != '') {<br>" +
|
||||
" var i = 0;<br>" +
|
||||
" i = 0;<br>" +
|
||||
" while(i < 10) {<br>" +
|
||||
" if (upgradeHacknetNode(node)) {i = i + 1;}<br>" +
|
||||
" }; <br>" +
|
||||
|
@ -436,7 +436,7 @@ processSingleHacknetNodeEarnings = function(numCycles, nodeObj) {
|
||||
getHacknetNode = function(name) {
|
||||
for (var i = 0; i < Player.hacknetNodes.length; ++i) {
|
||||
if (Player.hacknetNodes[i].name == name) {
|
||||
return player.hacknetNodes[i];
|
||||
return Player.hacknetNodes[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -219,7 +219,6 @@ function Parser(input) {
|
||||
|
||||
var tok = input.next();
|
||||
if (tok.type == "var" || tok.type == "num" || tok.type == "str")
|
||||
console.log("encountered var in parse_atom");
|
||||
return tok;
|
||||
unexpected();
|
||||
});
|
||||
|
@ -31,7 +31,7 @@ function runScriptsLoop() {
|
||||
if (workerScripts[i].running == false && workerScripts[i].env.stopFlag == false) {
|
||||
try {
|
||||
var ast = Parser(Tokenizer(InputStream(workerScripts[i].code)));
|
||||
console.log(ast);
|
||||
//console.log(ast);
|
||||
} catch (e) {
|
||||
dialogBoxCreate("Syntax ERROR in " + workerScripts[i].name + ":", e, "", "");
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
|
Loading…
Reference in New Issue
Block a user