eileen12 / HaremHeroes Automatic

Is there any fixes for the AutoArenaBattle? You know the one with it breaking and not battling?

I am still testing things but I may have found a lead just now. If my assumption is correct then all the problems caused by popups may be fixed with this. Will keep everyone posted on the results.

If anyone wants to test with me add this to autoLoop() above pachinko so it always runs first ::

    if(document.getElementById("popups").style.display === "block")
            {
                console.log("Popup detetcted. Refresh page.");
                unsafeWindow.reload();
                return;
            }

Then remove the popup code from arena.

May have to change any of these that have a popup associated with them to true though.

sessionStorage.autoLoop = "false";

Will have the results back after arena gets updated with rewards again or when pachinko gets it's free button back which ever comes first.

Update it in your fork, can test it tomorrow when it reset.

I am going to work on a new part of the script and have it control all the popups that I can.

I did some testing of my own. The problem is that the popups take a bit of time to load. The code breaks because the popup comes after the if-test for popup has already happened. If the if-clause is executed with a delay of about 10ms, the code should work.

I came up with a very dirty solution for my own code. Inside the doBattle() function, inside "if(page===arena)" I simply added "unsafeWindow.reload();" in the very beginning. This way, every time arena is brought up, the page refreshes first no matter what, then everything else happens. I also deleted the if/else inside "if(page===arena)" regarding the popup.

I have been running this now for more than a week and works flawlessly.

Latest test version hasn't been tested yet so enjoy testing. I added some setTimeout()s here and there so let me know on my issue page so I know what is happening with the test.