Code Monkey home page Code Monkey logo

bitburner's Introduction

NOTICE

This repo is no longer used for documentation, development, or issue control. Visit the new repo if that's what you're looking for and for a more up-to-date version of this readme page.

Bitburner

Join Discord

Bitburner is a programming-based incremental game that revolves around hacking and cyberpunk themes. The game can be played at https://danielyxie.github.io/bitburner or installed through Steam.

bitburner's People

Contributors

apamnapat avatar billyvg avatar borisflagell avatar danielyxie avatar feodoric avatar hoekstraa avatar hydroflame avatar jaguilar avatar kopelli avatar kwazygloo avatar martinfournier avatar master-guy avatar mughur avatar nolshine avatar ornedan avatar phyzical avatar pigalot avatar quacksouls avatar rderfler avatar sageptr avatar smolgumball avatar snarling avatar stalefishies avatar tesseract1234567890 avatar theit8514 avatar themas3212 avatar threehams avatar tyasuh avatar undeemiss avatar zeddrak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitburner's Issues

Missing files from repo

Trying to make sense of the source files in this repository and the bundled output, and it seems like you're missing some files from the repository. That may just be because you're hosting the game directly from the repository, but then why have the src and util directories still in it? Or from the lack of a license on the repo, you're trying to keep this closed source...but still taking pull requests from the community.

At a minimum a minimum, I would think webpack.config and package.json should be added. Honestly not sure how you've managed to keep working on the project this long without checking those files in.

SCP not working

Terminal will return standard error message if no parameters are specified, but returns no indicators if arguments (valid or invalid) are passed into the command, and nothing actually happens regardless of the sent file's validity.

De-inecentivised travel? (Balance)

After playing for a while in just Sector-12, I decided to play around with other cities. I was pleased to learn that some had their own training locations in the world menu, and that the higher cost came with a higher experience gain. There was just one problem. I had applied for the lowest requirement job I could find in Sector-12, gotten a promotion which still had lower requirements than pretty much any other job I'd found, and was already getting paid a great salary to gain hacking exp at a higher rate than even the most prestigious university, which I'd had to spend a few hundred thousand game-dollars to find in the first place. So I was left wondering, what was even the point in these schools? Sure, if I can get there early I'll have a jump-start, but it's almost immediately surpassed by something that costs me nothing to do.

Can run "buy" command to purchase items on "home"

I created an alias that was called "buy" and then tried to connect to "darkweb" and buy items, but I recieved an "ERROR: no such script". "unalias" was also being unsupportive of me so I exported the game, decoded it, changed the name of the alias, recoded it, and reloaded it into the browser. I saved the game and reloaded the browser, then tested to see if the alias worked. When I typed "buy" on "home", it prompted me exactly as how it would on the server "darkweb":

[home ~]> alias
alias ident=run ident.script
alias status=run _InvestmentBroker_Msg.script S
alias sbuy=run _InvestmentBroker_Msg.script A
alias sell=run _InvestmentBroker_Msg.script L
[home ~]> buy
Incorrect number of arguments. Usage:
buy -l
buy [item name]
[home ~]> buy -l
BruteSSH.exe - $500,000 - Opens up SSH Ports
FTPCrack.exe - $1,500,000 - Opens up FTP Ports
relaySMTP.exe - $5,000,000 - Opens up SMTP Ports
HTTPWorm.exe - $30,000,000 - Opens up HTTP Ports
SQLInject.exe - $250,000,000 - Opens up SQL Ports
DeepscanV1.exe - $500,000 - Enables 'scan-analyze' with a depth up to 5
DeepscanV2.exe - $25,000,000 - Enables 'scan-analyze' with a depth up to 10
[home ~]> connect darkweb
Connected to darkweb
You are now connected to the dark web. From the dark web you can purchase illegal items. Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name] to purchase an item
[darkweb ~]> buy
Incorrect number of arguments. Usage:
buy -l
buy [item name]
[darkweb ~]> buy -l
BruteSSH.exe - $500,000 - Opens up SSH Ports
FTPCrack.exe - $1,500,000 - Opens up FTP Ports
relaySMTP.exe - $5,000,000 - Opens up SMTP Ports
HTTPWorm.exe - $30,000,000 - Opens up HTTP Ports
SQLInject.exe - $250,000,000 - Opens up SQL Ports
DeepscanV1.exe - $500,000 - Enables 'scan-analyze' with a depth up to 5
DeepscanV2.exe - $25,000,000 - Enables 'scan-analyze' with a depth up to 10
[darkweb ~]> home
Connected to home
[home ~]> alias buy=buy
Incorrect usage of alias command. Usage: alias [-g] [aliasname="value"]
[home ~]> alias buy="buy"
[home ~]> buy
Incorrect number of arguments. Usage:
buy -l
buy [item name]
[home ~]> alias buy="dalek.script"
[home ~]> buy
Command not found
[home ~]> alias buy="run dalek.script"
[home ~]> buy
Running script with 1 thread(s) and args: [].
May take a few seconds to start up the process...
dalek.script: EXTERMINATE
[home ~]> connect darkweb
Connected to darkweb
You are now connected to the dark web. From the dark web you can purchase illegal items. Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name] to purchase an item
[darkweb ~]> buy
ERROR: No such script
[darkweb ~]> buy
ERROR: No such script
[darkweb ~]> buy -l
ERROR: No such script
[darkweb ~]> buy HTTPWorm.exe
ERROR: No such script
[darkweb ~]> home
Connected to home
[home ~]> buy
Running script with 1 thread(s) and args: [].
May take a few seconds to start up the process...
dalek.script: EXTERMINATE
[home ~]> unalias buy
Incorrect usage of unalias name. Usage: unalias "[alias]"
[home ~]> unalias "[buy]"
No such alias exists
[home ~]> alias
alias ident=run ident.script
alias status=run _InvestmentBroker_Msg.script S
alias sbuy=run _InvestmentBroker_Msg.script A
alias sell=run _InvestmentBroker_Msg.script L
alias buy=run dalek.script
[home ~]> unalias "[buy=run dalek.script]"
No such alias exists
[home ~]> unalias [buy=run dalek.script]
Incorrect usage of unalias name. Usage: unalias "[alias]"
[home ~]> unalias "buy=run dalek.script"
No such alias exists
[home ~]$

I then deleted the game and skipped Exit Tutorial and did this in the terminal:

Bitburner v0.34.0
[home ~]> buy
You need to be connected to the Dark Web to use the buy command
[home ~]$

I bought the TOR router and tried again.

[home ~]> buy
Incorrect number of arguments. Usage:
buy -l
buy [item name]
[home ~]> connect darkweb
Connected to darkweb
You are now connected to the dark web. From the dark web you can purchase illegal items. Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name] to purchase an item
[darkweb ~]> buy
Incorrect number of arguments. Usage:
buy -l
buy [item name]
[darkweb ~]> home
Connected to home
[home ~]$

So I can "buy" from "home". Maybe I don't know how use "unalias", but I can just use "alias buy=buy" to fix the bad alias call without exporting my save.

Request: sorting with ls

I would be nice to have options for sorting by, Alphabetical(regardless of case), Types(.extension), and also the norm. If you can think of any other useful sorting types, thats ok too.

Error on page load

Error: Module parse failed: C:\Users\danie\Desktop\netburner\src\Constants.js Unexpected token (1140:4)
You may need an appropriate loader to handle this file type.
|     "-Minor balance changes to Corporation. Upgrades are generally cheaper and/or have more powerful effects. " +
|     "You will receive more funding while your are a private company. "
|     "-Accessing the hacknetnodes array in Netscript now costs 4.0GB of RAM (only counts against RAM usage once)<br>"
| 
| }

I think theres a '+' missing.

Issue copying infos from active scripts textbox

This isn't exactly a bug, but more of an implementation detail that is the issue.
When highlighting the args in the scriptname.script to copy, the selection is continually reset in the textbox because of updating the other production infos. I'm not sure if it is possible with the toolkit to be able to make the Threads and Args lines in one textbox and the production lines in another without changing the look of the dropdown. The Threads and Args textbox would not "update" every few seconds and wreak the selection.

Example

pserv-24
    EarlyHackTemplate.script
        Threads: 4550
        Args: [ecorp, 1500000000000, 35]
        Total online production: $6,235,424,699,100.00
                                 45,734,488.40 hacking exp
        Online production rate: $118,365,050.52/second
                                868.1630 hacking exp/second
        Total offline production: $0.00
                                  3,772.98 hacking exp
        Offline production rate: $0.00/second
                                 432.1856 hacking exp/second

