twelve27 User

Re: @gobub:

No, my version doesn't have any extra stuff like that. I haven't started working on too much new stuff since I have been busy with other projects. Arena might be next so if it breaks I'm sure someone else along with me will try to update the script to keep it functioning. Until that point there are some things that I'll probably try to improve like pachinko which does not seem to function properly for me.

As far as the default setting of true resetting, I'm not sure what the cause of that is. I'd expect it to stick as long as you have it saved properly in tampermonkey and not in an incognito window. You don't have chrome clear data on exit or anything do you?


If you are comfortable editing the script there is a single line you have to change to determine what troll you while repeatedly fight against. Its just harder to get it to automatically load as an option but if interested I can post which line you'd need to change and an example of what to change it to


Re: @gobub:

Yes, it does need to be on homepage now. I'm aware of that and wrote about that elsewhere though. I think I should have linked to that post from a different issue thread. It can't work the way it used to because the autosalary timer was changed by the game devs and it broke the script. The current version looks at the main page to know when to collect salary. The current functioning salary collection is one that I wrote (unless devs changed something back and this version works again). I actually detail the changes I made here:

https://openuserjs.org/scripts/eileen12/HaremHeroes_Automatic/issues/harem_in_a_open_and_close_loop

I have a few comments in there and one important post in there about the changes I used to make it work. Auto Arena actually functions differently and does not need the main page the same way that salary does because its countdown can still be pulled from timers in the page.

My version is pretty much what you can find here:
https://openuserjs.org/scripts/muffin_mans/HaremHeroes_Automatic/source

It is this version with enhancements that another coder and I worked on to get things functioning better again. This script from eileen12 hasn't been updated since the last breaking change. What I have on my machine is functionally no different to this. I just have extra stuff in there from when I have been debugging and testing new stuff out.

I can't say much about it not working on Firefox because the site itself, even without scripts, does not play too nicely with Firefox.

If there is anything else I can clarify then let me know and I will try to help out.


Re: @gobub:

The script I'm using is similar to what muffin_mans has but I haven't installed the version he has because when an issue comes up I just start debugging and working on the one I have locally. Until original authors change what they have, I don't typically bother changing what script I have.

Also, I don't use Firefox because in the past HH has had issues running in Firefox for me, even before I bothered to use scripts.

My setup is an incognito chrome window where I use a script similar to what muffin_mans has listed as a mix of eileen12, 3jameo3, muffin_mans, and myself patching and adding to as well as Tampermonkey. I'd say give up on Firefox for good and don't go back because it doesn't seem to work appropriately for HentaiHeroes.

...

Why run two browsers? Are you getting an error when you run auto salary? What does it say in the console?


Re: @muffin_mans:

Thanks for adding in the salary tweak to the fork. I don't think you are missing anything else but if I run into anything then I'll let you know.



Re: @muffin_mans:
Once again thanks for your fix and posting it. The other two devs who were here recently have been on in a bit so I'm glad someone else is also doing work to maintain the script. :)


Re: @muffin_mans:

I haven't noticed anything lately but I have been using auto-refresh for a while now because of a few incidents before where the session timed out and my page was just errored. There has been a lot of server work apparently so maybe it is connected to that?


Yeah, this is still an issue. I've been investigating it slowly while trying to prioritize other stuff that breaks. This is something we see happen with both the arena as well as the auto missions in the other version of the script on this site for the final koban collection. Hopefully we can find a way to click them properly instead of odd workarounds.


Re: @muffin_mans:

That was fast. I'll try this out when I get home to my PC. Thanks for posting here. Glad to see people from sleazyfork helping out over here as well.

I think you might be right about the translations. After some of the recent changes like hiding the timer which we had to fix not too long ago, I just assumed (most likely incorrectly) that this was an intentional change against the script.


But I'll have to start debugging way later in the day as I have other stuff to take care of


I'll try to look into and start debugging. Can't tell if something with the game itself is screwed up or if another patch was pushed to try and screw things up for script users.



Once you hit the main screen, that change should work without needing changes anywhere else. Pretty sure I kept the getSalary() function the same. I tested out changing it but it didn't seem necessary. If anyone runs into an error, please post here so I can take a look and try to recreate and debug it.


Alright. I think I have something functioning correctly. While the main developers are working on this to make a more elegant solution that uses the hidden timers, try setting your autoSalary block to this:

if (sessionStorage.autoSalary === "true" && busy === false) {
        Cookies.set('possibleSalaryTime', Number($("#collect_all .sum").attr('amount')));
        if (!isNaN(Cookies.get("possibleSalaryTime"))) {
            Cookies.set('nextSalaryTime', Cookies.get("possibleSalaryTime"));
        }
        if (Cookies.get("nextSalaryTime") > 0) {
          console.log("Time to fetch salary.");
          getSalary();
          busy = true;
        }
        else if (Cookies.get("nextSalaryTime") === "none") {
            if ($("nav div[rel='content'] a:has(.home)").attr("href") !== window.location.pathname) {
                console.log("Moving to home.");
                sessionStorage.autoLoop = "false";
                // Goto Home page.
                window.location = window.location.origin + $("nav div[rel='content'] a:has(.home)").attr("href");
                busy=true;
                return;
            }
            busy = false;
        }
    }

It would be great if someone could test that out on their end to confirm. It should emulate the timers close enough so that when you get the ability to collect all money, the script will collect. Without the need to check every 30 seconds.


I thought of using something similar but I've been testing out using a solution that looks at the presence of the collect all button on the home page instead.


I'm not sure where they place the actual count for the timer now. They seem to have hidden it from where it used to be so I"m testing out a new method of collection. I'll continue to test it out when I can though. Will try to post an idea of the changes if I solve it.


Nevermind I see where the error is occuring. I'll start debugging soon




Just tested that other battleButton. It functions with troll battle but does not function for arena battle.


Re: @Pitichou:
Awesome. And I'll have to place it into my local version of the script to test out later on today.

And it fixes both troll battle and arena battle?


I should add that this solution is just what I came up with when not splitting the doBattle() function. If its going to get split then I'll leave that to eileen12 since posting that in comments for people to implement seems like it would be a hassle.


Quick and dirty fix:

In the doBattle() function, everywhere you see:

battleButton.attr("price");

change it to:

battleButton.attr("price_fe");

That _fe is what you have to add to make it work. This works flawlessly for auto arena but when you do auto troll then the prompt for spending 12 kobans for the new 10 battle system will appear. Not to worry, no kobans will actually be spent when you do this. The pop up prompt is just an ugly thing that shows up that I can't see how to resolve right now.

The solution for auto troll that I had tested was changing the button in addition to adding _fe.

It was:

var battleButton = $("#battle_middle button[rel='launch']");

and I had it changed to:

var battleButton = $("#battle_middle button[rel='launch' price_fe='1']");

But that will not work on the auto troll screen. At least if you do the temporary fix you can do both auto troll and auto arena.


Re: @twelve27:

Actually it seems it will be hard to get both working since the function to do boss battles and arena battles are not decoupled.

I can only seem to get one or the other going. Will keep looking into this though. Unless it is updated before I find some worthwhile solution