User talk:Gracenotes: Difference between revisions

mNo edit summary
Line 27: Line 27:
== Question ==
== Question ==
How are working that fast lol? You keep beating me lol try to slow down it was clash the server--[[User:CoolPikachu!|<span style="color:#007FFF;">'''Cool'''</span>]][[User talk:CoolPikachu!|<span style="color:#FFBA00;">'''Pika'''</span>]][[User Talk:CoolPikachu!/Archive 1|<span style="color:#FFBA00;">'''chu!'''</span>]] 07:46, 25 July 2008 (UTC)
How are working that fast lol? You keep beating me lol try to slow down it was clash the server--[[User:CoolPikachu!|<span style="color:#007FFF;">'''Cool'''</span>]][[User talk:CoolPikachu!|<span style="color:#FFBA00;">'''Pika'''</span>]][[User Talk:CoolPikachu!/Archive 1|<span style="color:#FFBA00;">'''chu!'''</span>]] 07:46, 25 July 2008 (UTC)
:Sorry! It's a script that I wrote for Wikipedia, but it works on any MediaWiki installation (screenshot: [http://gracenotes.freehostia.com/r/script.png]). The specific function I'm using looks like this:
<pre>
function(text) {
var exactMatch = text.match(/introduced in (?:\[\[)Generation *(\w+)(?:\]\])/i);
var gen;
if (exactMatch) {
gen = exactMatch[1];
} else {
var headerRe = /^=+.+?=+ *$/mg;
var headers = text.match(headerRe);
for (var i = 0; i < headers.length; i++) {
var genMatch = headers[i].match(/Generation *(\w+)/i);
if (genMatch) {
if (!gen || generations[genMatch[1]] < generations[gen])
gen = genMatch[1];
}
}
gen = gen || '';
gen = prompt(headers.join('\n'), gen) || gen;
}
var temp = Parser.extractTemplate("MoveInfobox", text);
temp.set('gen', gen);
temp.sort(['n', 'name', 'jname', 'jtrans', 'desc', 'gameimage', 'type', 'damagecategory', 'basepp', 'maxpp', 'power', 'accuracy', 'tm1', 'tm#1', 'hm1', 'hm#1', 'tm2', 'tm#2', 'hm2', 'hm#2', 'mtc', 'tm3', 'tm#3', 'hm3', 'hm#3', 'mtfl', 'mte', 'tm4', 'tm#4', 'hm4', 'hm#4', 'mtdp', 'na', 'bdesc', 'gen', 'category', 'appeal', 'jam', 'cdesc', 'spm', 'appealsc', 'scdesc', 'shadow', 'pokefordex', 'touches', 'protect', 'magiccoat', 'snatch', 'snatchable', 'brightpowder', 'misses', 'kingsrock', 'useskingsrock', 'flag7', 'flag8', 'sound', 'footnotes'], true);
var tempString = temp.toString(false, [' |\n', '='], ['|\n', ' ']);
return text.substring(0, temp.start) + tempString + text.substring(temp.end + 2);
},
</pre>
:It's semi-automated, so every edit is approved, and also can be approved at any rate. I'll try to slow it down a bit :) [[User:Gracenotes|Gracenotes]] 07:52, 25 July 2008 (UTC)
188

edits