Auto and hotkey re-roll

Either manually or automatically re-roll bot replies.

当前为 2024-11-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Auto and hotkey re-roll
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-11-08
  5. // @description Either manually or automatically re-roll bot replies.
  6. // @author You
  7. // @match https://www.figgs.ai/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=figgs.ai
  9. // @grant none
  10. // @require http://code.jquery.com/jquery-3.4.1.min.js
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. let intervalId;
  17.  
  18. document.querySelector('body').addEventListener("keydown", (event) => {
  19.  
  20. if (event.key === "F1") { //Start creating new messages
  21. if (!intervalId) {
  22. intervalId = setInterval(reroll, 5000);
  23. }
  24. }
  25.  
  26. if (event.key === "F2") { //Stop creating new messages
  27. clearInterval(intervalId);
  28. intervalId = null;
  29. }
  30.  
  31. if (event.key === "Dead") { //Create one new message
  32. reroll();
  33. }
  34. });
  35.  
  36. function reroll() {
  37. document.querySelector('[aria-label="reroll bot message"]').click();
  38. }
  39.  
  40. })();