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(