3jameo3 Author

Re: @eileen12:

VM365 userscript.html:858 Time to fetch Pachinko.
VM365 userscript.html:827 Detected Pachinko Screen. Fetching Pachinko
VM365 userscript.html:1014 Restoring page https://nutaku.haremheroes.com/home.html
VM360 phoenix-default-53138249.js:7644 error 
{class: "Pachinko", action: "play", what: "pachinko0", how_many: "1"}
 
Arguments(3) [{…}, "error", "", callee: ƒ, Symbol(Symbol.iterator): ƒ]

This is what happened to a new incognito window with the latest update. The bug we were talking about happened in the previous version. This bug occurred in the 3.2 update and did not collect pachinko as a result.


Re: @eileen12:

I reloaded the page once that occurred it was just bugging me because the script was running fine for a day or two before that. So I figured I would post the error and see if there was something in there that caused it or if it was just on my end.



AutoMissions does collect everything including the kobans at least as far as the 3.163 update. AutoArena I have no idea about though as I don't use it.



No idea what happened, this showed up in user messages so I decided its best left to someone who understands.

userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:4 ERROR: Execution of script 'HaremHeroes Automatic' failed! $(...).ready is not a function
(anonymous) @ userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:4
(anonymous) @ userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:5
(anonymous) @ userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:981
(anonymous) @ VM15593:2
E_c @ VM15593:3
ka @ VM15595:61
create @ VM15595:72
e @ VM15595:16
setTimeout (async)
(anonymous) @ VM15593:2
y.(anonymous function) @ VM15593:8
(anonymous) @ VM15595:16
runListeners @ VM15595:16
(anonymous) @ VM15595:73
R @ VM15593:10
e @ content.js:6
send @ content.js:8
(anonymous) @ content.js:27
processQueue @ content.js:3
a @ content.js:10
19:34:16.606 userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:4 TypeError: $(...).ready is not a function
    at Window.tms_dcdf8f8e_5755_4598_968b_0e6804a38873 (userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:980)
    at <anonymous>:2:491
    at eval (userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:4)
    at eval (userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:5)
    at Object.eval (userscript.html?id=dcdf8f8e-5755-4598-968b-0e6804a38873:981)
    at <anonymous>:2:491
    at Object.E_c (<anonymous>:3:302)
    at ka (eval at exec_fn (harem.html:1), <anonymous>:61:380)
    at Object.create (eval at exec_fn (harem.html:1), <anonymous>:72:334)
    at e (eval at exec_fn (harem.html:1), <anonymous>:16:157)

Re: @eileen12:

Contests also has the same undefined error when there are ongoing contests.

Re: @Cronosus:

Instead of cleaning your cookies you can put doMissionStuff(); or whichever function at the end of the script, save the script and then reload the page once. After that you have to remove that line and then save the script and reload the page.

If you are really adventurous you could add a toggle to reset to the defaults and add in the vars for each mini-script inside the script setting them to a number. Or add a button to run each of the mini-scripts once.



Re: @Cronosus:

Weird it was collecting those for me. With that error when new missions pop up the missions script will actually completely stop working unless there is something in the script somewhere to avoid that snag.


Re: @Cronosus:

It's part of auto questing. I cannot remember if it the one which finishes the current quest or the one that finishes the quest area as a whole.


This fix is for the end_play button that sometimes has money or energy required to actually click the button.

else if (proceedType === "end_play") {
        var energyCurrent = getHero().infos.energy_quest;
        var moneyCurrent = getHero().infos.soft_currency;
        if(proceedCostEnergy <= energyCurrent)
        {
            // We have energy.
            console.log("Spending "+proceedCostEnergy+" Energy to proceed.");
        }
        else
        {
            console.log("Quest requires "+proceedCostEnergy+" Energy to proceed.");
            sessionStorage.questRequirement = "*"+proceedCostEnergy;
            return;
        }
        if(proceedCostMoney <= moneyCurrent)
        {
            // We have money.
            console.log("Spending "+proceedCostMoney+" Money to proceed.");
        }
        else
        {
            console.log("Spending "+proceedCostEnergy+" Money to proceed.");
            sessionStorage.questRequirement = "$"+proceedCostMoney;
            return;
        }
        console.log("Reached end of current play. Proceeding to next play.");
        sessionStorage.autoLoop = "false";
        proceedButtonMatch.click();
    }

