Keep ChatGPT Alive 保持ChatGPT一直有效

Keeps ChatGPT responsive by automatically inputting a question every x minutes

当前为 2023-02-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Keep ChatGPT Alive 保持ChatGPT一直有效
  3. // @namespace https://github.com/new4u
  4. // @version 0.3
  5. // @description Keeps ChatGPT responsive by automatically inputting a question every x minutes
  6. // @author new4u本爷有空
  7. // @match https://chat.openai.com/*
  8. // @grant none
  9. // @copyright 2015-2022, new4u
  10. // @license GPL-3.0-only
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. setInterval(function () {
  17. // input a question into the chat box
  18. const textarea = document.querySelector("textarea");
  19. textarea.value = "继续";
  20. textarea.dispatchEvent(new KeyboardEvent("keydown", {
  21. bubbles: true,
  22. cancelable: true,
  23. key: "Enter",
  24. code: "Enter",
  25. keyCode: 13
  26. }));
  27. }, 120000); // input a question every 1 minutes (1 minutes * 60 seconds/minute * 1000 milliseconds/second)
  28. })();