Roukys / HHauto

GNU General Public License v3.0
45 stars 44 forks source link

Enhancement : Auto-grabbing the final Orgy-days reward in the Activities page #58

Closed Knatan closed 3 years ago

Knatan commented 3 years ago

Which feature is concerned The game gave me free boosters in the activities page on this final day of the Orgy event. I had to manually go in there when I decided to do that by chance. This is apparently something the script wasn't able to grab for me. Untitled

Describe the solution you'd like It would be cool if the script could grab it atomatically as a part of the "Collect" feature next to the Automission.

Extra context. Normally these events will reward you with a "Mission girl" on the last way, and that's what you will normally unlock when you visit the Activities page an extra time after all the tasks are cleared. But if you already have all of the girls the event offers, you will then get a set of free boosters instead of the event mission girl.

Roukys commented 3 years ago

@Knatan 

I was surprised to see this reward, but got it on my phone on prod server.

On test it seems that the script got it for me, because I don't get the popup.

Let's see if others have any inputs on this.

OldRon1977 commented 3 years ago

This happens, if you already have the Mission-Girl :)

Roukys commented 3 years ago

@OldRon1977 ok only second time for me I already have the mission girl :)

So for me it seems that this reward is already grabbed by the script, can you confirm ?

OldRon1977 commented 3 years ago

I can't confirm, because I didn't have the case seen myself. This girl was new to me, maybe the next time ;) Did you see the screenshot after you grabbed the reward manually or by script?

Knatan commented 3 years ago

@OldRon1977 Even if you don't have the girl you still had to manually go into the Activities page in order to grab the girl. Which is the point of this enhancement. It should auto-grab the girl, or the boosters, whichever is offered.

@Roukys I imagine it's a little bit hard to test, since we have to wait for next month's event. But this is an old issue which existed even all the way back in the Dorten script on greasyfork. I know of this because I regularly alert my guild to grab the girl / or booster on the last day of each event.

OldRon1977 commented 3 years ago

Hmmm... that might be the case... hard to test indeed since I often open up the Activities-Tab just out of curiosity. So I might have collected the girl and I was not thinking about it actively if it was by script or manually ;) But a timed auto-collect should be doable since we have that kind of auto-collect at the quests...

Roukys commented 3 years ago

yes, only opening activities is needed ? and you're sure it has to be done before next missions ?

OldRon1977 commented 3 years ago

It has to be done before the next Event is started... it is not dependent on the missions (Activities > Missions)

Roukys commented 3 years ago

ok so maybe going back to missions tab after finnishing last mission should do the trick.

yes hard to test, I will let my test server fully run next time to see if I get the girl without manual action or not.

I would think that it is the case because on test I don't remember doing manual actions, but I still got the missions girls ...

Knatan commented 3 years ago

Yeah, it's on the last day of the event. After you complete all missions in activities. But before the event ends.

Cronosus commented 3 years ago

similar problem is on events with girl from missions when is last day of event, then after completing final mission and girl could be collected, then its not. and if you forgot to grab her, then you lost her (it happened for me once already and also know others that met same misfortune)

Roukys commented 3 years ago

strange there is already a code part for that :

