编程猫防止发言时出现“操作过于频繁,请1分钟后重试。”等(如果你被禁言了,使用这个插件是不会破除禁言的!)
当前为
// ==UserScript==
// @name 编程猫防误禁言助手
// @namespace https://shequ.codemao.cn/user/15753247
// @version 1.1.1
// @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;
e.click();
await sleep(1000);
while (!['发布成功', '发表成功', '请填写5-50字的标题', '回帖内容至少2个字', '请输入2-200字的评论内容'].includes(document.querySelector('#notices').textContent)) {
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);
})();