Youtube livestream comment bot

This is a spam bot for youtube livestreams. You can change the @match to whatever url you want...

目前為 2020-06-20 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Youtube livestream comment bot
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  This is a spam bot for youtube livestreams. You can change the @match to whatever url you want...
// @author       joldboy69
// @match        https://www.youtube.com/watch?v=jG6fg8csDM4
// @grant        none
// ==/UserScript==

/*
I was a little lazy making this script so you will need to follow a few instructions to set this up.
First, you will need to go to the youtube livestream you want to bot and change the match to your livestream url.
Next, since there are multiple buttons on the page with the id of "button", you will need to manually change the submit button to post your reply to "mybutton" (or whatever you want the new id to be).
You can do this by hovering your mouse over the submit button (it looks like a paper airplane) and right clicking on it and clicking "inspect".
Now that you are in the html editor, you need to right click the object that contains the submit button's id and click "edit as html". Then change the id to "mybutton" (or whatever you want to call it but you will have to change the code below as well) and then save it.
Now that you have done all of that, you should be able to comment bot as long as you are signed in to a youtube account. Enjoy and use wisely.
*/


(function() {
    'use strict';
    setTimeout (function() {

    var a = prompt("Enter the comment to make: ");
    },20000);

    setInterval (function() {
        document.querySelector("div#input").textContent=a;
        document.querySelector("div#input").dispatchEvent(new Event('input',{bubles:true,cancelable:true}));
        document.getElementById("mybutton").click();
    },5000);

})();