auto wof

自动大转盘

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        auto wof
// @namespace   Violentmonkey Scripts
// @match       https://cf.hdkylin.com/wof.php
// @match       https://www.hdkyl.in/wof.php
// @grant       none
// @version     0.0.2
// @author      Exception
// @description 自动大转盘
// @license MIT
// ==/UserScript==

(function () {

    var host = window.location.host;

    if (sessionStorage.getItem('confirm') != 'ok') {
        if (confirm("确定要执行操作吗?")) {
            sessionStorage.setItem('confirm', 'ok');
        } else {
            window.location.assign('https://' + host)
        }
    }

    var wait = ms => new Promise(resolve => setTimeout(resolve, ms))

    if (window.location.href.indexOf('https://' + host + '/wof.php') == 0) {
        wait(5000).then(() => {
          var newWindow = window.open('https://' + host + '/wof/ajax_chs.php?app=lottery_json', '_blank'); // 替换为你想要打开的网址

          // 等待1秒后尝试关闭窗口
          if (newWindow) {
              setTimeout(function() {
                  try {
                      // 尝试关闭窗口
                      newWindow.close();
                  } catch (e) {
                      // 浏览器可能会阻止关闭,所以这里什么都不会发生
                      console.error('无法关闭窗口:', e);
                  }
                location.reload();
              }, 1000); // 1秒后尝试关闭
          }

        });
    }

    var timer1 = setInterval(function () {
        // 查找具有 class="layui-layer-btn0" 的元素
        var element = document.querySelector('.layui-layer-btn0');
        if (element) {
            // 如果找到了元素
            clearInterval(timer1);
            $(element).click();
        }
    }, 2000);
})();