eileen12 / HaremHeroes Automatic

It may just be something on my end but for some reason Auto-Questing seems to sometimes work then it just stops for no reason no matter the quest line. Below it says it worked, however the quest line does not actually proceed.

09:49:44.378 VM29715 userscript.html:177 Navigating to current quest.
09:49:44.381 VM29715 userscript.html:692 autoLoop Disabled
09:49:45.554 VM29745 userscript.html:194 Proceeding for free.
09:49:46.065 VM29745 userscript.html:203 Spending 7 Energy to proceed.
09:49:46.066 VM29745 userscript.html:218 Spending 0 Money to proceed.
09:49:46.571 VM29745 userscript.html:681 Restoring page https://nutaku.haremheroes.com/home.html

Also this line of code needs to be fixed. Obvious what is going on here with the money payment segment, although it's not actually a big deal unless you pay attention to the console.

console.log("Spending "+proceedCostEnergy+" Money to proceed.");

Feel free to check out my mission code, although not working completely and it's not perfect by any measure, it may help in your code if you start working on it. It does work with your code as I based it off your script of course credits about that are in the description. After accepting all the missions it's just a big loop of it trying to get more missions until they are all claimed (completely my fault haven't added a check for that yet).

Re: @3jameo3:

It looks like one of the game updates broke this specific functionality. When I was debugging I found that the line

var moneyCurrent = Number($("div[hero='soft_currency'] span").text().trim().replace(',', ''));

was evaluation to NaN and that would cause us to always hit the next upcoming return statement because

if(proceedCostMoney <= moneyCurrent)

would not evaluate properly.

Instead I have fixed this locally by changing the original evaluation of moneyCurrent to:

 var moneyCurrent = Number($("div[hero='soft_currency'] span").get(0).innerHTML.trim().replace(',', '')); //Number($("div[hero='soft_currency'] span").text().trim().replace(',', ''));

Of course people can feel free to remove the commented code there. The above resolved my issue and let the auto quest function work again because moneyCurrent evaluated properly instead of NaN and so the if condition evaluated properly and did not hit a return statement. This let me finally hit the ```

that I wasn't hitting before.

Hopefully :@eileen12: will be able to update the script soon. Its really great but the updates on the game seem like they might break it from time to time.

Yeah this is the line of code that needed to be fixed ::

var moneyCurrent = Number($("div[hero='soft_currency'] span").text().trim().replace(',', ''));

I fixed it like this ::

var moneyCurrent = Number($("span[hero='soft_currency']").text().trim().replace(',', ''));

Everything works perfectly now. Thanks for the place to look :@twelve27:

Re: @3jameo3:
No problem. Coincidentally I was actually about to test out a few different solutions to the issue and saw you posted one as well. I think I might switch to what you are using since its so close to what @eileen12 already had.