Bitburner

Bitburner

View Stats:
aerouge Mar 6, 2023 @ 1:01am
Have a script write on Commandline?
Hy guys,
I recently stumbled upon scripts to automate Mouseclicks and make bank in the casino.

This got me wondering... is there a way to write/execute stuff on the terminal (without meta-unlocks)?
Originally posted by Bugs Bunny:
The official documentation actually has an example of this.

https://bitburner.readthedocs.io/en/latest/netscript/advancedfunctions/inject_html.html

It's an exploit though, not exactly in the spirit of the game.. but so is abusing the casino so w/e :P
< >
Showing 1-15 of 23 comments
A moderator of this forum has indicated that this post answers the original topic.
Bugs Bunny Mar 6, 2023 @ 6:45am 
The official documentation actually has an example of this.

https://bitburner.readthedocs.io/en/latest/netscript/advancedfunctions/inject_html.html

It's an exploit though, not exactly in the spirit of the game.. but so is abusing the casino so w/e :P
Last edited by Bugs Bunny; Mar 6, 2023 @ 6:46am
Zac Starfire Mar 6, 2023 @ 7:47am 
The auto infiltrator script I use does that:

https://steamcommunity.com/sharedfiles/filedetails/?id=2943192013

React (which Bitburner is written in) allows you to build UI interfaces in HTML and Javascript and turn it into a .exe, so you just have to hook into the UI using your script in Bitburner.

IE:
const wnd = eval("window");
const doc = wnd["document"];

Check out the web version of Bitburner:

https://danielyxie.github.io/bitburner/
Last edited by Zac Starfire; Mar 6, 2023 @ 8:59am
Zac Starfire Mar 6, 2023 @ 8:24am 
Here is a casino coin flip example that changes how random numbers can be changed in the game - but use at your own risk - it may cause other problems (anything using the 'number' variable), so this is just an example.

/** @param {NS} ns */
export async function main(ns) {
Math.floor = (number) => { return 1 };

Math.random = () => { return 0 };

await ns.sleep(2000);
}

(number) is the variable the coin flip in the casino stores its random value to head or tails.

Beware this may change, so you have to check the game source to see what the current variable for 'number' is being used in the version of Bitburner your running.

You could modify it using the examples from the link Deicide provided - it shows basically how to capture the mouse clicks - then it would be automatic when you go to the casino screen.
Last edited by Zac Starfire; Mar 6, 2023 @ 8:41am
Zac Starfire Mar 6, 2023 @ 8:30am 
Here is a guide on how you can change the Overview window stats for a 'non-cheating' example:

https://steamcommunity.com/sharedfiles/filedetails/?id=2680734426
Last edited by Zac Starfire; Mar 6, 2023 @ 8:31am
aerouge Mar 6, 2023 @ 11:56am 
Originally posted by Deicide:
The official documentation actually has an example of this.

https://bitburner.readthedocs.io/en/latest/netscript/advancedfunctions/inject_html.html

It's an exploit though, not exactly in the spirit of the game.. but so is abusing the casino so w/e :P

Weeeeell isnt the whole game about exploiting exploits? Why else would you reward stuff like "Source-File -1: Exploits" with ingame-bonuses?

Serious question here... where is the line between a "good" and "bad" exploit?

And yeah sure my (rather obvious) intention is to avoid grinding the singularity bitnode (at the moment) but since you guys blur the line between "exploits" and "cleverly hidden shortcut" all the time (thinking about the unachievable achievement as a prime example) it does make it hard for a wee litle codemonkey to differenciate between "oh thats a clever shortcut" and "oh ♥♥♥♥ I am abusing a game-breaking exploit".
Zac Starfire Mar 6, 2023 @ 12:01pm 
Originally posted by aerouge:
Weeeeell isnt the whole game about exploiting exploits? Why else would you reward stuff like "Source-File -1: Exploits" with ingame-bonuses?

Serious question here... where is the line between a "good" and "bad" exploit?

I agree and Hydroflame (one of the original devs) intended 'cheating' to be encouraged. :gp_tongue:
Bugs Bunny Mar 6, 2023 @ 12:17pm 
Originally posted by aerouge:
Weeeeell isnt the whole game about exploiting exploits? Why else would you reward stuff like "Source-File -1: Exploits" with ingame-bonuses?

