Fix/Unify NS1 wrapper

This commit is contained in:
Snarling
2022-08-27 20:56:12 -04:00
parent 3ee55b2918
commit 6f36e9cdc5
6 changed files with 53 additions and 113 deletions
+3 -3
View File
@@ -702,7 +702,7 @@ const base: InternalAPI<NS> = {
throw helpers.makeRuntimeErrorMsg(ctx, "Could not find server. This is a bug. Report to dev.");
}
return runScriptFromScript(Player, "run", scriptServer, scriptname, args, ctx.workerScript, threads);
return runScriptFromScript("run", scriptServer, scriptname, args, ctx.workerScript, threads);
},
exec:
(ctx: NetscriptContext) =>
@@ -718,7 +718,7 @@ const base: InternalAPI<NS> = {
throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);
}
const server = helpers.getServer(ctx, hostname);
return runScriptFromScript(Player, "exec", server, scriptname, args, ctx.workerScript, threads);
return runScriptFromScript("exec", server, scriptname, args, ctx.workerScript, threads);
},
spawn:
(ctx: NetscriptContext) =>
@@ -740,7 +740,7 @@ const base: InternalAPI<NS> = {
throw helpers.makeRuntimeErrorMsg(ctx, "Could not find server. This is a bug. Report to dev");
}
return runScriptFromScript(Player, "spawn", scriptServer, scriptname, args, ctx.workerScript, threads);
return runScriptFromScript("spawn", scriptServer, scriptname, args, ctx.workerScript, threads);
}, spawnDelay * 1e3);
helpers.log(ctx, () => `Will execute '${scriptname}' in ${spawnDelay} seconds`);