mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Implemented kill command. UNTESTED, TEST THIS WHEN YOU CAN
This commit is contained in:
@@ -68,4 +68,15 @@ function runScriptsLoop() {
|
||||
setTimeout(runScriptsLoop, 10000);
|
||||
}
|
||||
|
||||
//Queues a script to be killed by settings its stop flag to true. Then, the code will reject
|
||||
//all of its promises recursively, and when it does so it will no longer be running.
|
||||
//The runScriptsLoop() will then delete the script from worker scripts
|
||||
function killWorkerScript(scriptName, serverIp) {
|
||||
for (var i = 0; i < workerScripts.length; i++) {
|
||||
if (workerScripts[i].name == scriptName && workerScripts[i].serverIp == serverIp) {
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runScriptsLoop();
|
||||
Reference in New Issue
Block a user