if(missions.length > 0)
        {
            console.log("Selecting mission from list.");
            var mission = getSuitableMission(missions);
            console.log("Selected mission:-");
            console.log(mission);
            console.log("Selected mission duration: "+mission.duration+"sec.");
            var missionButton = $(mission.missionObject).find("button:visible").first();
            console.log("Mission button of type: "+missionButton.attr("rel"));
            console.log("Clicking mission button.");
            missionButton.click();
            setTimer('nextMissionTime',Number(mission.duration)+1);
        }
        else
        {
            console.log("No missions detected...!");
            // get gift
            var ck = sessionStorage['giftleft'];
            var isAfterGift = document.querySelector("#missions .after_gift").style.display === 'block';
            if(!isAfterGift){
                if(ck === undefined || ck === 'giftleft')
                {
                    console.log("Collecting gift.");
                    delete sessionStorage['giftleft'];
                    document.querySelector(".end_gift button").click();
                }
                else{
                    console.log("Refreshing to collect gift...");
                    sessionStorage['giftleft']='giftleft';
                    window.reload();
                    // is busy
                    return true;
                }
Knatan commented 3 years ago

@Roukys are you ready for testing? Today is the opportunity to grab the mission girl of December's Latexmass event.

Cronosus commented 3 years ago

yeah, it didnt grabbed her automatically....

Knatan commented 3 years ago

Agreeing with Cronosus v5.2.0 was not able to grab her automatically.

Here is one more piece of info I found. https://user-images.githubusercontent.com/1931284/101718841-5596ef00-3aa2-11eb-9e1c-8d0baaf2caef.png It is not necessary to grab the 150 Koban reward in order to grab the mission girl. You can certainly grab her after you grabbed the 150 Koban. But you can also grab the mission girl before you grab the 150. As long as it happens before the event ends, it's all good.

Roukys commented 3 years ago

on my side it was grabbed successfully on both test and prod ...

Cronosus commented 3 years ago

i used 5.3beta

i think its because event mission is always finished the last for me, and then it grab kobans but not this girl. because i get her when i opened missions myself. same on both platforms for me (hentai/nutaku)

Roukys commented 3 years ago

Hello guys,

question, when it does not get the girl, does it get the kobans ?

Because if it does that is strange that it is able to get kobans and not the reward.

Cronosus commented 3 years ago

yes, it collect kobans, but not the girl maybe there may be possible little fix: after collecting last mission and kobans, just let script reopen mission page again, this should collect girl, if there is any. theoretically, still need to test it.. now theres orgy days, so another mission girl, so its possible to test it soon

Roukys commented 3 years ago

yes strangely the script seems setted to do that : 

var ck = sessionStorage['giftleft'];
            var isAfterGift = document.querySelector("#missions .after_gift").style.display === 'block';
            if(!isAfterGift){
                if(ck === undefined || ck === 'giftleft')
                {
                    console.log("Collecting gift.");
                    delete sessionStorage['giftleft'];
                    document.querySelector(".end_gift button").click();
                }
                else{
                    console.log("Refreshing to collect gift...");
                    sessionStorage['giftleft']='giftleft';
                    window.reload();
                    // is busy
                    return true;
                }
            }

I'll check end of my daily missions if these indicators still work.

Could also be possible that reward girl is not available strictly just after finishing last mission.

Roukys commented 3 years ago

that's the issue ck is always undefined.

I'll test and publish a fix

Roukys commented 3 years ago

tried a fix in 5.3-beta.18

Knatan commented 3 years ago

There is a great opportunity for testing today with a mission girl available. I will test 5.3-beta.21 With these settings to emulate normal use case: https://user-images.githubusercontent.com/1931284/102628906-b67d9180-414a-11eb-889a-72a9684e7a7d.png

And with these settings to isolate the feature: https://user-images.githubusercontent.com/1931284/102629022-e331a900-414a-11eb-83aa-ca9206ad1026.png

Cronosus commented 3 years ago

i have almost all features enabled, so it will be normal case for me.. well see

Knatan commented 3 years ago

I can confirm both settings I used worked, and they both grabbed the mission girl. This feature now works in beta 21. But I did noticed a small bug.

With these settings to emulate normal use case: https://user-images.githubusercontent.com/1931284/102628906-b67d9180-414a-11eb-889a-72a9684e7a7d.png

With the settings above, the script got stuck, and allowed me time to take this screenshot here: Untitled At this point the script had not grabbed the girl yet. The script had completed the final mission, and grabbed the 30 Koban mission reward. The script froze, but then my browser-tab auto-refresher activated after a few minutes. And then the script automatically grabbed the girl and the 150 Koban of the day.

So I'm happy with the final result. It's now very functional for my use case.

Cronosus commented 3 years ago

this screen shows to me in more occasions, not just missions, on seasons and others too. but its not a big problem, page always refresh after a while. and yes, it collected for me too.

Knatan commented 3 years ago

I assume the small bug above has been fixed with issue #103 So if my suspicion is correct then this #58 has been fully fixed.