MouseHunt Auto Horn, Super Sweet and Simple Solution

SSSS horner

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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();
        }
    }

})();