找回密码
 加入
搜索
查看: 199|回复: 9

autoitx论坛自动签到油猴js脚本

[复制链接]
发表于 2024-4-28 11:13:28 | 显示全部楼层 |阅读模式


油猴请自行安装
游客,如果您要查看本帖隐藏内容请回复


发表于 2024-4-29 08:10:55 | 显示全部楼层
还有这好东西哈。
发表于 2024-4-29 09:41:20 | 显示全部楼层
看看是怎么样的
发表于 2024-4-29 15:31:01 | 显示全部楼层
终于有了。。。。。等好久了
发表于 2024-4-29 15:34:37 | 显示全部楼层
能不能参考52pojie的自动签到脚本,改改
// ==UserScript==
// @icon         https://www.52pojie.cn/favicon.ico
// @name         52pojie吾爱破解论坛自动签到助手_免打扰_2022
// @namespace    https://zfdev.com/
// @version      0.6
// @description  打开论坛自动签到, 无其他提示
// @author       ZFDev
// @match        *://www.52pojie.cn/*
// @exclude      *://www.52pojie.cn/home.php?mod=task*
// @run-at       document-idle
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function saveDate(){
        localStorage.setItem('autoSign',new Date().toDateString());
    }
    function isTody(){
        var lastSignDate = localStorage.getItem('autoSign');
        if(lastSignDate){
            return new Date(lastSignDate).toDateString() === new Date().toDateString();
        }else{
            return false;
        }
    }

    function bSign(){
        return new Promise(function (resolve, reject) {
            var f = document.createElement('iframe')
            // f.style="width:1000px;height:500px;display: none;outline: none;"
            f.src = "/home.php?mod=task&do=apply&id=2&referer=%2Fforum.php"
            f.style="width:1000px;height:500px;"
            f.onload = function(e){
                var u = e.target.contentWindow.location.search
                var c = f.contentWindow.document.body.textContent
                if (u.indexOf(s.p)>=0) {
                    if (c.indexOf(s.n) > 0){
                    } else {
                        f.remove()
                        resolve(c)
                    }
                }
            }
            document.body.append(f)

        })

    }

    let s = {
        a: "正在自动签到...",
        b: "本期您已申请过此任务",
        c: "您已经签到了!",
        d: "任务已完成",
        f: "签到成功!",
        g: "签到失败!",
        h: '<img src="https://static.52pojie.cn/static/image/common/wbs.png" class="qq_bind" align="absmiddle" alt="">',
        i: "自动签到中..",
        j: '#hd .wp #um p > a > img[src*="qds.png"]',
        k: 'home.php?mod=task&do=apply&id=2',
        l: 'home.php?mod=task&do=draw&id=2',
        m: '403 Forbidden',
        n: '请开启JavaScript并刷新该页',
        o: 0,
        p: '?mod=task&do=draw',
        q: '?mod=task&do=apply',

    }
    function autoSign(num) {
        if (!isTody()){
            let a = document.querySelector(s.j);
            if(s.o || a){
                s.o = 1
                a = a.parentNode;
                a.text = s.i;
                try{
                    var x = new Ajax();

                }catch(e){
                    if(!num || num < 2){
                        setTimeout(function(){
                            autoSign(num+1);
                        },2000);
                    }
                    return;
                }
                console.log(s.a);
                bSign().then(function (res) {
                    if(res.indexOf(s.b)>0){
                        console.log(s.c);
                        saveDate();
                        a.outerHTML = s.h;
                    }else if(res.indexOf(s.d)>0){
                        console.log(s.f);
                        saveDate();
                        a.outerHTML = s.h;
                    }else if(res.indexOf(s.m)>0 || res.indexOf(s.n)>0){
                        autoSign(0);
                    }else{
                        console.log(s.g);
                    }
                })
            }
        }
    }
    autoSign(0);
})();
 楼主| 发表于 2024-4-29 15:40:50 | 显示全部楼层
3131210 发表于 2024-4-29 15:34
能不能参考52pojie的自动签到脚本,改改

精力有限,请自行改改
发表于 6 天前 | 显示全部楼层
看看是怎么样的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-13 07:50 , Processed in 0.077434 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表