Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Change to example script

A topic by Peter Witham created 14 days ago Views: 8
Viewing posts 1 to 1
Developer

You may have noticed I made a change to the starting example script.

// Example: Hack a server
while(1) {
    const target = "vault-omega-x";
    const stolen = await ns.hack(target);
    ns.print(`Hacked ${target} for ${stolen} DWC`);
}

For those not familiar, while(1) will cause the script to loop forever until you stop it. This is a great way to keep hacking the same server. Also, a great place to start learning to adapt the script for bigger and better hacks, maybe even multiple servers!