prinzstani / CookieBot

Automatic Playthrough for Cookie Clicker
GNU General Public License v3.0
51 stars 34 forks source link

Golden Cookie clicking mode issue #85

Open thelmexx opened 2 years ago

thelmexx commented 2 years ago

Setting Golden Cookie clicking mode to ALL seems to bypass the games sanity check on what effect a golden cookie can give. So, when you get a cookie storm, and the bot tries to click every single cookie on the screen before it despawns, each of these cookies will give any buff, resulting in other frenzies stacking to last an absurd amount of time, such as 11 days of frenzy. Apart from totally destroying the gradual progression, this also results in quirks such as the prestige counter getting "stuck" and softlocking you from ascension-related achievements.

Repro:

Game version 2.048, autoplay 2.045, CCSE 2.033

prinzstani commented 2 years ago

That is very interesting. Previously, this did not happen in the game. Obviously, the game mechanic was changed and now it is no longer possible to click all the golden cookies. I suspect that it is related to clicking golden cookies before they even are completely created because, in a cookie storm, no other buffs are created. It is not true that each of the cookies gives a buff, just some very strange ones and they are doing so erroneously. I think a solution could be to avoid clicking golden cookies that are too young. BTW, the clicking mode ALL gives huge amounts of gain already without this problem, so maybe we should not allow it altogether?

thelmexx commented 2 years ago

Avoiding clicking cookies that are too young sounds like a good solution, but care should be taken that at a cookie needs to be clicked within a second of spawning for the Early Bird achievement. As for the huge amounts of gain, its probably not quite the same as having the bot buy 600 cortex bakers before first ascension? Either way, I don't see an issue with it existing as a "fast track" kind of option.

prinzstani commented 2 years ago

I tried yesterday somewhere on the first day of the game, and I had the same effect as described. Today I tried the same after the first ascend, and the game is behaving just as expected - without extra buffs. Might need to check a bit more under which conditions the effect occurs.

prinzstani commented 2 years ago

As it turns out, the problem occurs when golden cookies are caught before they really exist, see the following error messages: Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. at Game.shimmer.die (https://orteil.dashnet.org/cookieclicker/main.js?v=5:5266:19) at Object.popFunc (https://orteil.dashnet.org/cookieclicker/main.js?v=5:5682:9) at Game.shimmer.pop (https://orteil.dashnet.org/cookieclicker/main.js?v=5:5253:33) at AutoPlay.handleGoldenCookies (https://prinzstani.github.io/CookieBot/cookieAutoPlayBeta.js:232:9) at AutoPlay.run (https://prinzstani.github.io/CookieBot/cookieAutoPlayBeta.js:70:12) Moreover, it seems that the speed of the machine is determining whether the problem occurs or not, maybe also the number of cores. A slow machine does not have the problem (I had device simulation activated when I did not have the problem). We can try to check the age of the golden cookie, but it is not clear whether the time in the cookie is valid.