Last active
January 16, 2025 21:18
-
-
Save rougetimelord/5d3410517dee069dfce29ebeb9a21185 to your computer and use it in GitHub Desktop.
Spam twitch chat easily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//By rouge(https://github.com/rougetimelord) (c)2016 | |
//Purpose: Create randomly uppercased strings to spam the chats of "twitchplays" streams | |
//Hook text box | |
var field = document.getElementsByClassName("js-chat_input")[0]; | |
//Initialize attached text box | |
var div = document.createElement("div"); | |
div.style.position = "absolute"; div.style.top = "0px"; div.style.left = "0px"; div.style.color = "#FFF"; div.style.zIndex = "100"; | |
var form = document.createElement('form'); | |
var txt = document.createElement('input'); | |
txt.type = 'text'; txt.name = "Cmd"; | |
var btn = document.createElement('input'); | |
btn.type = "button"; btn.value = "Spam away"; | |
btn.addEventListener("click", function(){typer(1);}, false); | |
var btn2 = document.createElement('input'); | |
btn2.type = "button"; btn2.value = "stop spamming"; | |
btn2.addEventListener("click", function(){typer(0);}, false); | |
//Attach to DOM | |
form.appendChild(txt); | |
form.appendChild(btn); | |
form.appendChild(btn2); | |
div.appendChild(form); | |
document.body.appendChild(div); | |
//Loop function called every 1000ms | |
var looper = function(){ | |
var input = txt.value; | |
var output = ""; | |
for(var i = 0; i < input.length; i++) | |
{ | |
output += ((Math.floor(Math.random() * 2) + 1) == 1) ? input[i].toUpperCase() : input[i]; | |
} | |
field.value = output; | |
} | |
var loop; | |
//Initialize or destroy loop | |
var typer = function(a){ | |
if(a == 1){loop = setInterval(looper, 1E3)}else{clearInterval(loop)} | |
} |
what is this
what is this
Run it :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Start