Game crashes on load

Uncaught Error: Module parse failed: C:\Users\danie\Desktop\netburner\src\Constants.js Unexpected token (1140:4)
You may need an appropriate loader to handle this file type.
| "-Minor balance changes to Corporation. Upgrades are generally cheaper and/or have more powerful effects. " +
| "You will receive more funding while your are a private company. "
| "-Accessing the hacknetnodes array in Netscript now costs 4.0GB of RAM (only counts against RAM usage once)
"
|
| }

Introduced in commit: 9e20856

Tutorial box reset scroll

After you click next in the tutorial box, the scroll position isn't reset, you have to manually scroll up again.
Suggestion:

function iTutorialSetText(txt) {
    var textBox = document.getElementById("interactive-tutorial-text");
    if (textBox == null) {throw new Error("Could not find text box"); return;}
    textBox.innerHTML = txt;
    textBox.parentElement.scrollTop = 0; // this resets scroll position
}

Request: Disable automatic updates in log

When I'm tailing a script, oftentimes the log feels spammed by information from my actions that I don't care about.

For instance, every time I take a university course, I'm told all that I gained right afterwords. Or I don't need to know Sleeping for 10000 milliseconds every 10 seconds in the log.

If there was a way to disable this, and only show the print() sections of the script in the log, that would be great. Just a request.

Stock Prices grow to wildly large numbers

While experimenting on the Stock Market bitnode, I wrote a ton of scripts trying to figure out the best way to game the stock market. Eventually I found the best strategy was simply to purchase shares of every stock and then leave your computer running for a few days (with Bitburner running as the active tab)

After 3-4 days, I start seeing numbers like these in my portfolio:

big-stock-numbers

big-profit

It feels really bad that this is the best strategy for the bitnode. I actually feel this is the best strategy across all bitnodes after you get Source File 8 and gain permanent access to the stock market. Because of this exploit, I can beat any bitnode in which I have access to the stock market in a few days, without really playing the game.

I don't think stocks should grow to such ridiculous numbers, and if possible, I think something should be done to improve the gains of stock market scripts when tabbed out of the game (I understand the limitation here, however)

Some scripts do not clear properly from Active Scripts page.

Example screenshot

All instances of wrapper.script have been finished, some for over an hour. Not sure what the cause is.
wrapper.script is a special script I wrote to be able to short-circuit crime-running scripts that auto repeat for certain lengths of time (or indefinitely). Its contents are below:

/***************
/ wrapper.script
/ Wraps an "unkillable" script
/ accepts a script name and up to 10 arguments to pass to it
/ Creates a prompt, and when the prompt is resolved, kills the "unkillable" script
***************/
script = args.shift();
//Collects up to 10 arguments you wish to pass to the wrapped script.
//If less than 10 arguments are to be passed, the rest are filled with 0s.
for(arg = args.length; arg < 10; arg++) {
    args.push(0);
}
//Run the script with 1 thread and all 10 arguments.
run(script, 1, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
//Prompt the user to prematurely end the script.
//SCRIPT EXECUTION PAUSES UNTIL THE PROMPT IS RESOLVED.
prompt("Kill the script?  Both options do the same.");
//Once the prompt is resolved, forcibly kill the script.
//The script name, the host name, and all passed arguments must be included.
kill(script, getHostname(), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);

It's possible that this bug is caused by modifying the args variable, but I'm not sure.

Request: Customizing autosave

Option to either set autosave delay, or disabling / enabling it in the options.

Autosave takes a few seconds when I have thousands of scripts running, so this would be useful in that case.

Invalid stock symbol passed into getStockPrice()

Specifically, scripts error when passing FLCM to getStockPrice(). I checked, all other stocks passed OK. Bug is repeatable.

Update: I've tested getStockPosition() with FLCM and received the same error - literally "Invalid stock symbol passed into getStockPrice()". Note, getStockPrice() when I was using the getStockPosition() function. It appears you've duplicated the error text from getStockPrice() in the getStockPosition() function.

Thought: Is it possible that the recent typo fix to Fulcrum Technologies is causing a mismatch in my existing game? Maybe when I ascend and rebuy WSE/TIX it will remap FLCM to the corrected spelling.

bitnode-2: rounding issues

I've been running my gang in bitnode-2 for a while, and now I have this on my territory screen:

Slum Snakes
(Power: 1,013.967315): 100.03%

Tetrads
(Power: 58.351783): -0.00%

The Syndicate
(Power: 57.690790): -0.00%

The Dark Army
(Power: 58.403190): -0.00%

Speakers for the Dead
(Power: 58.464013): -0.00%

NiteSec
(Power: 57.538042): -0.00%

The Black Hand
(Power: 58.145106): -0.00%

Seems like some computation / rounding issues there.

Error in hacking mission minigame

ERROR Parsing Hacking Mission Node Id. Could not find coordinates
bundle.js:37147:9
TypeError: targetNode is null
bundle.js:37472:1

Seems to happen when dragging the connection to an invalid node. The error seems to interrupt the tick cycle, so after it occurs, none of the nodes in the minigame, nor the values outside of it, like money, refresh anymore.

3 spellings for Fulcrum

it's rather confusing to have those 3 different spellings; particularly the one accepted by applyToCompany() isn't ideal (the first one):

  • "Fulcrum Technolgies"
  • "Fulcrum Technologies"
  • "Fulcrum Secret Technologies"

`while`can replace all `if` and `for`

This is a minor point but it kinda makes the RAM costs of for and if irrelevant.

if (cond) {
    statements...
}

can be replaced with

while(cond) {
    statements...
    break;
}

and I'm sure you can figure how all for can be replaced for while

on one hand this is a game about "hacking" so maybe the players should be rewarded for bending the rules. on the other it "forces" the player to make less readable code in order to save a few MB.

Cannot manually throw errors via throw statement

Attempting to use a throw statement, as in

throw "the towel";

throws an

Unrecognized token: ThrowStatement. This is a bug please report to game developer

which still crashes the script, but in an unexpected way.

(I know, this is more of a feature request thing again, I'm sorry, it told me to report it.)

can't kill script with recursive function?

I tried killing one of my coding accidents and... it just didn't work. I had to F5-refresh and then kill it before it actually started.

how to reproduce:

function getbestavailablehost(...) { ... }

function getbesthost(...) {
  hostname = getbesthost(...);  // <- bug was here - should call getbestavailablehost(...) instead
  if (hostname === null) { hostname = buynewhost(...); }
  return hostname;
}

...
x = getbesthost(...);

NetscriptJS scripts gradually leak memory

Each run of a NetscriptJS script leaks up to about around 70kB of memory. The memory being leaked includes everything reachable from the WorkerScript object, as well as the imported modules themselves.

The baseline reason this is happening is that modules can never be unloaded, and NetscriptJS creates a new module each time it runs a script. That module holds references (in module-scoped variables) to the WorkerScript.

We can cut the leak down to a fraction of its current size using the existing strategy -- maybe as little as 1kB. But it's not going away, because we cannot induce garbage collection of the generated code or certain bits of metadata about the module.

There are a couple of things we can do.

  • Don't launch NetscriptJS. 😭
  • Put up with the memory leak with stop-gap fixes. 👎 People will run into it eventually, although the game is very playable even in its current state.
  • We could reuse the module object each time we invoke it. 👌 Requires passing the state as a parameter to main. So main() would become main(sys), and instead of calling await hack() you'd call await sys.hack(). The user would have to pass sys to any function that uses Netscript functions. In this scheme, a new module would be created only when the user edits the code. This would still leak a little, but it's not really conceivable that the user is going to edit 1M times without reloading.
  • We could use WebWorkers to solve the underlying problem. 😨 It would require more rewriting of user JS. Each time the user calls a Netscript function, it would need to be async and request information from the environment. We could insert awaits strategically, but now all user functions have to be async functions . . . it's a mess.

Variations on the third idea may be possible. Perhaps we could wrap all user functions in a closure, and then initialize that closure with the environment. I will ruminate on this.

I'm still waiting for an answer on my Stack Overflow question, but this is the state of the problem tonight. My plan is to put into place the stop-gap fixes (so I can play the game at least 😉) and then look in to what can be done to get us closer to the third state.

Bug

Caught an exception: TypeError: ActiveScriptsUI[hostname] is undefined

Filename: https://danielyxie.github.io/bitburner/dist/engine.bundle.js

Line Number: 55067

This is a bug, please report to game developer with this message as well as details about how to reproduce the bug.

If you want to be safe, I suggest refreshing the game WITHOUT saving so that your safe doesn't get corrupted

This happens when I run this script

target = args[0];
while(true){
if(getServerSecurityLevel(target) > getServerMinSecurityLevel(target)){
weaken(target);
continue;
}if(getServerMoneyAvailable(target) < getServerMaxMoney(target)){
grow(target);
continue;
}else{
hack(target);
}
}

with these arguments

run slaveS.script -t 200 foodnstuff

After installing augments

getScriptRam has weird issues with player servers that have 1024 GB of ram

I made a batch of 1024 GB RAM servers, and the getScriptRam function always returns 0 when I call it with my script. The script in question is only 2.4 GB. The script in question is as follows:

// a script that maintains a balance and security level as it hacks a server
targetServer = args[0];
while(true)
{
if (getServerMoneyAvailable(targetServer ) < args[1]
)
grow(targetServer );
else if (getServerSecurityLevel(targetServer ) > args[2])
weaken(targetServer );
else
hack(targetServer );
}

Here's my full save:
bitburnerSave (1).zip

Run this to get it going:
run maintainhack.script "foodnstuff" 2000000 6

Allow folders to be "created" on the home pc (and other pcs)

I'm absolutely loving this game, and had a thought I wanted to throw up here because I thought it'd help clean up the home pc some.

I'm loving the game, and have spent way too much time on it. But thanks for making it even if you don't take this "issue" into the game.

new hacking mission

image

The game worked the first time kind of, but the second time i opened the game it wouldn't start the timer or anything so i looked at console and found this int he above picture.

free command bug

Running free on one of my purchased servers while running MercuriusXeno scripts
returns a negative amount used. I believe used * -1 might be the correct used.

[p0 ~]> free
--
Total: 16,384.00 GB
Used: -3,261.80 GB
Available: 19,645.80 GB

Code Sharing via Quasi-Git

It'd be great if there was a more streamlined way to share code. A very simplified, quasi- version of git could work. People can maintain scripts on github and in-game, repos could be "git cloned" where it just pulls down the latest version of the files in the repo; no .git, no versioning, nothing special, just plain text files. In-game version of git would be basically just git clone functionality for a public repo. I imagine this would simplify the coding required.

This would make it way faster and easier when someone updates their set of scripts that you use and you want to update them in-game. A simple update script that just goes and runs "git clone $URL" on all your servers would mean updating scripts is fast and easy.

Server returning negative numbers with getServerMoneyAvailable()

Last night I made new scripts using Arrays and threads, and today when I woke up I found out that most of my servers were in ridiculous negative figures. So I guess there are some validations missing around and server goes into minor negative value and grow() just make it go even lower non-stop, because I definitely didn't hack that much money :P.

A different minor issue on the same subject: before this I got into a situation where some servers got to 0 money due to over-hacking and couldn't grow() them anymore (because it's based on a percentage). Maybe it would be nice to make grow be able to grow back from zero too.

Example of the error:

getServerMoneyAvailable() returned -3,886,154,147,409,390,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00

I was running 2 scripts in each of them, a "status" script with 90 threads and a "exploit" script with 220 threads in each server:

"status" script code:

target = "iron-gym";

while (true) {
	print("------------------------------------------------------------");
	print("Hostname: " + target);
	getServerMoneyAvailable(target);
	getServerSecurityLevel(target);
	grow(target);
	weaken(target);
};

"status" script output:

> tail -status-iron-gym.script
Executing weaken() on server iron-gym in 29.334 seconds (t=90)
Server security level on iron-gym weakened to 1. Gained 1,389.5625 hacking exp (t=90)
------------------------------------------------------------
Hostname: iron-gym
getServerMoneyAvailable() returned -232,297,471,948,434,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
getServerSecurityLevel() returned 1.004 for iron-gym
Executing grow() on server iron-gym in 8.497 seconds (t=90)
Available money on iron-gym grown by 9.028003%. Gained 231.5938 hacking exp (t=90)
Executing weaken() on server iron-gym in 23.818 seconds (t=90)
Server security level on iron-gym weakened to 1. Gained 1,389.5625 hacking exp (t=90)
------------------------------------------------------------
Hostname: iron-gym
getServerMoneyAvailable() returned -314,058,532,177,318,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
getServerSecurityLevel() returned 1.004 for iron-gym
Executing grow() on server iron-gym in 8.486 seconds (t=90)
Available money on iron-gym grown by 9.028003%. Gained 231.5938 hacking exp (t=90)
Executing weaken() on server iron-gym in 23.761 seconds (t=90)
Server security level on iron-gym weakened to 1. Gained 1,389.5625 hacking exp (t=90)
------------------------------------------------------------
Hostname: iron-gym
getServerMoneyAvailable() returned -424,596,793,094,960,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
getServerSecurityLevel() returned 1.004 for iron-gym
Executing grow() on server iron-gym in 8.471 seconds (t=90)
Available money on iron-gym grown by 9.028003%. Gained 231.5938 hacking exp (t=90)
Executing weaken() on server iron-gym in 23.743 seconds (t=90)
Server security level on iron-gym weakened to 1. Gained 1,389.5625 hacking exp (t=90)
------------------------------------------------------------
Hostname: iron-gym
getServerMoneyAvailable() returned -573,489,846,555,315,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
getServerSecurityLevel() returned 1.004 for iron-gym
Executing grow() on server iron-gym in 8.471 seconds (t=90)
Available money on iron-gym grown by 9.028003%. Gained 231.5938 hacking exp (t=90)
Executing weaken() on server iron-gym in 29.946 seconds (t=90)
Server security level on iron-gym weakened to 1. Gained 1,389.5625 hacking exp (t=90)
------------------------------------------------------------
Hostname: iron-gym
getServerMoneyAvailable() returned -775,339,386,679,760,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
getServerSecurityLevel() returned 1.000 for iron-gym
Executing grow() on server iron-gym in 8.459 seconds (t=90)
Available money on iron-gym grown by 9.028003%. Gained 231.5938 hacking exp (t=90)
Executing weaken() on server iron-gym in 23.686 seconds (t=90)

"exploit" script code:

target = "iron-gym";
maxMoney = 0;
hackThreshold = 0.8;
weakenThreshold = 2;

while (true) {
	if (getServerSecurityLevel(target) > weakenThreshold) {
		weaken(target);
	} else {
		currentMoney = getServerMoneyAvailable(target);
		if (currentMoney > maxMoney) {
			maxMoney = currentMoney;
			grow(target);
		} else {
			if (currentMoney > maxMoney * hackThreshold) {
				hack(target);
			} else {
				grow(target);
			};
		};
	};
};

"exploit" script output:

> tail -exploit-iron-gym.script
Executing grow() on server iron-gym in 8.527 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 2.152 for iron-gym
Executing weaken() on server iron-gym in 29.424 seconds (t=220)
Server security level on iron-gym weakened to 1. Gained 3,396.7084 hacking exp (t=220)
getServerSecurityLevel() returned 1.000 for iron-gym
getServerMoneyAvailable() returned -1,611,346,962,972,320,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
Executing grow() on server iron-gym in 8.516 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 2.244 for iron-gym
Executing weaken() on server iron-gym in 30.076 seconds (t=220)
Server security level on iron-gym weakened to 1. Gained 3,396.7084 hacking exp (t=220)
getServerSecurityLevel() returned 1.004 for iron-gym
getServerMoneyAvailable() returned -2,377,444,160,672,300,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
Executing grow() on server iron-gym in 8.516 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 1.788 for iron-gym
getServerMoneyAvailable() returned -2,939,592,373,785,420,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
Executing grow() on server iron-gym in 10.738 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 1.880 for iron-gym
getServerMoneyAvailable() returned -3,634,660,896,335,760,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
Executing grow() on server iron-gym in 10.987 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 3.028 for iron-gym
Executing weaken() on server iron-gym in 35.557 seconds (t=220)
Server security level on iron-gym weakened to 1. Gained 3,396.7084 hacking exp (t=220)
getServerSecurityLevel() returned 1.000 for iron-gym
getServerMoneyAvailable() returned -5,362,720,458,465,190,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
Executing grow() on server iron-gym in 8.497 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 1.788 for iron-gym
getServerMoneyAvailable() returned -6,630,739,187,577,590,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
Executing grow() on server iron-gym in 10.715 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 1.884 for iron-gym
getServerMoneyAvailable() returned -8,198,581,767,258,540,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00 for iron-gym
Executing grow() on server iron-gym in 10.998 seconds (t=220)
Available money on iron-gym grown by 23.526375%. Gained 566.1181 hacking exp (t=220)
getServerSecurityLevel() returned 3.032 for iron-gym
Executing weaken() on server iron-gym in 35.585 seconds (t=220)

! (not operator) causes Unrecognized token

Script runtime error:
Server Ip: 158.162.208.64
Script name: makemoney.script
Args:[]
Unrecognized token: UnaryExpression. This is a bug please report to game developer

Script used to produce this error:

target="joesguns";
while (true) {
    if(getServerMoneyAvailable(target) >= 500000) {
        if( !hack(target)) {
            weaken(target);
        }
    } else {
        grow(target);
    }
}

disableLog('commitCrime') doesn't seem to have any effect

With or without disableLog, I basically get the same messages:

Disabled logging for commitCrime
Attempting to commit homicide...
Crime successful! Gained $7.533k, 0.000 hack exp, 1.240 str exp, 1.240 def exp, 1.240 dex exp, 1.240 agi exp, 0.000 cha exp.

Question: Is icarus.msg decodable?

@danielyxie

@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%
)@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)
@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB
DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)

