Analysis Links Project (with script)

Ok, so this is the moment all you slaves have been waiting for! Please be sure to carefully read this post before attempting to help out. Your slave labor is appreciated but if you make a mistake you get the whip you've probably done more harm than help :(. There will be a full tutorial, but feel free to ask me any questions (no matter how stupid, lol) on IRC if you want to make sure you're doing it right! I know this is tl;dr but I promise its not that complicated at all to run, and I just want to make sure everything is clear.

Now you will need the following to help out:

A badge (sorry, but it just cuts efficiency a ton otherwise)

Any program that makes .txt files. There is good chance your computer comes with one. Notepad is an example of one.

This is a script made for mIRC if you haven't gathered from the thread title, so it's necessary to help out. I'm not really good at scripting other than with mIRC and most suggestion box ideas turn into something like "Oh that would be a good idea if someone did it," So I decided fuck it I'm going to just make an mIRC script for it.

Ok so I'm not going to give you a tutorial for getting mIRC up and running, so I assume it's up and connected at this point. I'll preface this by explaining how the script works a bit. Any word that is capitalized is referenced among the list of moves, Pokemon, and competitive items (a lot of items aren't included) that are stored in .txt files. It takes about 10 seconds to run for a full analysis. During these 10 seconds, your mIRC client will go unresponsive as the script processes. Don't panic, but if for some reason you need to stop the script there is a "break" button on most computers. It's usually in the top right corner, and it will halt the script. Ok so now onto actually getting the files it references in place. These are simple .txt files placed into the mIRC directory. To open this, simply type "//run $mircdir" into any active window in your mIRC client. Now for the actual text files; you will need to make 5 in total. Make the first one and title it "pokemonlist". Copy and paste this pastebin into pokemonlist.txt. Then, drag and drop the text file from wherever it default saved to your mIRC directory which we opened a little while back. If you want to check if you did this right, type "//echo -a $read(pokemonlist.txt,1)" into any active window, and it should return "arceus-bug". Sometimes copy/pasting from pastebin can fuck up the text; to check if it did, type "//echo -a $read(pokemonlist.txt,w, arceus-bug)" into any active widnow. It should return "arceus-bug" again. If not, open your notepad file and click ctrl + a. If you see it highlight a shitload of spaces after the Pokemon names, you're going to have to manually remove all those spaces for the script to work :(.

Ok, so follow the same procedure for every file. I'll just list the correct thing to name the .txt file followed with the corresponding pastebin. You should know if you're doing it right from checking the first one. If you want to check each subsequent one for some reason, all you need to do is type "//echo -a $read([text file name].txt,1)". Then "//echo -a $read([text file name].txt,w, [what the previous command returned])".

Copy and paste it to your "remote" section of mIRC. If you don't know where that is, it can be opened by pressing "Alt + R" when mIRC is your active window. To run it, type "/insertlinks [Name of Pokemom/item/move you are inserting the links into. If the item or move has spaces, replace them with _. (Eg Ghost Arceus = Ghost_Arceus, Air Balloon = Air_Balloon)] [Tier (Include this parameter only for Pokemon (use the abbreviation that appears at the end of the link on the dex, eg ou/uu/ru/nu/lc/vgc2012))]. Here's an example run:

I want to do OU Abomasnow, so I go to it's OU scms page (http://www.smogon.com/scms/revision/89550/edit) and copy the entire analysis. Then, I type "/insertlinks Abomasnow OU" into any active mIRC window. A dialogue box will pop up. Paste the entire thing into it. Now I'm just going to bring up the a fault with the script that I cannot fix because it is mIRC's fault (to my knowledge, at least).

Hide(Move your mouse to the hide area to reveal the content)Show HideHide Hide

Notice the highlighted portion and how it goes onto a second line? mIRC apparently has a character limit per line in dialogue boxes. That break causes the script to insert a return there when it spits it out. I have fixed this so it won't affect you in most cases. The only time this will be an issue is if a Pokemon/move/item is the word cut off. If this is the case, you will manually have to link it. In other words just <a href="/bw/[type of thing, eg move, pokemon, or item]/[name of pokemon, move, or item, with _ used over spaces]/[tier (if applicable)]">Pokemon/move/item name</a>. So <a href="/bw/pokemon/abomasnow/ou">Abomasnow</a>. Now all you have to do is paste the raw scms version into the box and click done. Wait 10-15 seconds and a notepad file will pop up with the linked version done.

A few things to note before you start. It's quite possible something I haven't forseen won't work. I have tested it extensively and weeded a lot of this out but there still may be some things I have not thought of. For instance, Toxic Orb didn't work until recently because the script saw "Toxic" and just linked to the move. High Jump Kick didn't work before because it was three words (Roar of Time still doesn't work because it has no competitive use whatsoever and I didn't feel like putting it in like I did for Hi Jump Kick). Some things that are not bugs and don't need to be reported:

It will only link to the first mention of a Pokemon/item/move per set. After that it ignores all mentions of this word. There's no reason to link to something multiple times.

It won't link to the Pokemon/item/move you specified when you ran it for obvious reasons

It won't link to any move or item in the actual set, because those are already linked automatically.

Only competitive items are linked (you can check which ones those are in the pastebin of items)

Abilities aren't linked

Anything in damage calculations (eg anything within the tags <ul class="damage_calculation"></ul> are not linked. If you see a damage calculation with incorrect format please fix it! There are actually a surprising amount of incorrectly formatted damage calcs on site (I've fixed all that I've seen so far), and this will mess with the script. A very common mistake that is extremely easy to miss is <ul class="damage_calculations">, so watch out for this! Also, curly quotes mess them up too.

I'm going to say this one more time: I'm am not very good at scripting and don't claim to be. If someone who is would like to write an actual script for this, go right ahead. Until then, this cuts down grunt work a huge amount and saves a large amount of time, even if it is quite possibly imperfect. I would strongly suggest anyone that starts running this check the first few times for mistakes (though I've run it numerous times for this purpose). As a side note of sorts this will not work well with articles.