MouseHunt Auto Horn, Super Sweet and Simple Solution

SSSS horner

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         MouseHunt Auto Horn, Super Sweet and Simple Solution
// @namespace    ??
// @version      2.2
// @description  SSSS horner
// @author       MH Devs Rulez
// @include      https://www.mousehuntgame.com/
// @include      http://www.mousehuntgame.com/
// @include      https://www.mousehuntgame.com/index.php
// @include      http://www.mousehuntgame.com/index.php
// @include      https://www.mousehuntgame.com/camp.php
// @include      http://www.mousehuntgame.com/camp.php
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.setInterval(function() {check_horn();}, 41 * 1000);

    function check_horn() {
        var at_camp = document.URL == "https://www.mousehuntgame.com/" ||
                      document.URL == "http://www.mousehuntgame.com/" ||
                      document.URL == "https://www.mousehuntgame.com" ||
                      document.URL == "http://www.mousehuntgame.com" ||
                      document.URL == "https://www.mousehuntgame.com/index.php" ||
                      document.URL == "http://www.mousehuntgame.com/index.php" ||
                      document.URL == "https://www.mousehuntgame.com/camp.php" ||
                      document.URL == "http://www.mousehuntgame.com/camp.php" ;
        var king_absent = document.getElementsByClassName("mousehuntPage-puzzle-formContainer").length < 1;

        var horn_ready = document.getElementsByClassName("hornReady").length > 0;



        if (at_camp && king_absent && horn_ready)
        {
            var d = new Date();
            console.log("hunting at " + d);
            var h = document.getElementsByClassName("mousehuntHud-huntersHorn");
            if (h[0] != undefined)
                h[0].click();
        }
    }

})();