(反复试了4次后……)
我给的要求:
Write
a Tampermonkey script for https://bbs.oldmanemu.net/. This is a forum
based on Xiuno BBS. In the comment section of all posts, it should add a
button by the side of the id="submit" button so that when I click it,
the script will automatically send a reply saying "Sent by ChatGPT."
(我完全不懂js、网页这块,但我感觉是我最后加的 id="submit" button 叫它管事了……之前我以为修罗论坛既然是开源,说不定也在用来训练的资料里,但看来我是想多了?)
(另外我总感觉这玩意对中文提问适配的差点,可能是训练的材料有限?而且有时候问中文还会冒出来英文回答)
它的回复:
Here's a Tampermonkey script that should do what you're asking for:
// ==UserScript==
// @name Oldmanemu BBS Enhancer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add a button for auto-reply on Oldmanemu BBS
// @author You
// @match https://bbs.oldmanemu.net/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const replyButton = document.createElement("button");
replyButton.innerText = "Auto-Reply";
replyButton.style.marginLeft = "10px";
const submitButton = document.querySelector("#submit");
submitButton.parentNode.insertBefore(replyButton, submitButton.nextSibling);
replyButton.addEventListener("click", function() {
const textarea = document.querySelector("textarea");
textarea.value = "Sent by ChatGPT.";
});
})();
This script uses the Tampermonkey API to add a button by the side of the
"submit" button, and sets an event listener for that button so that
when it's clicked, it will automatically fill the textarea with the
message "Sent by ChatGPT."
效果:
(手贱多点了几下,发出好几条,也没法删……还请老爱放过我?)
上一篇:
小雅挂了(悲)下一篇:
吸血鬼幸存者太上头了