>>18158321var spamhandle;
var counterHandle;
function spam(){
var old_shit = $("#chat_text_input").val();
var interval = parseInt($("#spam-interval").val()) * 1000;
$("#chat_text_input").val( $("#spam-text").val() );
document.getElementById("chat_speak").click();
$("#spam-notice").show();
$("#spam-notice").fadeOut(3000);
spamhandle = setTimeout(spam, interval);
$("#chat_text_input").val(old_shit);
counter($("#spam-counter"), interval / 1000);
}
$("#spam-check").click( function() {
if($("#spam-check:checked").val()){
spam();
} else {
clearTimeout(spamhandle);
clearTimeout(counterHandle);
$("#spam-counter").hide();
}
} );
function counter($el, n) {
$("#spam-counter").show();
clearTimeout(counterHandle);
(function loop() {
$el.html(n);
if (n--) {
counterHandle = setTimeout(loop, 1000);
}
})();
}
happy spamming