User:Benjaminthewill123123/AVB.js

window.addEventListener("keypress", SelectSucker, false); var moron = ''; var on = 0; function SelectSucker (v) { if ((v.ctrlKey) && (v.which == 107)) if (on) {    on=0; window.clearInterval; window.alert('Program inactive. Press CTRL + K again to start.'); }  else {    moron = ''; window.clearInterval; moron = window.prompt("Vandal Name or IP"); if (moron == '') { window.alert('Invalid input. Type the user name (without the "user:") or the raw ip.'); return; };    var time = window.prompt("Select the timer(seconds) between checks\nRecommended: 30+ sec)");     if (!time)       time = 30;     window.alert('Starting auto-reversions. Press CTRL + K again to stop. Welcome to AVP 1.0');    window.setInterval("ReviewContribs", (time * 1000));      on=1;     ReviewContribs;    }; }; function ReviewContribs  {   if (on)   {     var myWindow2 = window.open(("http://creepypasta.wikia.com/wiki/Special:Contributions/" + moron), "", "modal=no,chrome=yes,dependent=yes,alwaysLowered=yes");     myWindow2.blur;     myWindow2.setInterval("LoadContribs", 500);   }; }; function TheEnd {  window.close; }; function Save {    if (!document.getElementById("wpSave"))       return; //still not loaded    window.clearInterval;    var minor = document.getElementById("wpMinoredit");    if (minor) minor.checked = 1;    var summary = document.getElementsByName("wpSummary")[0];    if (summary) summary.value = "AVP Vandal Undo";        var btn = document.getElementById("wpSave");    if (btn){       btn.textContent += " (Saving...)";       btn.click;    }; window.setTimeout("TheEnd", 20000); }; function LoadContribs { if (!document.getElementById("footer")) return; window.clearInterval; FetchPage(document); }; function openPage(target) { alert(target); var myWindow = window.open(target, "", "modal=no,chrome=yes,dependent=yes,alwaysLowered=yes"); myWindow.blur; myWindow.setTimeout('Save', 60000); window.close; }; function FetchPage (s) { var rl = s.getElementsByTagName('a'); for(var i = 0; i < rl.length; i++) {     if(rl[i].innerHTML != 'rollback') continue; openPage(rl[i].href.replace('&amp;', '&');  } }; function queryString(p) {        var re = RegExp('[&?]' + p + '=([^&]*)');        var matches;        if (matches = re.exec(document.location)) {            try {                 return decodeURI(matches[1]);            } catch (e) {        }    }    return null; };