// ==UserScript== // @name Kick Chatbot // @namespace http://tampermonkey.net/ // @version 0.1 // @description Kick Chat bot for those streamers who provide tokens for chatting/viewing. // @license MIT // @author R3D // @match https://kick.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=kick.com // @grant none // @downloadURL https://update.greasyfork.icu/scripts/480291/Kick%20Chatbot.user.js // @updateURL https://update.greasyfork.icu/scripts/480291/Kick%20Chatbot.meta.js // ==/UserScript== (function() { 'use strict'; window.onload = function() { startRandomMessageTimer(); }; function startRandomMessageTimer() { // Function to generate a random number between min and max values function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); } // Function to send a random chat message function sendRandomMessage() { // Get the message-input div var messageInputDiv = document.getElementById('message-input'); // Array of possible messages var messages = [ '', '', '', '', '', '', '', '', '', '', '' ]; // Get a random message from the array var randomMessage = messages[Math.floor(Math.random() * messages.length)]; messageInputDiv.click(); // Simulate typing the random message using the typeText function messageInputDiv.innerHTML = randomMessage; // Wait for 3 seconds before hitting "Enter" setTimeout(function() { // Simulate typing a new line var enterEvent = new KeyboardEvent('keydown', { key: 'Enter', keyCode: 13, code: 'Enter', which: 13, bubbles: true, cancelable: true }); // Dispatch the enter event messageInputDiv.dispatchEvent(enterEvent); console.log('Message sent'); }, 1000); } function initiateTimer() { var interval = getRandomInt(10000, 60000); console.log('Current Interval:', interval); setTimeout(function () { sendRandomMessage(); initiateTimer(); }, interval); } initiateTimer(); } })();