mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
(feat) optional threads argument to netscript functions hack, weaken, grow
This commit is contained in:
committed by
danielyxie
parent
585e1ac7aa
commit
44c26165f4
@@ -219,9 +219,17 @@ function startNetscript1Script(workerScript) {
|
||||
name === "prompt" || name === "run" || name === "exec") {
|
||||
let tempWrapper = function() {
|
||||
let fnArgs = [];
|
||||
|
||||
//All of the Object/array elements are in JSInterpreter format, so
|
||||
//we have to convert them back to native format to pass them to these fns
|
||||
for (let i = 0; i < arguments.length-1; ++i) {
|
||||
fnArgs.push(arguments[i]);
|
||||
if (typeof arguments[i] === 'object' || arguments[i].constructor === Array) {
|
||||
fnArgs.push(int.pseudoToNative(arguments[i]));
|
||||
} else {
|
||||
fnArgs.push(arguments[i]);
|
||||
}
|
||||
}
|
||||
console.log(fnArgs);
|
||||
let cb = arguments[arguments.length-1];
|
||||
let fnPromise = entry.apply(null, fnArgs);
|
||||
fnPromise.then(function(res) {
|
||||
|
||||
Reference in New Issue
Block a user