Last active
December 26, 2016 11:13
-
-
Save bemoty/11154147eaf50989afdf to your computer and use it in GitHub Desktop.
This file contains 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
var message = prompt("Enter a message to spam."); | |
var usernumber = prompt("Enter how often the message will be sent."); | |
if (message != null && usernumber != null) { | |
var field = document.getElementsByClassName("input")[1]; | |
counter = 0; | |
function dispatch(target, eventType, char) { | |
var event = document.createEvent("TextEvent"); | |
event.initTextEvent (eventType, true, true, window, char, 0, "en-US"); | |
target.focus(); | |
target.dispatchEvent(event); | |
} | |
function spam() { | |
if (counter<usernumber) { | |
dispatch(field, "textInput", message); | |
var input = document.getElementsByClassName("icon btn-icon icon-send"); | |
input[0].click(); | |
counter++; | |
setTimeout(spam,1); | |
} | |
} | |
spam(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment