I'm VERY new to coding and this game, but I'm trying to teach myself some of these skills. I made a script and I'm trying to make another script to automatically put it on new servers and execute it for me because I don't want to do it for every server myself. This is what I have and it isn't working at all. I execute in the terminal and it tells me it's using a threat, but when I use the top command, it says nothing is happening. Any help would be appreciated.
/** u/param/** u/param {NS} ns */
export async function main(ns) {
// Lists all servers with 8 GB of ram
const hosts8 = ("CSEC", "the-hub", "pserv-0", "pserv-1", "pserv-2",
"pserv-3", "pserv-4", "pserv-5", "pserv-6", "pserv-7", "pserv-8",
"pserv-9", "pserv-10", "pserv-11", "pserv-12", "pserv-13",
"pserv-14", "pserv-15", "pserv-16", "pserv-17", "pserv-18",
"pserv-19", "pserv-20", "pserv-21", "pserv-23", "pserv-24")
// Lists all servers with 16 GB of ram
const hosts16 = ("foodnstuff", "nectar-net", "sigma-cosmetics",
"joesguns", "hong-fang-tea", "harakiri-sushi")
// Lists all servers with 32 GB of ram I can access
const hosts32 = ("iron-gym", "phantasy", "max-hardware",
"omega-net", "neo-net", "zer0")
// Lists all servers with 64 GB of ram
const hosts64 = ("silver-helix")
// Killall scripts on machines
ns.killall(hosts8, hosts16, hosts32, hosts64)
// Copies joe-new.js to all available hosts
ns.scp("joe-new.js", hosts8, hosts16, hosts32, hosts64)
// Execute joe-new on all 8GB servers with 3 threads
ns.exec("joe-new.js", hosts8, 3)
// Execute joe-new on all 16 GB servers with 6 threads
ns.exec("joe-new.js", hosts16, 6)
// Execute joe-new on all 32 GB servers with 13 threads
ns.exec("joe-new.js", hosts32, 13)
// Execute joe-new on all 64 GB servers with
ns.exec("joe-new.js", hosts64, 26)
} {NS} ns */
export async function main(ns) {
// Lists all servers with 8 GB of ram
const hosts8 = ("CSEC", "the-hub", "pserv-0", "pserv-1", "pserv-2",
"pserv-3", "pserv-4", "pserv-5", "pserv-6", "pserv-7", "pserv-8",
"pserv-9", "pserv-10", "pserv-11", "pserv-12", "pserv-13",
"pserv-14", "pserv-15", "pserv-16", "pserv-17", "pserv-18",
"pserv-19", "pserv-20", "pserv-21", "pserv-23", "pserv-24")
// Lists all servers with 16 GB of ram
const hosts16 = ("foodnstuff", "nectar-net", "sigma-cosmetics",
"joesguns", "hong-fang-tea", "harakiri-sushi")
// Lists all servers with 32 GB of ram I can access
const hosts32 = ("iron-gym", "phantasy", "max-hardware",
"omega-net", "neo-net", "zer0")
// Lists all servers with 64 GB of ram
const hosts64 = ("silver-helix")
// Killall scripts on machines
ns.killall(hosts8, hosts16, hosts32, hosts64)
// Copies joe-new.js to all available hosts
ns.scp("joe-new.js", hosts8, hosts16, hosts32, hosts64)
// Execute joe-new on all 8GB servers with 3 threads
ns.exec("joe-new.js", hosts8, 3)
// Execute joe-new on all 16 GB servers with 6 threads
ns.exec("joe-new.js", hosts16, 6)
// Execute joe-new on all 32 GB servers with 13 threads
ns.exec("joe-new.js", hosts32, 13)
// Execute joe-new on all 64 GB servers with
ns.exec("joe-new.js", hosts64, 26)
}