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
I'm working on my own solution that will work something like this
>if target_flag not set
-->target_flag = 0 target is not prepped
>if not min sec
-->Launch threads to weaken the target to minimum
>Set target_flag = 1, the target is ready to grow
>if not max money
-->calculate if the current server can grow to maximum then reduce security to zero
-->if it can
---->run the G/W threads needed timed to occur after the initial weaken
-->else
---->calculate G/W ratio that can be run, run max G/W threads needed, precede to the next server and try to finish the G/W prep
>Set target_flag = 2, the target is ready for HWGW
>if target_flag == 2
-->run HWGW (might need a check that prevents the HWGW occurring before the prep)
I fixed it by breaking out of the loop once the hackamount becomes greater than 0.7 or something like that.
Merely asked because I thought you maybe accounted for that issue and I missed it ;)
It sure is a fascinating 'game'.
Have a nice day!
I am sorry that i did not updated this as i didn't play that much lately.
But i am still glad you made the effort to think it through and noticed a problem i also encountered.
For your actual question about crashing i can only guess.
Always make sure you do have failsafes when using functions that can crash your script.
For example you can see that when i use growthAnalyze that there is a Math.min function in it to make sure there will never be a zero.
Print debugging helps to see what line and function may be the problem.
You can also send me your code and i may have a look into it.
First off, calculation of threads and the timing of batches are complex problems that have not much to do with programming, so there is a variety of possible solutions.
I updated this particular calculation several times and have to admit that this is still not perfect.
I just checked my script and noticed that i updated this exact problem with 2 lines:
if (HACK_MONEY_PERCENTAGE * hackThreads > 1)
hackThreads = Math.ceil(1 / HACK_MONEY_PERCENTAGE);
this goes right at the top of the calculation loop and should fix what you describe, as this is an easy way to calculate how to get all of the money with minimum threads.
Please note that this is not optimal in earlier stages of the game as you surely do not want to empty a server.
I'm currently trying to write the calculations for the number of threads for grow/hack/weaken.
As far as I can tell you do not account for the possibility that you have more threads available than you need to reduce the target to 0 (or below if it were possible) in your while(true) loop.
When I try to find the hackThreads, I end up crashing my program because of this.
Did I miss something?
But inside the loop you check to see if the server you are getting set up is the Home server and if it is you set WEAKEN_PER_THREAD = ns.weakenAnalyze(1, S_CORES); but after that you never reset it back to ns.weakenAnalyze(1).
This means that after the first time your code does the Home server that all your other servers are using the wrong WEAKEN_PER_THREAD value.