ChatGPT+ Keep Running "Continue generating" GPT-4 new feature

Big Update! Both auto continue,and can customize click and regenerating by your demamd!

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         ChatGPT+ Keep Running "Continue generating" GPT-4 new feature
// @namespace    https://github.com/new4u
// @version      3.1.317
// @description  Big Update! Both auto continue,and can customize click and regenerating by your demamd!
// @author       new4u本爷有空
// @icon         https://www.google.com/s2/favicons?sz=64&domain=openai.com
// @match        https://chat.openai.com/chat
// @connect      chat.openai.com
// @match        https://chat.openai.com/*
// @grant        none
// @copyright    2015-2023, new4u
// @license      GPL-3.0-only
// ==/UserScript==

(function() {
    'use strict';
    var count=0;
  
    // 创建 auto regenerate按钮
    var autoRegenBtn = document.createElement("button");
    autoRegenBtn.innerHTML = "Auto Regenerate";
    autoRegenBtn.style.position = "fixed";
    autoRegenBtn.style.bottom = "20px"; // 将按钮放在输入框下方
    autoRegenBtn.style.right = "20px";
    document.body.appendChild(autoRegenBtn);
  
    var autoRegenerate = false;
  
    // 添加点击事件
    autoRegenBtn.addEventListener('click', function() {
      autoRegenerate = !autoRegenerate; // 切换 auto regenerate 状态
      autoRegenBtn.style.backgroundColor = autoRegenerate ? 'green' : 'red'; // 改变按钮颜色
      autoRegenBtn.innerHTML = autoRegenerate ? 'Auto Regenerate: ON' : 'Auto Regenerate: OFF'; // 改变按钮文字显示
    });
  
    setInterval(() => {
        const buttons = document.querySelectorAll('button');
        let found = false;
  
        buttons.forEach(button => {
            if (autoRegenerate && button.textContent === 'Regenerate response') {
                button.click();
                count++;
                console.log('Clicked button with text: Regenerate response次数',count);
                found = true;
            } else if (button.textContent === 'Continue generating') {
                button.click();
                var d = new Date();
                var n = d.getHours();
                var counttime = new Array();
                counttime[n] = count;
                counttime[n+1] = 0;
                console.log('Clicked button with text: Continue generating次数+时长',counttime[n],n);
                found = true;
            }
        });
  
        if (!found) {
            console.log('Button with text not found');
        }
  
    }, 15000);
})();