alnmawi User

Look at this new piece of code I found:

function is_cheat_click(e) {
    function is_cheater(e) {
        e.preventDefault();
        e.stopPropagation();
        e.stopImmediatePropagation();
        return true
    }
    var items = ["offset", "page", "screen", "client"], ne = 0, i;
    for (i in items) {
        if (items[i] + "X"in e && items[i] + "Y"in e) {
            if (0 === e[items[i] + "X"] && 0 === e[items[i] + "Y"]) {
                return is_cheater(e)
            }
        } else {
            ++ne
        }
    }
    return items.length === ne ? is_cheater(e) : false
}

:)


Of course HHTimers are not gone. They just added energy timers, which don't have $elm. Here are changes that seem to work for me:

--- HaremHeroes_Automatic.user.js       2018-07-24 21:45:06.948340700 +0200
+++ HaremHeroes_Automatic.user.js.changed       2018-07-24 21:45:19.038032200 +0200
@@ -346,7 +346,7 @@
             }
             var time = 0;
             for(var e in unsafeWindow.HHTimers.timers){
-                if(unsafeWindow.HHTimers.timers[e].$elm.selector.includes("#missions_counter"))
+                if(typeof unsafeWindow.HHTimers.timers[e].$elm != "undefined" && unsafeWindow.HHTimers.timers[e].$elm.selector.includes("#missions_counter"))
                     time=unsafeWindow.HHTimers.timers[e];
             }
             time = time.remainingTime;
@@ -354,7 +354,7 @@
             {
                 //try again with different selector
                 for(e in unsafeWindow.HHTimers.timers){
-                    if(unsafeWindow.HHTimers.timers[e].$elm.selector.includes(".after_gift"))
+                    if(typeof unsafeWindow.HHTimers.timers[e].$elm != "undefined" && unsafeWindow.HHTimers.timers[e].$elm.selector.includes(".after_gift"))
                         time=unsafeWindow.HHTimers.timers[e];
                 }
                 time = time.remainingTime;
@@ -388,7 +388,7 @@
         // need to get next contest timer data
         var time = 0;
         for(var e in unsafeWindow.HHTimers.timers){
-            if(unsafeWindow.HHTimers.timers[e].$elm.selector.includes(".contest_timer"))
+            if(typeof unsafeWindow.HHTimers.timers[e].$elm != "undefined" && unsafeWindow.HHTimers.timers[e].$elm.selector.includes(".contest_timer"))
                 time=unsafeWindow.HHTimers.timers[e];
         }
         time = time.remainingTime;
@@ -397,7 +397,7 @@
             //try again with different selector
             time = undefined;
             for(e in unsafeWindow.HHTimers.timers){
-                if(unsafeWindow.HHTimers.timers[e].$elm[0].className.includes("contest_timer"))
+                if(typeof unsafeWindow.HHTimers.timers[e].$elm != "undefined" && unsafeWindow.HHTimers.timers[e].$elm[0].className.includes("contest_timer"))
                     // get closest time
                     if(!(unsafeWindow.HHTimers.timers[e].remainingTime>time))
                         time=unsafeWindow.HHTimers.timers[e].remainingTime;
@@ -567,7 +567,7 @@
                 console.log("No arena opponents found, storing nextArenaTime...")
                 var arenatime = 0;
                 for(var e in unsafeWindow.HHTimers.timers){
-                    if(unsafeWindow.HHTimers.timers[e].$elm.selector.startsWith(".arena_refresh_counter"))
+                    if(typeof unsafeWindow.HHTimers.timers[e].$elm != "undefined" && unsafeWindow.HHTimers.timers[e].$elm.selector.startsWith(".arena_refresh_counter"))
                         arenatime=unsafeWindow.HHTimers.timers[e];
                 }
                 arenatime = arenatime.remainingTime;
@@ -676,7 +676,7 @@
             $("#pachinko button[free=1]")[0].click();
             var npach;
             for(var e in unsafeWindow.HHTimers.timersListMin){
-                if(unsafeWindow.HHTimers.timersListMin[e].$elm.selector.startsWith(".pachinko_change"))
+                if(typeof unsafeWindow.HHTimers.timers[e].$elm != "undefined" && unsafeWindow.HHTimers.timersListMin[e].$elm.selector.startsWith(".pachinko_change"))
                     npach=unsafeWindow.HHTimers.timersListMin[e].remainingTime;
             }
             if(npach !== undefined || npach !== 0)