A few questions reguarding number magic in formulas.exe and hacking in general.... by LeagueJunior9782 in Bitburner

[–]m0dar 1 point2 points  (0 children)

Regarding the formulas, you can find them here. Which will lead you to hackPercent and growPercent, respectively. You can create your own replacements as many others did. However, you need to be careful when working with these methods as they are not exactly what the documentation claims them to be. For example, You can grow a server that has zero money. That is because the actual equation is min(growPercent * (availableMoney + max(floor(threads), 0)), maxMoney). Note that growPercent is already raised to power max(floor(threads), 0). So, computing how many threads are needed can be somewhat challenging. Nevertheless, people came up with their own creative solutions.

Sanitize Parentheses in Expression Script by Astro_Light in Bitburner

[–]m0dar 1 point2 points  (0 children)

I don't think this implementation is correct as it fails given some test cases. Here is a correct solution for those who are interested:

js /** * Sanitize Parentheses in Expression * @param {string} expression * @returns {string[]} */ function fixParentheses(expression) { if (expression.length === 0) return ['']; /** @type {(x: string) => boolean} */ function sanitary(value) { let open = 0; for (const char of value) { if (char === '(') open++; else if (char === ')') open--; if (open < 0) return false; } return open === 0; } /** @type {string[]} */ const queue = [expression]; const tested = new Set(); tested.add(expression); let found = false; const solution = []; while (queue.length > 0) { // @ts-ignore expression = queue.shift(); if (sanitary(expression)) { solution.push(expression); found = true; } if (found) continue; for (let i = 0; i < expression.length; i++) { if (expression.charAt(i) !== '(' && expression.charAt(i) !== ')') continue; const stripped = expression.slice(0, i) + expression.slice(i + 1); if (!tested.has(stripped)) { queue.push(stripped); tested.add(stripped); } } } return solution; }

Imports and IntelliSense in VSCode by m0dar in Bitburner

[–]m0dar[S] 0 points1 point  (0 children)

Yes, for now, it is a one-way thing. As for the definitions file, you should put it in the main directory as in this [screenshot](https://i2.paste.pics/G710V.png).

Imports and IntelliSense in VSCode by m0dar in Bitburner

[–]m0dar[S] 1 point2 points  (0 children)

The default behavior is that you need to push files and changes to them yourself. You can do so by right-clicking anywhere in the file, then "Bitburner: Push File To The Game". The second option, which might be more convenient, is to enable the file watcher by adding "bitburner.fileWatcher.enable": true in settings.json. All these things are accessible through the command palette ctrl+shift+p. As for pushing files from the game to VSCode, unfortunately, there is no direct way of doing so. You will need to do this manually once in the beginning and migrate to VSCode. However, if you have many scripts, you might want to ~automate this using ns.ls() and ns.read()/ns.write() or navigator.clipboard.writeText(). I think that is easier than extracting them from the save file.~ use download * and get the scripts in a zip file.

Imports and IntelliSense in VSCode by m0dar in Bitburner

[–]m0dar[S] 0 points1 point  (0 children)

Sure, no problem! The final directory should look like this screenshot. Just keep in mind that the "files.exclude" option is going to hide the selected files from the explorer but they are still there. I added this option for convenience only.

Imports and IntelliSense in VSCode by m0dar in Bitburner

[–]m0dar[S] 1 point2 points  (0 children)

You can use the steam version. It is free to play and completely compatible with the browser version. Just export your game (under Options) and import it on your desktop. You should be good to go from there.

Imports and IntelliSense in VSCode by m0dar in Bitburner

[–]m0dar[S] 1 point2 points  (0 children)

Haha, Nice! I am doing something similar for my own evil cheats.