Greasy Fork

自动领取任务

自动领取任务。

目前为 2020-02-16 提交的版本。查看 最新版本

// ==UserScript==
// @name         自动领取任务
// @version      0.4
// @include      https://www.mcbbs.net/*
// @author       xmdhs
// @description  自动领取任务。
// @namespace https://greasyfork.org/users/166541
// ==/UserScript==

(function () {
    var a = document.getElementsByClassName("user_info_menu_btn");
    var b = a[0].childNodes[7].lastChild.href;
    var c = b.indexOf('&formhash=');
    var key = b.substring(c + 10);
    run(key, "39", "draw");
    run(key, "22", "draw");
    run(key, "40", "draw");
    run(key, "39", "apply");
    run(key, "22", "apply");
    run(key, "40", "apply");

}
)();

function run(key, a, type) {
    var xmlhttp;
    xmlhttp = new XMLHttpRequest();
    xmlhttp.open("GET", "home.php?mod=task&do=" + type + "&id=" + a + "&hash=" + key, true);
    xmlhttp.send();
}