Sleazy Fork

I see you there.

HH Activities start next mission

HH start next mission | does missions in order: normal -> rare -> epic -> legendary

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ==UserScript==
// @name         HH Activities start next mission
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  HH start next mission | does missions in order: normal -> rare -> epic -> legendary
// @author       You
// @match        https://www.hentaiheroes.com/activities.html*
// @grant        none
// ==/UserScript==

function getMissionOfCategory(missions, category)
{
    for (var i = 0; i < missions.length; i++)
    {
        var mission = missions[i];
        if (mission.classList.contains(category))
        {
            var button = missions[i].getElementsByClassName("blue_text_button")[0];
            if (!button.hasAttribute("disabled") && button.style.display == "")
                return mission;
        }
    }
    return null;
}

function clickNextShortestMission() {
    var missions = document.getElementsByClassName("missions_wrap")[0].getElementsByClassName("mission_object");
    if (missions.length <= 0)
        return;

    var mission = null;
    if (mission == null) mission = getMissionOfCategory(missions, "common");
    if (mission == null) mission = getMissionOfCategory(missions, "rare");
    if (mission == null) mission = getMissionOfCategory(missions, "epic");
    if (mission == null) mission = getMissionOfCategory(missions, "legendary");
    if (mission == null) return;
    mission.getElementsByClassName("blue_text_button")[0].click();
}

(function() {
    'use strict';

    clickNextShortestMission();
})();