// ==UserScript==
// @name 一键撸猫
// @namespace knva
// @version 0.2
// @homepage https://greasyfork.org/zh-CN/scripts/381918
// @description 一键撸猫帮助你更好的撸猫
// @author knva
// @match https://likexia.gitee.io/cat-zh/
// @grant none
// @downloadURL none
// ==/UserScript==
(function () {
'use strict';
var UI = {
Btn: (pclass, text) => {
return `
`;
},
};
var WG = {
init: () => {
var html = UI.Btn("startbtn", '开始') + UI.Btn("stopbtn", '停止') ;
$("#gameContainerId").after(html);
; $(".startbtn").on("click", () => {
WG.starttimer();
})
; $(".stopbtn").on("click", () => {
WG.stoptimer();
})
},
sleep: () => {
},
p_timer: [null, null],
starttimer: () => {
WG.p_timer[0] = setInterval(() => {
$('.btn').first().click()
}, 5);
WG.p_timer[1] = setInterval(() => {
$.each($(".btn"), function () {
if ($(this).html().indexOf("精炼") >= 0) {
$(this).click();
}
});
}, 1000);
},
stoptimer: () => {
for (let item of WG.p_timer) {
clearInterval(item);
}
}
}
// Your code here...
$(document).ready(function () {
WG.init();
});
})();