Serious question here... where is the line between a "good" and "bad" exploit?

And yeah sure my (rather obvious) intention is to avoid grinding the singularity bitnode (at the moment) but since you guys blur the line between "exploits" and "cleverly hidden shortcut" all the time (thinking about the unachievable achievement as a prime example) it does make it hard for a wee litle codemonkey to differenciate between "oh thats a clever shortcut" and "oh ♥♥♥♥ I am abusing a game-breaking exploit".

I have a saying that goes "You're only ever cheating yourself in a single player game". I guess what constitutes cheating is very subjective, but I personally draw the line where it robs me of the fun and enjoyment of the game.

For the specific topic here of running command line stuff from scripts, in most cases it's not really what I'd call an exploit. Sure you're going around the game design a bit to do stuff, but it's mostly not giving you an advantage over other players, or over the normal course of the game. That said, there's 2 notable exceptions, connect and backdoor, both of which are unlocked in SF4.X as game features, so using the html injection trick I linked earlier to do these is blatant cheating in my book. Not saying you shouldn't use them, but you're short-circuiting the normal course of the game by scripting those that way.

The 2 other topics mentioned by Zac fall into what I consider clear cheating, namely casino and infiltration automation. The casino is arguably a greyer area because it's purposely easy to cheat, in terms of rules/RNG/etc... but scripting it affords you a speed that is just unattainable as a human and basically means you get 10 free billions every cycle once you've automated it. Even in the easiest nodes that's a huge boon, and in some of the harder nodes (looking at you, SF8/9/13) it's a HUGE advantage that borders on game breaking, in my book. But it's your game, if you want 10 free billions every cycle, go for it, I just think it trivializes almost every node to the point it's not fun anymore. Actually coming up with the code to do it is a fun challenge, I've done it myself for coin flip (without savescumming) and I'm proud of it, but I still don't use it.

Last but not least is infiltrations... There's a guy on the discord that beat a fresh BN9 with an infiltration script in 9 minutes. I don't think I need to explain how broken that is to anyone... but again, if you want to beat all the nodes from a fresh start in less than 24 hours and move on to the next game, nothing is stopping you but I see zero fun in that.
Zac Starfire Mar 6, 2023 @ 12:23pm 
Holy Moly :conwayfacepalm: :gp_tongue:
Last edited by Zac Starfire; Mar 6, 2023 @ 12:36pm
aerouge Mar 6, 2023 @ 11:44pm 
Oookay ... maybe we have different views on fun and coding then ... you see, I code to automate boring or tedious tasks. And honestly the casino or the infiltration game are boring and tedious. They require nearly zero intellectual input UNTIL you START to code them. They just require a minimal ammount of hand/eye coordination. But you cant tell me that you WANT players to solve this manually forever?

Other than the contracts that require code to solve them (No I am not calculating 1000 different ways to sum a number for the surprisingly lumpy rewards to do so).

I totally agree that downloading a finished repository and just type "run finishthegame.js" is cheating. Codeing a solution for a problem is the fun to be had with this game for me. So how can that be a cheat?

Same with the "cheat" of automating backdoors (without BN4) ... I coded a solution to find a connection path from any given server to my home server. It prints it out into the log and honestly ... typing "connect X", "connect Y", "connect Z", "backdoor" ... is boring, tedious and simply not fun ... so a PRIME-thing to code in my book. Will this lessen the reward in BN4? Yeah sure ... might push that node down on my To-Do-List (although some other singularity functions seem usefull and harder to code)... still is this a cheat? Nope to me that is what makes this game enjoyable and motivating me to play it in the first place... to use my brain and codeing skills to cut all the boring parts.... otherwise one could surely play the game by typing "hack","grow","weaken" into the terminal until one drops dead.
K®o©K Mar 7, 2023 @ 4:57am 
Originally posted by aerouge:
Serious question here... where is the line between a "good" and "bad" exploit?
I think that the worst exploit, in the context of Bitburner, is to use someone else's optimized scripts rather than making your own, no matter if the scripts themselves take advantage of exploits or not. I see no point in the game if someone doesn't care enough to at least write their own code. I'm not that active here and on the Discord server but I've seen quite a few people that just downloaded the game that had already gathered a bunch of scripts without even trying to code their own first. This is basically like starting an FPS campaign with all guns, infinite ammo and invincibility.

