Change function signature

This commit is contained in:
Isaac Shoebottom 2023-11-03 14:54:10 -03:00
parent 070a48f298
commit abdcc8d682
2 changed files with 3 additions and 3 deletions

View File

@ -2,5 +2,5 @@ import {NS} from "NetscriptDefinitions";
import {executeScriptOnServerFromAnother} from "./utils"; import {executeScriptOnServerFromAnother} from "./utils";
export async function main(ns: NS) { export async function main(ns: NS) {
executeScriptOnServerFromAnother(ns, "servers/home/ramcost.ts", [], "home") executeScriptOnServerFromAnother(ns, "home", "servers/home/ramcost.ts", [])
} }

View File

@ -118,11 +118,11 @@ export function performFunctionIfCapable(ns: NS, server: string, func: CallableF
/** /**
* Executes a script on a server from another server * Executes a script on a server from another server
* @param ns Global NS object * @param ns Global NS object
* @param server The server to execute the script on
* @param script The file path of the script to execute * @param script The file path of the script to execute
* @param args The arguments to pass to the script * @param args The arguments to pass to the script
* @param server The server to execute the script on
*/ */
export function executeScriptOnServerFromAnother(ns: NS, script: string, args: any[], server: string) { export function executeScriptOnServerFromAnother(ns: NS, server: string, script: string, args: any[]) {
ns.scp(script, server); ns.scp(script, server);
performFunctionIfCapable(ns, server, ns.exec, [script, server, ...args]) performFunctionIfCapable(ns, server, ns.exec, [script, server, ...args])
ns.atExit( ns.atExit(