Bitburner

Bitburner

View Stats:
Belaslav May 11, 2023 @ 11:29am
Use of BasicHGWOptions?
The docs mention BasicHGWOptions for functions hack, grow and weaken. I'm not sure how to use this (I don't have a lot of experience with JavaScript), and I cannot find an example online. Has anyone used this? Thanks.

Docs: https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.basichgwoptions.md
Originally posted by quacksouls:
You need to pass an object containing the various options. Here's an example:
/** @param {NS} ns */ export async function main(ns) { const host = "n00dles"; const delay = 100; // milliseconds await ns.hack(host, { additionalMsec: delay, stock: true }); }
Search online for JavaScript tutorials. Here's one that's tied to Bitburner:
https://github.com/quacksouls/lyf
< >
Showing 1-1 of 1 comments
The author of this thread has indicated that this post answers the original topic.
quacksouls May 11, 2023 @ 6:03pm 
You need to pass an object containing the various options. Here's an example:
/** @param {NS} ns */ export async function main(ns) { const host = "n00dles"; const delay = 100; // milliseconds await ns.hack(host, { additionalMsec: delay, stock: true }); }
Search online for JavaScript tutorials. Here's one that's tied to Bitburner:
https://github.com/quacksouls/lyf
< >
Showing 1-1 of 1 comments
Per page: 1530 50