Skip to content

Instantly share code, notes, and snippets.

@NullVoxPopuli
Last active December 30, 2015 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NullVoxPopuli/7778041 to your computer and use it in GitHub Desktop.
Save NullVoxPopuli/7778041 to your computer and use it in GitHub Desktop.
CEX.io chat spamming
/*
Modified from:
http://stackoverflow.com/questions/1280263/changing-the-interval-of-setinterval-while-its-running
*/
function setRandomTimeout( callback ){
var internalCallback = function(){
return function() {
var time = randomIntervalDelay();
window.setTimeout( internalCallback, time );
callback();
}
}();
window.setTimeout( internalCallback, randomIntervalDelay() );
};
spamCEXChat = function(){
messages = [
"Join CEX chat on webchat.freenode.net channel: #cex" ,
"#CEX on webchat.freenode.net -- IRC is one of the older and more efficient way to chat, we have also active admins 24/7 that monitoring chat window to prevent spam.",
"Tired of the spammers here in the web chat? Join a moderated chat on #CEX at webchat.freenode.net",
"Sick of bots, spammers, and beggers? Join a moderated chat at webchat.freenode.net on channel: #CEX"
]
selectedMessage = messages[randomValueFromRange(0, messages.length)];
var e = jQuery.Event("keypress");
e.which = 13; /* enter key */
e.keyCode = 13;
jQuery("#msg").val(selectedMessage).trigger(e);
}
randomValueFromRange = function(min, max){
return (Math.floor(Math.random() * max) + min);
}
randomIntervalDelay = function(){
return ((Math.random()*30+30) * 1000);
}
setRandomTimeout( spamCEXChat );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment