Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
EDIT: So far, the code does work, but I do not know the names for the other three files, and I would also like to backdoor into the server.
scp("early-hack-template.script", serv);
run("autobreach.script", 1, serv)
exec("early-hack-template.script", serv, 24);
}
//autobreach.script
var target = args
if (fileExists("BruteSSH.exe", "home")) {
brutessh(target);
}
if (fileExists("FTPCrack.exe", "home")) {
ftpcrack(target);
}
if (fileExists("relaySMTP.exe", "home")) {
relaysmtp(target);
}
if (fileExists("SQLInject.exe", "home")) {
sqlinject(target);
}
if (fileExists("HTTPWorm.exe", "home")) {
httpworm(target);
}
nuke(target);[/code]
.
About the last piece of code you shared:
1. You're copying your auto-breach to other servers. This is not necessary since the port crackers and nuke both take the server name as a parameter, so you can crack/nuke all the ports/servers from a single script on home. One of the things that will break your logic is some servers do not have ram... even if they might be hackable.
2. nuke can crash the script if there isn't enough ports open, so you need a try/catch around it (in js only, script doesn't need/support it)
3. The hardcoded 24 you give for threads on the early hack template will fail on a lot of servers, you need to check the script ram and the server free ram to figure how many threads you can use
Otherwise you're in the right path. Look at the script Croak posted, it's decent
It's javascript, 2.2GB RAM cost.
https://github.com/kamukrass/Bitburner I am currently looking at this page for some scripts, and I am currently looking at the grow one they have:
Best guess to get the grow script to be able to work on several different servers is to:
-pass an array/list/etc, or just a bunch of strings, as an argument(s)
-stick a conditional inside the grow function to oscilate between the arguments, and use modulus on a variable to keep looping bewteen the servers
I was thinking something like this:
i = 0
while i < 100:
print(servers[i % len(servers)])
i += 1
This was written in Python, and I was able to test out the logic in IDLE. but I would not know how to implement this with Javascript and the in-game logic.
EDIT: One last question: For running each script (hack, grow, and weaken) on a single server, what would the ratio for hack:grow:weaken be?
Initially, I tried 25% hacking, 25% growth, and 50% weaken, but I immediately ran out of money. I then changed it to 10% hacking, 40% growth, and 50% weaken, and issue still persisted.
I imagine the biggest bottlneck is excessive weaken because the security level is always very low.
If you're attempting to hack servers with only a single thread you're not going to see any money flow. Until you've upgraded your computer/bought additional servers like the ingame beginner guide teaches you, hacking income is going to be vastly outpaced by crimes in the city slums.
The grow function you found is intended to be used alongside a manager that passes in a target and a sleep time to make it execute immediately after a growth cycle, then terminate to maximize RAM availability. If you're struggling with writing scripts, I wouldn't try to tackle a manager that advanced yet. Just set up something that loops and figures out what to do at runtime with conditionals until you're comfortable enough to tackle that timing aspect.
So far, this is what I have to copy/paste servers, with the percentages being for RAM used:
15% hack
35 % weaken
50 % grow
And for each of the individual loops:
Looking into my hack.js for most of them, and it's consistently hacking sub million costs, if not zero dollars. For all of the servers I hacked when I was idling when sleeping, only two of them actually had a decent amount of money hacked (alpha-ent with $11bil, then syscore with $85bil) over the course of 4 hours.
I think that I have too much weight in hack, and possibly in weaken, in some of them, too. As an example, with rho-construction, I'm always getting grow results within the tens of millions(percentage wise) and every weaken is bringing it down to the minimum security level, but with the hacking, when it actually does hack money, I'm only getting around $300k/hack, immediately for the money to be drained. Over 3.25 hours, the hack only yielded $2.95bil.
ns.getServerSecurityLevel(target);
ns.getServerMinSecurityLevel(target);
ns.getServerMoneyAvailable(target);
ns.getServerMaxMoney(target);
I'd also suggest combining the weaken scripts with both the hack scripts and the grow scripts instead. When you're not using a manager to min-max execution times, the RAM cost is actually higher to separate them. Every script has a base cost of 1.6GB. Weaken and grow are both only 0.15, and hack is just 0.10. Just set them both to weaken if the server security is more than whatever threshold you're comfortable with (I think I go with 5 points over minimum myself) else hack/grow. You could also tell hack to only hack when money's maxed out, but given the ratio you provided earlier that shouldn't matter unless hack is executing more than twice as fast as each grow.
I've also been experimenting with the syscore, since I was beginning to have a problem, too, albeit smaller.
Running 6981 threads for grow, 1639 for weaken, and 555 for hack.
I'd also suggest combining the weaken scripts with both the hack scripts and the grow scripts instead. When you're not using a manager to min-max execution times, the RAM cost is actually higher to separate them. Every script has a base cost of 1.6GB. Weaken and grow are both only 0.15, and hack is just 0.10. Just set them both to weaken if the server security is more than whatever threshold you're comfortable with (I think I go with 5 points over minimum myself) else hack/grow. You could also tell hack to only hack when money's maxed out, but given the ratio you provided earlier that shouldn't matter unless hack is executing more than twice as fast as each grow.
I almost guarantee your hacks are outpacing your grows in that case. Add in a conditional to only hack above a given server money threshold and that'll fix your primary issue.