Re: @Cronosus:

In a nutshell it would be a search that finds the first troll with girls starting from href="/battle.html?id_troll=1" to the last one that your account can do which is the way it currently does the trolls. Once the first troll has no more girls the search would start again and find the next troll you are able to do that has girls. Then say well what if the search returns nothing well lets have the search wait 24 hours and then search again in case of an event or new area. While it is waiting it would do as it always does and do the last troll for money.

I think that should cover all the bases concerning the girl hunting.


VM368 userscript.html:406 Missions parsed, mission list is:-
VM368 userscript.html:407 []
VM368 userscript.html:422 No missions detected...!
VM368 userscript.html:429 New missions in: undefinedsec.

As I do not know where this is trying to grab the time from, considering my limited JavaScript knowledge, I have no idea how to fix this.


Along with the troll selection I have been wondering if there was a way for it to auto fight trolls that have girls remaining using some sort of search function. The class for the girls icon is "girls_reward girl_ico" and considering that it vanishes after all the girls are gotten I figure this may be an interesting thing to add at some point.


Mine is just a basic version for missions that works most of the time. My JavaScript knowledge is not good enough to make it fully work all of the time. So if anyone wants to tinker with the code go for it. It can be added into this script without much difficulties as well.

Based on the old code of this script

That link is the entire script I run which also has a few fixes here and there that still haven't been addressed in this one. Such as the AutoQuest not correctly running when the end_play button needs energy or money. I also prefer the old version of pachinko where it actually counts to 24hrs before attempting to run again instead of it being based on the timers of the site.





Auto Missions is really giving me a major headache even with your changes it just does not want to work.


// @match https://www.hentaiheroes.com/*

It seems to be working with just that at least questing and salary does I will know more once the account gets out of the beginner area..


Re: @twelve27:

Do your missions work with this current script?

I am still fine tuning the script though not much has been done due to other errors like the salary incident when they decided to change the entire layout which I actually like. Currently with the code I have posted above missions seem to work as long as market/harem/missions/etc is open or the page changes screens sometimes. Other than that I have yet to be able to get it fully functional without any problems. Going from python to java after a good long while is messing with my head.


Re: @twelve27:

Also, we'll need to make a change that clicks the groovy button when all missions are completed.

I am assuming you are referring to the 25 gold present box? I have the code, at least for the button, in the script just have never actually tested to see what all I need to do to make it work.

Referring to your code I may change it to that depending on if it seems to be working completely. At the current time I had to fix salary so I went ahead and added in the same button format as missions while I was at it. Also seems like collecting missions is my only problem well unless the mission screen is open then everything seems to work wonders, unsure about the next time to new missions part though (MB2).

I'm wondering what to do about salary occasionally and missions frequently not activating and doing there actions right away.

I have been trying to figure out that problem for a long while. I so far haven't got a single clue on how to fix the issue minus leaving one of the pages, market harem etc, up at all times which forces it to change screens which works.


Maybe a redirect to home would actually be better for the undefined check. I'm not sure at the moment So in the next 2 days I will test both.


Re: @twelve27:

With the current code mine stops working before the collecting part of the script activates as well as sometimes halts before the accepting mission which is the redirection problem, and it throws undefined when the all missions completed part activates. The later should be an easy fix with just an undefined handler.

I could implement a redirection when the groovy button is detected in the claiming missions phase and that should solve the issue of that snag.

For instance right now my missions are halted because of the script stopping before claiming a mission. I am assuming that the conditions I set are too strict for it but at the same time it doesn't actually make sense to me how they are too strict. Even a redirection caused by auto salary didn't engage the collection feature. Then sometimes it works flawlessly.

So add this to the MB2 area under the

document.cookie = "nextActivityTime=present;max-age=" + (closestTime1 < 0 ? 0 : closestTime1);
if (Cookies.get("nextActivityTime") === undefined && MB2.length >= 0) {
                getMission();
            }

And for the groovy button add this either before or after the clicking function

window.location = window.location.origin + $("nav div[rel='content'] a:has(.activities)").attr("href");

You could comment out anything you don't want in it if you wish considering this will redirect the screen back to the missions screen.

Not sure if this will completely fix the issues or not though.


Re: @twelve27:

that was meant as a reply to you now myself guess that is what I get for waking up and immediately trying to do things.