(No offense to people that share such scripts, as it can be interesting to study how other people solved the same problems. I'm really talking about people that simply use them, without even reading the actual code, in order to get everything fast. The main point of the game is to automate stuff, there is no reason to play if we skip that part.)
Zac Starfire Mar 7, 2023 @ 5:00am 
I agree with aerouge. It also takes a huge amount of effort to find the solutions on the internet. And because most the solutions are for an older version of Bitburner, you have to fix them to run on the lasted version. Which requires a solid understanding of Javascript.

Which in it self, is the entire purpose of playing Bitburner : to learn Javascript, automation of scripts and to get through the node as quickly as possible. There is an achievement for quickly defeating a bitnode even.

Even with the 'cheats', it takes me a few days to complete a Bitnode. Plus,there is very little story in the game. If the bitnodes had more story, I'd probably enjoy the Bitnode longer. But they are the same nearly. It just all 'rinse' and 'repeat' - very repetitive.

BTW, aerouge, I did find a script that prints the path to a server and you can copy paste the path into the command line. I was going to add it to my 4th Bitburner guide that I haven't finished. So, it's out there - just have to find it. Hint - I found it on YouTube, not Reddit.
Last edited by Zac Starfire; Mar 7, 2023 @ 5:03am
Zac Starfire Mar 7, 2023 @ 5:12am 
So Deicide, if you work with the dev team, maybe you could recommend more story in Bitburner, to make the Bitnodes more interesting, encouraging players to stick around in a Bitnode longer.
Last edited by Zac Starfire; Mar 7, 2023 @ 5:12am
aerouge Mar 7, 2023 @ 6:28am 
Originally posted by 𓅂 Zac Starfire 𓅂:
BTW, aerouge, I did find a script that prints the path to a server and you can copy paste the path into the command line. I was going to add it to my 4th Bitburner guide that I haven't finished. So, it's out there - just have to find it. Hint - I found it on YouTube, not Reddit.

I wrote that myself ... I was just bored by the tedium of copy & pasteing the connections hence this current thread :-D but thanks :-)
Last edited by aerouge; Mar 7, 2023 @ 6:28am
Zac Starfire Mar 7, 2023 @ 6:32am 
Originally posted by aerouge:
I wrote that myself ... I was just bored by the tedium of copy & pasteing the connections hence this current thread :-D but thanks :-)


Good going! :gearthumbsup: :tta_smile_very_happy:
Last edited by Zac Starfire; Mar 7, 2023 @ 6:32am
Bugs Bunny Mar 7, 2023 @ 6:50am 
Originally posted by 𓅂 Zac Starfire 𓅂:
So Deicide, if you work with the dev team, maybe you could recommend more story in Bitburner, to make the Bitnodes more interesting, encouraging players to stick around in a Bitnode longer.

It's often been said that the real endgame in Bitburner is submitting PRs to improve the game, including new bitnodes and changes/upgrades to existing content :P I wouldn't say I work with the dev team, the code is open source, there's literally hundreds of players who submitted content/fixes to the game. I've made one PR (the ns.getMoneySources() function is my suggestion and implementation). I'll probably do more eventually. I don't think the current nodes need much changes other than maybe corps (which are in a big rework currently), Bladeburners and hacking gangs for reasons that would be too long to get into here. The main complaint I have is that some of these mechanics aren't like the others, namely, they do not add to the gameplay but offer alternate ways. I feel every mechanic should add a layer, rather than bypass other things.

As for the whole cheating discussion, like I said, you're only ever cheating yourself in a single player game so everyone can do what they want. I still stand by my claim that using auto infiltration is like a pretty dumb thing to use because BN9, one of the hardest node, can be done within less than 10 minutes with it. Once you're doing what, what's the point if anything else in the game. Corporations as they stand aren't a cheat and are just as boring/spoilful IMHO. I have a script here that beats BN1 fully automated in 1h20m using a corporation. Sure it's fun to do it as a stunt, but I have no interest in beating all the nodes 3 times with a corp (not that they can all be beat that way), it's just plain boring.
< >
Showing 1-15 of 23 comments
Per page: 1530 50