自动领取任务。
当前为
// ==UserScript==
// @name 自动领取任务
// @version 0.7
// @include https://www.mcbbs.net/*
// @author xmdhs
// @description 自动领取任务。
// @namespace https://greasyfork.org/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
}
let a = document.querySelector("#user_info_menu > ul.user_info_menu_btn > li:nth-child(4) > a")
let b = new URLSearchParams(new URL(a.href).search)
let key = b.get("formhash")
setTimeout(function () { run(key, "39", "draw"); }, 5000);
setTimeout(function () { run(key, "22", "draw"); }, 5000);
setTimeout(function () { run(key, "40", "draw"); }, 3000);
setTimeout(function () { run(key, "24", "draw"); }, 3000);
setTimeout(function () { run(key, "24", "apply"); }, 3000);
setTimeout(function () { run(key, "39", "apply"); }, 1000);
setTimeout(function () { run(key, "22", "apply"); }, 1000);
setTimeout(function () { run(key, "40", "apply"); }, 1000);
}
)();
function run(key, a, type) {
jq.get("home.php?mod=task&do=" + type + "&id=" + a + "&hash=" + key)
}