Roukys / HHauto

GNU General Public License v3.0
43 stars 45 forks source link

Bug [7.12.6] - More click than expected in the auto pachinko routine #1273

Open Franck-75 opened 1 month ago

Franck-75 commented 1 month ago

Hi, I share you the bug I see but I've not analysed the root cause yet. When I use the function "use Pachinko", it seems that some clicks are done but not counted.

Two behaviors I've seen : 1) When "Stop first girl" is set, I've seen all my orbs spent even if I already got the girl during this process. Some clicks are done and missed. The is result not capted so the script continues to run.

2) Yesterday, I played an event with Orbes (3k for each orbs). I played 100 SPx10 orbs to earn 300k points. I got almost 450k points. 50% extra clicks done than expected.

When the process is running, I clearly see visually that there are two clicks instead of one, so two results and only one taken into account. But not all the time.

deuxge commented 1 month ago

Strange, I will need to tests...

deuxge commented 1 month ago

I reproduced today. 47 orbes instead of 17. No clue why.

It is not always reproducible...

Franck-75 commented 1 month ago

You need to implement singleton pattern. It seems that many évents are running in parallel instead of only one.

deuxge commented 1 month ago

It is not that simple... The number of click on the "button" seems valid. The number of orbs deduced correspond to the requested amounts.... It like there is more than one request triggered on one button click...

Franck-75 commented 1 month ago

There is a mechanism of propagation in javascript so a click can be propagated in several objects matching your selection unless you stop the propagation when you process the request. https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation element.addEventListener('click', function(event) { event.stopPropagation(); // Your code here... }); This is just a guess. Hope it'll help.

deuxge commented 3 weeks ago

I know this (but thanks), but I'm not listening to the click, we are triggering it. So I'm not sure this is the way to solve it, I will keep it in mind. But I need time for this...

deuxge commented 2 weeks ago

I do not reproduce it today. Can you ? It could be a bug with the game itself...

Franck-75 commented 2 weeks ago

I've reproduced today with the "Claim All" button on DP. Singleton algorithm means that during the click, you store the information. You release it when you get the result. And if the value is set, you don't do the click.

deuxge commented 2 weeks ago

What do you reproduce on DP ? Many request sent ? What happened ? Do you have logs ?

For me there is no need of the singleton as the bot does only one click. I checked, there is no way bot click twice on a button on DP, the button is removed when clicked.

Same for pachinko. The logs when I reproduced showed bot clicked once.

Franck-75 commented 2 weeks ago

Sorry. I didn't took the logs but it's pretty much reproductible. I'll do it next time. What I see... As always. Two results "You won" coming at the same time.