HaremHeroes Automatic

Open the menu in HaremHeroes(topright) to toggle AutoControlls. Supports AutoSalary, AutoContest, AutoMission, AutoQuest, AutoTrollBattle, AutoArenaBattle and AutoPachinko(Free). Messages are printed in local console.

< Commentaires sur HaremHeroes Automatic

Question / commentaire

§
Posté le: 2018-03-23
Édité le: 2018-03-23

I need some help.

Note: I am not the creator of the script, I am only one of the people who use them. The creator doesn't seem to read the feedback on it so the users can't get help from the one who created it. So I need some help in this script: https://greasyfork.org/en/scripts/31313-haremheroes-automatic, which is a script on a game on nutaku.net, that automates the processes.

So what I need help in: In one of the automatons, it automates the battle of a boss as long as you have the energy for it. But it only automates the latest boss and I need it to automate the other bosses so I can get the drops from them.

This is the part that I think affects the one that it battles.

var doBossBattle = function()
{
    var currentPower = Number($("span[hero='energy_fight']").text());
    if(currentPower < 1)
    {
        //console.log("No power for battle.");
        return;
    }
    // Battles the latest boss.
    // Navigate to latest boss.
    if(window.location.pathname.startsWith("/battle.html"))
    {
        // On the battle screen.
        doBattle();
    }
    else if(window.location.pathname.startsWith("/quest"))
    {
        // On some quest screen.
        // Goto this area's screen.
        console.log("Navigating to latest Troll.");
        sessionStorage.autoLoop = "false";
        window.location = window.location.origin + $("#breadcrumbs a[class='back']").last().attr("href");
        return;
    }
    else if(window.location.pathname.startsWith("/world"))
    {
        // On some world screen.
        // Click on the local Boss's battle button.
        console.log("Entering battle with this troll.");
        sessionStorage.autoLoop = "false";
        window.location = window.location.origin + $("#worldmap a[class='troll_world']").attr("href");
        return;
    }
    else{
        console.log("Navigating to latest Troll.");
        sessionStorage.autoLoop = "false";
        window.location = window.location.origin + $("nav div[rel='content'] a:has(.continue_quest)").attr("href");
        return;
    }
};

Being the newbie that I am, I don't know how this script actually work. To fix this I went to the script discussions and posted this: https://greasyfork.org/en/forum/discussion/35427/ Xynoth told me to do this in the discussion:

"Go to these lines (starts at around line 155):

    else{
        console.log("Navigating to latest Troll.");
        sessionStorage.autoLoop = "false";
        window.location = "The-link-of-the-troll-world-goes-here"; /* window.location.origin + $("nav div[rel='content'] a:has(.continue_quest)").attr("href"); */
        return;
    }

...And change the "window.location" link to the world of the troll you want to battle (it can be either the direct troll window, or the world the troll is in)."

The link I placed was this: https://nutaku.haremheroes.com/battle.html?id_troll=#, # being the number of which troll the script is suppose to battle. It sort of worked, but all it does is bring me to the battle page where it doesn't automate it and battle it/ do what it normally does when the script is not modified yet.

So yeah... I don't know what to do and the guy, Xynoth, was not online since then to help me. Note: I actually did wrong in implementing the said edit above, but when I fixed it and waited for the automation it actually resulted in the result below the edit.

Well, thank you for reading through this and please help me, and if you are working on it, thank you in advance.

Update: I checked the console when the AutoBattle is running with energy and it looks like it runs in a sort of loop like this:

Navigating to latest Troll. autoLoop Disabled

Multiple times till I click on the battle button.

§
Posté le: 2018-03-23

Also, it presents errors like this:

ERROR: Execution of script 'Harem Heroes++' failed! Cannot read property 'substr' of undefined
TypeError: Cannot read property 'substr' of undefined
at HTMLUnknownElement.eval (VM87541 userscript.html:411)
at Function.each (VM87530 jquery.min.js:3)
at init.each (VM87530 jquery.min.js:3)
at HTMLDivElement.eval (VM87541 userscript.html:376)
at Function.each (VM87530 jquery.min.js:3)
at init.each (VM87530 jquery.min.js:3)
at ModifyHarem (VM87541 userscript.html:356)
at Window.eval (VM87541 userscript.html:55)
at :2:120
at eval (VM87541 userscript.html:2)
and
h_ajax() error, Response was: phoenix-default-52161942.js:6906

§
Posté le: 2018-03-24
Édité le: 2018-03-24

Sorry, did not check this until now...
So I have it like this
else{
console.log("Navigating to latest Troll.");
sessionStorage.autoLoop = "false";
window.location = "https://nutaku.haremheroes.com/battle.html?id_troll=8"; /* window.location.origin + $("nav div[rel='content'] a:has(.continue_quest)").attr("href"); */
return;
}


...and it works for me. Make sure to encase your link between ""'s, and end the line with a ; otherwise it will read it as something totally different than a link, and without the ; it will give even more errors.

The /* window.location.origin + $("nav div[rel='content'] a:has(.continue_quest)").attr("href"); */ part of it isn't needed, the /* */ turns those lines into a comment (so they aren't read), but I left it there if for some case you'd want to go back to the old one without having to reinstall the script (just deleting the commenting slashes to leave it like it was). Since those are actually CSS comments they could cause some kind of problem depending on which userscript extension you are using, so either just write // before that and delete the /* and */, or delete that part (you can always reinstall the whole script in the worst case scenario if you want to have that line back, or copy the line from here).

The errors you sent seem to point to other script, to Harem Heroes++ instead of the auto one, so... if there is anything conflicting, i guess that would be a good candidate (Even thought I also have that script along with the auto and never did anything like that).

§
Posté le: 2018-03-24
Sorry, did not check this until now...
So I have it like this
else{
console.log("Navigating to latest Troll.");
sessionStorage.autoLoop = "false";
window.location = "https://nutaku.haremheroes.com/battle.html?id_troll=8"; /* window.location.origin + $("nav div[rel='content'] a:has(.continue_quest)").attr("href"); */
return;
}


...and it works for me. Make sure to encase your link between ""'s, and end the line with a ; otherwise it will read it as something totally different than a link, and without the ; it will give even more errors.

The /* window.location.origin + $("nav div[rel='content'] a:has(.continue_quest)").attr("href"); */ part of it isn't needed, the /* */ turns those lines into a comment (so they aren't read), but I left it there if for some case you'd want to go back to the old one without having to reinstall the script (just deleting the commenting slashes to leave it like it was). Since those are actually CSS comments they could cause some kind of problem depending on which userscript extension you are using, so either just write // before that and delete the /* and */, or delete that part (you can always reinstall the whole script in the worst case scenario if you want to have that line back, or copy the line from here).

The errors you sent seem to point to other script, to Harem Heroes++ instead of the auto one, so... if there is anything conflicting, i guess that would be a good candidate (Even thought I also have that script along with the auto and never did anything like that).

Thanks it got fixed.

§
Posté le: 2019-04-12

I can share with good HTML and CSS guide. Recently I made one site according with this book

Leave a Comment https://thebestwalkietalkies.com/

Poster une réponse

Connectez-vous pour poster une réponse.