sub

try to take over the world!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         sub
// @namespace    http://tampermonkey.net/
// @version      0.3.10
// @description  try to take over the world!
// @author       cx
// @match        https://buy.damai.cn/orderConfirm*
// @run-at       document-end
// @grant        none
// @require      http://code.jquery.com/jquery-1.11.1.min.js
// ==/UserScript==
var time;
(function() {
    var url = window.location.href;
    if(url.indexOf("umidToken") == -1){
        var cookie  = getCookie("UUrl");
        console.log(cookie);
        if(cookie != null && cookie != ''){
            window.location.href = cookie;
        }
    }
    $(".next-checkbox-label").click();
    sub();

    function sub() {
        if($(".ticket-buyer-detail-item").html()!=''){
            $(".submit-wrapper>button").click();
        }else{
            $(".next-checkbox-label").click();
            $(".submit-wrapper>button").click();
        }
        again();
    }

    function again() {
        var txt = $(".opened").closest("div").html();
        console.log("+++++++++++:"+txt);
        if(txt == undefined || txt.indexOf("请稍后") != -1){
            setTimeout(function (e) {
                requestAnimationFrame(again);
            },200);
        }else if(txt.indexOf("您今天下单次数太多啦,休息一下明天再来吧") == -1){
            if(txt.indexOf("爆") != -1 || txt.indexOf("休息") != -1 || txt.indexOf("订单") == -1 || txt.indexif("建议您稍后再试") != -1){
                window.location.reload();
            }
        }
    }


    // 读取cookie
    function getCookie(c_name) {
        if (document.cookie.length > 0)     {
            var c_start = document.cookie.indexOf(c_name + "=");
            if (c_start != -1){
                c_start = c_start + c_name.length + 1;
                var c_end = document.cookie.indexOf(";", c_start);
                if (c_end == -1)
                    c_end = document.cookie.length;
                return unescape(document.cookie.substring(c_start, c_end));
            }
        }
        return "";
    }
})();