编程猫防止发言时出现“操作过于频繁,请1分钟后重试。”等(如果你被禁言了,使用这个插件是不会破除禁言的!)
当前为
// ==UserScript==
// @name 编程猫防误禁言助手
// @namespace https://shequ.codemao.cn/user/15753247
// @version 1.0.0
// @description 编程猫防止发言时出现“操作过于频繁,请1分钟后重试。”等(如果你被禁言了,使用这个插件是不会破除禁言的!)
// @author QXN独立的暴风雀
// @match *://shequ.codemao.cn/*
// @icon https://shequ.codemao.cn/favicon.ico
// @grant none
// @license GPL
// ==/UserScript==
(function() {
'use strict';
window.pluginClick = false;
async function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function onClick({ srcElement: e }) {
if (!window.pluginClick) {
window.pluginClick = true;
for (let _ = 0; _ < 250; _++){
e.click();
await sleep(10);
}
console.log('编程猫防误禁言助手发送完成。');
window.pluginClick = false;
}
}
setInterval(() => {
document.querySelectorAll('.r-community-c-forum_sender--option, .r-community-r-detail--send_btn, .r-community-r-detail-c-comment_reply--reply_send').forEach(el => {
el.removeEventListener('click', onClick);
el.addEventListener('click', onClick);
});
}, 2000);
})();