Is this some sort of easter egg, secret message to be decoded, or just to look like some encrypted data to non programmers...???
Please no spoilers, just a basic Yes or No question answers.

Edit: I am a python programmer and found this read very interesting.
obfuscating-hello-world.py

killing scripts with workForFaction(faction, "hacking"); in a function

Ive been having trouble killing a script that has workForFaction(faction, "hacking"); in a function.
I was still trying to debug parts of my script but was having trouble because I could not kill it in a timely manner
Every time i kill it will start the faction work again multiple times then take 15+ minutes to die
The full scrip is below.

function work(faction){
    while (getFactionRep(faction) < rep) {
        if(nonhacking.indexOf(faction)==-1){
            workForFaction(faction, "hacking");
        } else {
            workForFaction(faction,"fieldwork");
        }
        sleep(sleeptime);
    }
}

function workjob(company){
    applyToCompany(company,"software");
    while (getCompanyRep(company) < corprep) {
        workForCompany();
        sleep(sleeptime);
    }```
}

//list of all corp
corps = ["MegaCorp", "Blade Industries", "Four Sigma", "KuaiGong International", "NWO", "OmniTek Incorporated", "ECorp", "Bachman &", "Associates", "Clarke Incorporated", "Fulcrum Technolgies"];
//list of all factions
knownfactions = ["Sector-12", "Aevum", "Tian Di Hui", "Chongqing", "New tokyo", "Ishima", "Volhaven ", "CSEC", "NiteSec ", "The Black Hand", "BitRunners", "Fulcrum Secret Technologies", "Bachman & Associates", "Megacorp", "KuaiGong International", "Clarke Incorporated", "Blade Industries", "Four Sigma", "ECorp", "OmniTek Incorporated ", "Netburners", "Slum Snakes", "Daedalus", "Tetrads", "Illuminati", "The Covenant", "NWO"];
//list of faction that you cant do hacking missions for.
nonhacking = ["Slum Snakes", "Tetrads" ];
// creating the a list of faction your already in 
currentfactions =[];
deletefactions= [];
// other preset veriables
rep = 5000;
maxcorprep = 250000;
corprep = 10000;
corpindex = 0;
sleeptime =240000;
//starting the loop
while (true){
    // check faction invites and accept them then remove them from the knowfacttions list 
    invites = checkFactionInvitations();
    if (invites.length > 0 ){
        for (i=0; i<invites.length;i++){
            joinFaction(invites[i]);
            currentfactions.push(invites[i]);
            index = knownfactions.indexOf(invites[i]);
            if (index > -1){
                knownfactions.splice(index, 1);
            }
        }
    }
    
    
    // check and see if your are already in a faction and add it to the working list 
    i=0;
    for(i=0;i<knownfactions.length;i++){
        if (getFactionRep(knownfactions[i]) > 0){
            //tprint("adding to list "+ knownfactions[i]);
            currentfactions.push(knownfactions[i]);
            deletefactions.push(knownfactions[i]);
        }
    }
    for (i=0;i<deletefactions.length; i++ ){
        
        index = knownfactions.indexOf(deletefactions[i]);
        if (index > -1){
            knownfactions.splice(index, 1);
        }
    }
    
    deletefactions = [];
    //Check if your in a faction to get rep from 
    if(currentfactions.length>0){
            
        // work for faction
        for (i=0;i<currentfactions.length;i++){
            work(currentfactions[i]);
        }
        rep += 10000;
    }
    //work job
    if (corpindex < corps.length){
        workjob(corps[corpindex]);
        corprep += 10000;
        // switching to a new corp if your rep is above 250000 or the set maxcorprep
        if (getCompanyRep(corps[corpindex]) > maxcorprep ){
            corpindex++;
            corprep = 10000;
        }
    }
    //if(getStatLevel('Cha')<1000){
        travelToCity('Volhaven');
        universityCourse('ZB Institute of Technology','Leadership');
        sleep(sleeptime*2);
    //}
    
    
    
}

Script exploits

Avoid ram usage for function calls:

hack_func = hack;
hack_func("hostname");

Avoid ram usage for while:

while (cond) {
  stuff;
}

turns into

function recursive() {
  stuff;
  cond && recursive();
}

Execute arbitrary Javascript [with no RAM cost]

hack.constructor("alert(1)")();

Also, there are some annoying limitations.
It's impossible to use anything like [1, 2, 3].map(function a(x) { return x * 2; }) [function expressions not implemented], or function mapper(x) { return x * 2; }; [1,2,3].map(mapper); [function declarations are not actual Javascript functions]

[FR/Feedback] Allow creation of programs (.exe) be stopped and resumed

Right now to create a program the player needs to start it and not interrupt it, otherwise it would start over.

I don't see how this behavior adds anything to the game except annoying the player for not letting them do other stuff like checking state of scripts or improving hacknet.

I find the game mechanic a bit bland, maybe you could remove that restriction about doing it uninterruptedly?

BTW, another thing I find a bit annoying about creating programs is that it seems that even if you are at 50 hacking skill or 500 hacking skill, it always takes exactly the same time.
OTOH, I do undestand if this is a idle/incremental wall that the user needs to pass just by waiting some time, but can you consider making the time it takes to build scale with skill?

Programs like DeepscanV2.exe and relaySTMP.exe takes 2 hours to create, which is a lot and can't be reduced, I've been avoiding them in my lasts prestige starts and just kept hacking lower port nodes, and using V1 scans just to avoid those extra hours. I hope at least there's some faction that makes them autounlock like BruteSSH.exe but I didn't find it yet.

Loving your game so far.

Command arguments interpreted as aliases

I did some short aliases for commands I was using regularly and after a while I hit a problem: It seems command arguments are interpreted as aliases too. Definitely not what I was expecting.

> run -test.script 6 90 130 0.8 4
Running script with 1 thread(s) and args: [6, 90, 130, 0.8, 4].
May take a few seconds to start up the process...
> alias
alias 3=scan-analyze 3
alias 5=scan-analyze 5
alias 10=scan-analyze 10
alias 11=scan-analyze 10
alias ssh=connect
alias a=analyze
alias g=tail grow.script
alias c=connect
alias s=scan
alias h=home
> run -test.script 5 90 130 0.8 4
Running script with 1 thread(s) and args: [scan-analyze, 5, 90, 130, 0.8, 4].
May take a few seconds to start up the process...

It would be nice to have a way to delete an alias too. For example I don't use the "g" one anymore, can't get it out of the list, unless I'm missing something.

Sphinx for Documentation

Being a "programming" game, the docs should be generated accordingly.
http://www.sphinx-doc.org

Contributers should WANT to document it, as most coders do, not use a wiki.

This could also be an alternative. wikia has ads that slow down the page(unwanted)/constantly bog down the pages, readthedocs.org has free hosting without ads.

Thoughts, comments, etc...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.