安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题









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.