mcbbs 自动领取任务

自动领取任务。

目前为 2022-03-22 提交的版本。查看 最新版本

// ==UserScript==
// @name         mcbbs 自动领取任务
// @version      0.9.0
// @include      https://www.mcbbs.net/*
// @author       xmdhs
// @description  自动领取任务。
// @namespace https://gf.qytechs.cn/users/166541
// ==/UserScript==

(function () {
    let times = localStorage.getItem("autoapply")
    if (Math.round(new Date().getTime() / 1000) - times >= 60) {
        localStorage.setItem("autoapply", Math.round(new Date().getTime() / 1000))
    } else {
        return
    }
    sign()
    async function sign() {
        let f = await fetch("/api/mobile/index.php?version=4&module=profile", { credentials: "same-origin" });
        let j = await f.json();
        let key = j.Variables.formhash;
        await sleep(1000);
        run(key, "39", "draw");
        run(key, "22", "draw");
        run(key, "40", "draw");
        run(key, "24", "draw");
        await sleep(2000);
        run(key, "24", "apply");
        run(key, "39", "apply");
        run(key, "22", "apply");
        run(key, "40", "apply");
    }

    async function sleep(t) {
        return new Promise((rs, rj) => {
            setTimeout(() => { rs() }, t)
        })
    }

    function run(key, a, type) {
        return fetch("home.php?mod=task&do=" + type + "&id=" + a + "&hash=" + key, { credentials: "same-origin" })
    }
}
)();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址