您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动回帖后刷新
当前为
// ==UserScript== // @name 2048自动回贴刷新 // @namespace http://tampermonkey.net/ // @version 0.11 // @description 自动回帖后刷新 // @author zzx114 // @match https://hjd2048.com/2048/read.php?tid=* // @grant none // @license MIT // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // ==/UserScript== (function() { 'use strict'; // 在这里编写您的自动回复逻辑 const replyMessage = "感谢楼主分享。"; // 检测页面上是否已存在回复内容 const existingReplies = document.querySelectorAll("#main > div:nth-child(18)"); // 更新为实际的回复内容选择器 let isReplyPresent = false; existingReplies.forEach((reply) => { if (reply.textContent.includes(replyMessage)) { isReplyPresent = true; } }); // 如果页面上没有预设的回复内容,则填充并提交回复 if (!isReplyPresent) { setTimeout(() => { // const replyButton = document.querySelector("#reply-button"); // 替换为实际的回复按钮选择器 // if (replyButton) { // replyButton.click(); // } const replyInput = document.querySelector("textarea#textarea"); // 替换为实际的回复输入框选择器 if (replyInput) { // 如果存在输入框,填充回复内容 replyInput.value = replyMessage; } else { // 如果不存在输入框,打印一条消息到控制台 console.log("没有找到回复输入框!"); // 可以选择在这里添加其他逻辑,比如跳过回复步骤 return; // 退出当前的setTimeout函数 } const submitButton = document.querySelector("input.btn"); // 替换为实际的提交按钮选择器 if (submitButton) { submitButton.click(); } }, 3000); // 等待5秒后再回复 } // 如果页面上没有预设的回复内容,则在15秒后刷新页面 if (!isReplyPresent) { setTimeout(() => { window.location.reload(); }, 5000); // 等待5秒后回复,然后3秒后刷新页面 } })();