mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 11:10:58 +02:00
NETSCRIPT: Add "temporary" as a RunOption to run/exec/spawn (#432)
This commit is contained in:
@@ -12,6 +12,8 @@ import { isValidIPAddress } from "../utils/helpers/isValidIPAddress";
|
||||
import { SpecialServers } from "./data/SpecialServers";
|
||||
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
|
||||
|
||||
import type { RunningScript } from "../Script/RunningScript";
|
||||
|
||||
/**
|
||||
* Map of all Servers that exist in the game
|
||||
* Key (string) = IP
|
||||
@@ -206,10 +208,17 @@ function excludeReplacer(key: string, value: any): any {
|
||||
return value;
|
||||
}
|
||||
|
||||
function scriptFilter(script: RunningScript): boolean {
|
||||
return !script.temporary;
|
||||
}
|
||||
|
||||
function includeReplacer(key: string, value: any): any {
|
||||
if (key === "logs") {
|
||||
return [];
|
||||
}
|
||||
if (key === "runningScripts") {
|
||||
return value.filter(scriptFilter);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user