Greasy Fork

Greasy Fork is available in English.

天使动漫TSDM签到打工

签到和打工

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         天使动漫TSDM签到打工
// @version      1.0
// @description  签到和打工
// @author       nyutros
// @license      MIT
// @match        https://tsdm39.com/forum.php
// @match        https://tsdm39.com/plugin.php?id=np_cliworkdz:work
// @run-at       document-end
// @grant        GM_addStyle
// @namespace http://greasyfork.icu/users/1484659
// ==/UserScript==

GM_addStyle(`
.mybutton {
    height: 25px;
    width: 40%;
    line-height: 25px;
    border: 0;
    margin: 0 10px 0 0;
    padding: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    background-color: #3e87ec;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
    user-select: none;
}
.mybutton:hover {
    background-color: #3571c8;
}
.mybutton:disabled {
    background-color: #999;
    cursor: not-allowed;
}
#btnContainer {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 99999;
    display: flex;
    justify-content: flex-end;
    background: rgba(0,0,0,0.15);
    padding: 5px 10px;
    border-radius: 8px;
}
`);

(function() {
    'use strict';

    const loc = window.location;

    if(loc.pathname === "/forum.php") {
        const container = document.createElement('div');
        container.id = 'btnContainer';

        const btnCheck = document.createElement('button');
        btnCheck.className = 'mybutton';
        btnCheck.textContent = '签到';
        btnCheck.onclick = function() {
            showWindow("dsu_paulsign", "plugin.php?id=dsu_paulsign:sign&616cdca8");
            setTimeout(() => {
                Icon_selected("kx");
                const todaysay = document.getElementById("todaysay");
                if(todaysay) todaysay.value = "嘻嘻嘻嘻";
                showWindow('qwindow', 'qiandao', 'post', '0');
            }, 2000);
        };

        const btnWork = document.createElement('button');
        btnWork.className = 'mybutton';
        btnWork.textContent = '打工';
        btnWork.onclick = function() {
            window.location.href = "https://tsdm39.com/plugin.php?id=np_cliworkdz:work";
        };

        container.appendChild(btnCheck);
        container.appendChild(btnWork);
        document.body.appendChild(container);

    } else if(loc.pathname === "/plugin.php" && loc.search.includes("id=np_cliworkdz:work")) {
        jQuery(document).ready(function($){
            setTimeout(() => { $('#advids div:eq(0) a').click(); }, 300);
            setTimeout(() => { $('#advids div:eq(1) a').click(); }, 600);
            setTimeout(() => { $('#advids div:eq(2) a').click(); }, 900);
            setTimeout(() => { $('#advids div:eq(3) a').click(); }, 1200);
            setTimeout(() => { $('#advids div:eq(4) a').click(); }, 1500);
            setTimeout(() => { $('#advids div:eq(5) a').click(); }, 1800);
            setTimeout(() => { $('#stopad a').click(); }, 2000);
        });
    }
})();