User:A proofreader/potionify.js

addOnloadHook( potionify );

/* This is User:Gaz Lloyd/potionify.js with support represented by * a defence potion and opposition represented by an attack potion. * The rationale for this script is that with support, you *defend* * a position, and with opposition, you *attack* it. */

function potionify { $('b').html(function(index, oldhtml) {

// OPPOSE = attack potion (3) var oppPat = /^oppose/i; if (oppPat.test(oldhtml)) { return ''; }

// SLIGHT OPPOSE = attack potion (2) var slOppPat = /^slight oppose/i; if (slOppPat.test(oldhtml)) { return ''; }

// WEAK OPPOSE = attack potion (1) var weOppPat = /^weak oppose/i; if (weOppPat.test(oldhtml)) { return ''; }

// STRONG OPPOSE = super attack (3) var stOppPat = /^strong oppose/i; if (stSupPat.test(oldhtml)) { return ''; }   // EXTREME OPPOSE = extreme attack (3) var exOppPat = /^extreme oppose/i; if (exOppPat.test(oldhtml)) { return ''; }

// SUPPORT = defence potion (3) var supPat = /^support/i; if (supPat.test(oldhtml)) { return ''; }

// SLIGHT SUPPORT = defence potion (2) var slSupPat = /^slight support/i; if (slSupPat.test(oldhtml)) { return ''; }

// WEAK SUPPORT = defence potion (1) var weSupPat = /^weak support/i; if (weSupPat.test(oldhtml)) { return ''; }

// STRONG SUPPORT = super defence (3) var stSupPat = /^strong support/i; if (stSupPat.test(oldhtml)) { return ''; }

// EXTREME SUPPORT = extreme defence (3) var exSupPat = /^extreme support/i; if (exSupPat.test(oldhtml)) { return ''; }

// NEUTRAL = combat potion (3) var neutPat = /^neutral/i; if (neutPat.test(oldhtml)) { return ''; }

// question = ??? mixture var quesPat = /^question/i; if (quesPat.test(oldhtml)) { return ''; }

// COMMENT = vial of water var commPat = /^comment/i; if (commPat.test(oldhtml)) { return ''; }

// FUCK YES/FUCK NO = overload (3) var fuPat = /^fuck (yes|no)/i; if (fuPat.test(oldhtml)) { return ''; }

// EXTREME BUCKET/BUKKIT SUPPORT = bucket of slime var bsPat = /^extreme bu(c|k)k(e|i)t support/i; if (bsPat.test(oldhtml)) { return ''; }

// EXTREME BUCKET/BUKKIT OPPOSE = bucket of dung var boPat = /^extreme bu(c|k)k(e|i)t oppose/i; if (boPat.test(oldhtml)) { return ''; }

// WITHDRAWN/WITHDRAWING = super antifire (3) var withPat = /^withdraw(n|ing)/i; if (withPat.test(oldhtml)) { return '<img alt="' + oldhtml + '" title="' + oldhtml + '" src="http://images2.wikia.nocookie.net/__cb20111129092229/runescape/images/7/7d/Super_antifire.png" width="20" height="30">'; }

// NOTICE OF INTENT = hunter potion (3) var noiPat = /^notice of intent/i; if (noiPat.test(oldhtml)) { return '<img alt="' + oldhtml + '" title="' + oldhtml + '" src="http://images1.wikia.nocookie.net/__cb20100924013906/runescape/images/a/a4/Hunterpotion.PNG" width="20" height="30">'; }

// CLOSURE/CLOSING/CLOSED = guthix balance (3) var cloPat = /^clos(ure|ing|ed)/i; if (cloPat.test(oldhtml)) { return '<img alt="' + oldhtml + '" title="' + oldhtml + '" src="http://images1.wikia.nocookie.net/__cb20100924030406/runescape/images/3/32/Guthix_balance_3.png" width="20" height="30">'; }

// REOPENED/REOPENING = super restore (3) var reoPat = /^reopen(ing|ed)/i; if (reoPat.test(oldhtml)) { return '<img alt="' + oldhtml + '" title="' + oldhtml + '" src="http://images2.wikia.nocookie.net/__cb20100925054112/runescape/images/c/ca/Super_restore_potion.PNG" width="20" height="30">'; }

// REQUEST FOR CLOSURE = super antipoison (3) var rfc1Pat = /^a user has \</i; var rfc2Pat = /^request for closure/i; if (rfc1Pat.test(oldhtml) || rfc2Pat.test(oldhtml)) { return '<img alt="Request for Closure" title="Request for Closure" src="http://images2.wikia.nocookie.net/__cb20100925055649/runescape/images/c/cd/Super_antipoison-potion.PNG" width="20" height="30">'; }

return oldhtml; }); }