From abdcc8d6820cdfa335914e3b2e50877bad8c97e9 Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Fri, 3 Nov 2023 14:54:10 -0300 Subject: [PATCH] Change function signature --- servers/home/ramcost.ts | 2 +- servers/home/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/home/ramcost.ts b/servers/home/ramcost.ts index 48cc058..1a54bd4 100644 --- a/servers/home/ramcost.ts +++ b/servers/home/ramcost.ts @@ -2,5 +2,5 @@ import {NS} from "NetscriptDefinitions"; import {executeScriptOnServerFromAnother} from "./utils"; export async function main(ns: NS) { - executeScriptOnServerFromAnother(ns, "servers/home/ramcost.ts", [], "home") + executeScriptOnServerFromAnother(ns, "home", "servers/home/ramcost.ts", []) } \ No newline at end of file diff --git a/servers/home/utils.ts b/servers/home/utils.ts index 3cbec04..72ac75e 100644 --- a/servers/home/utils.ts +++ b/servers/home/utils.ts @@ -118,11 +118,11 @@ export function performFunctionIfCapable(ns: NS, server: string, func: CallableF /** * Executes a script on a server from another server * @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 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); performFunctionIfCapable(ns, server, ns.exec, [script, server, ...args]) ns.atExit(