mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 22:22:26 +01:00
change asleep
This commit is contained in:
parent
05cbc25a8f
commit
d0a44a6088
@ -577,9 +577,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
throw makeRuntimeErrorMsg("asleep", "Takes 1 argument.");
|
throw makeRuntimeErrorMsg("asleep", "Takes 1 argument.");
|
||||||
}
|
}
|
||||||
workerScript.log("asleep", () => `Sleeping for ${time} milliseconds`);
|
workerScript.log("asleep", () => `Sleeping for ${time} milliseconds`);
|
||||||
return netscriptDelay(time, workerScript).then(function () {
|
return new Promise((resolve) => setTimeout(resolve, time));
|
||||||
return Promise.resolve(true);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
grow: function (hostname: any, { threads: requestedThreads, stock }: any = {}): any {
|
grow: function (hostname: any, { threads: requestedThreads, stock }: any = {}): any {
|
||||||
updateDynamicRam("grow", getRamCost(Player, "grow"));
|
updateDynamicRam("grow", getRamCost(Player, "grow"));
|
||||||
@ -715,7 +713,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
end();
|
end();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getSharePower: function(): number {
|
getSharePower: function (): number {
|
||||||
return CalculateShareMult();
|
return CalculateShareMult();
|
||||||
},
|
},
|
||||||
print: function (...args: any[]): void {
|
print: function (...args: any[]): void {
|
||||||
|
@ -178,7 +178,7 @@ function startNetscript1Script(workerScript: WorkerScript): Promise<WorkerScript
|
|||||||
const entry = ns[name];
|
const entry = ns[name];
|
||||||
if (typeof entry === "function") {
|
if (typeof entry === "function") {
|
||||||
//Async functions need to be wrapped. See JS-Interpreter documentation
|
//Async functions need to be wrapped. See JS-Interpreter documentation
|
||||||
if (["hack", "grow", "weaken", "sleep", "prompt", "manualHack", "scp", "write"].includes(name)) {
|
if (["hack", "grow", "weaken", "sleep", "prompt", "manualHack", "scp", "write", "share"].includes(name)) {
|
||||||
const tempWrapper = function (...args: any[]): void {
|
const tempWrapper = function (...args: any[]): void {
|
||||||
const fnArgs = [];
|
const fnArgs = [];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user