User:X!/massunblock.js

// Mass block tool by User:Krimpet // After adding to your monobook.js, navigate to Special:Massunblock to use the tool.

function getParameter(p) { var re = new RegExp('&'+p+'=([^&]*)','i'); var c = window.location.search; return unescape((c=c.replace(/^\?/,'&').match(re)) ?c=c[1] :c=""); }

function massblock { if (mw.config.get('wgPageName') == "Special:Massunblock") { document.title = " Krimpet X!'s mass block tool"; document.getElementById("content").innerHTML = " Krimpet X!'s mass block tool MESS SOMETHING UP WITH THIS, AND YOU TAKE THE BLAME, BUCKO.

List of IPs to unblock, one on each line please: 

Reason: 

Unblocks/min:  Unblock IPs Abort       "; } else if (document.location.search.match("__MASSBLOCK__")) {      document.getElementById("mw-bi-other").value = getParameter("expiry").replace("+"," ","g");      document.getElementById("mw-bi-reason").value = getParameter("reason").replace("+"," ","g");      setTimeout("document.getElementById(\"blockip\").submit", 500);  } }

var wgBlocksToDo; var wgBlocksToDoIndex; var wgBlocksToDoInterval = 0; var wgBlockFrame; function massblock2 { if (!parseFloat(document.getElementById("epm").value)) return; wgBlocksToDo = new Array;

iplist = document.getElementById("iplist").value.split("\n"); for (i=0;i= wgBlocksToDo.length) massblock4;";

wgBlocksToDoIndex = wgBlockFrame = 0; eval(mbcode); wgBlocksToDoInterval = setInterval(mbcode, (60 / parseFloat(document.getElementById("epm").value)) * 1000); }

function massblock3(ipToBlock) { if (ipToBlock + "" == "undefined") return;

iplistobj = document.getElementById("iplist"); if (iplistobj.value.indexOf("\n") == -1) iplistobj.value = ""; iplistobj.value = iplistobj.value.substring(iplistobj.value.indexOf("\n") + 1);

if (ipToBlock == "") return;

frames["blockframe" + wgBlockFrame++].location.href = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=Special:Blockip&ip=" + ipToBlock + "&__MASSBLOCK__=1&expiry=" + document.getElementById("expiry").value + "&reason=" + document.getElementById("reason").value + "&ao=" + (document.getElementById("ao").checked ? "1" : "0") + "&acb=" + (document.getElementById("acb").checked ? "1" : "0"); if (wgBlockFrame == 6) wgBlockFrame = 0; }

function massblock4 { clearInterval(wgBlocksToDoInterval); } $(massblock);