tjuptbjk

tjupt_blackjack

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         tjuptbjk
// @namespace    www.tjupt.org
// @version      0.0.3
// @description  tjupt_blackjack
// @author       WD
// @match        https://www.tjupt.org/blackjack.php
// @icon         https://tse1-mm.cn.bing.net/th/id/OIP-C.sEc-eZd2gAFWUoBuzdRMiQHaHa
// @grant        none
// @require      https://code.jquery.com/jquery-3.6.0.js
// @license MIT
// ==/UserScript==

(function() {
   'use strict';
       //检测开始状态,获取按钮的文字判断进入新的一局
       const start_btn = $('#outer > table:nth-child(3) > tbody > tr > td > table > tbody > tr:nth-child(3) > td > form > input[type=submit]:nth-child(3)');
       const start_btn_msg = $('#outer > table:nth-child(5) > tbody > tr > td > table > tbody > tr:nth-child(3) > td > form > input[type=submit]:nth-child(3)');
       const point_text = $('#outer > table > tbody > tr > td > table > tbody > tr:nth-child(2) > td > b');
       if(start_btn.val() == '开牌'||start_btn.val() == '再来一局'){
                start_btn.click();
       }else if(start_btn_msg.val() == '开牌'||start_btn_msg.val() == '再来一局'){
        start_btn_msg.click();
       }
       //小于等于16:再来一张
       if(parseInt(point_text.text().replace(/[^0-9]/ig,"")) <= 16){
              $('#outer > table > tbody > tr > td > table > tbody > tr:nth-child(3) > td > form > input[type=submit]:nth-child(2)').click();
       }
       //大于16;不再抓了,结束
       if(parseInt(point_text.text().replace(/[^0-9]/ig,"")) > 16){
               $('#outer > table > tbody > tr > td > table > tbody > tr:nth-child(4) > td > form > input[type=submit]:nth-child(2)').click();
       }
       //都不满足延时刷新
       setTimeout('location.reload()', 3000);
})();