1. Welcome to Smogon! Check out the Smogon Starters Hangout for everything you need to know about starting out in the community. Don't forget to introduce yourself in the Introduction and Hangout Thread, too!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

Programming IRC Easy Smogon Look-Up

Discussion in 'Technical Projects' started by (makeup), Jun 9, 2011.

  1. (makeup)

    (makeup)
    is a Site Staff Alumnusis a Contributor Alumnus

    Joined:
    Feb 22, 2010
    Messages:
    2,874
    Updated with BW stuff.

    So if you know me, you probably know I love programming. I'm pretty good at scripting in MSL, but I have no idea how to use sockets, so I tried to make a Smogon script that could pull info from the site via sockets. Unfortunately, I suck at it so I did this my way and it actually turned out perfectly.

    The point of this script is to easily look up virtually anything that is part of the Smogon site using IRC. Here are the features it includes:

    • Info for every generation. You can look up anything from RBY to DPPt (but not BW since Smogon doesn't have that yet).
    • Easy access to every Pokemon's Dex page. For example, I can easily look up Budew's strategy Pokedex with this script.
    • An extended ability to look up a Pokemon's Moves tab. If I want to know all of Budew's moves, I can look that up.
    • A feature allowing you to look up any move. For example, if I wanted to go to Thunder Wave's DPPt page, I can. Also, I've added a special feature that will translate moves with a space, such as Thunder Wave, into their correct look-up names (thunder_wave) so it can be searched properly!
    • You can look up any item, and spaces will be triggered and changed to underscores, just like in moves.
    • Look up any ability with a space trigger!
    • Go to the disambiguation page of any tier to find all Pokemon in that tier!
    • Lastly, the ability to visit any type's page.
    Other cool features:

    • Find any thread via Google Custom Search!
    • Type in Ubers and you will still go to the Uber page (Uber is the tier name)
    Finally, here is the script. It is in MSL, so other scripting languages, such as Pearl, will not be able to use it correctly. To use it, open up your Scripting Editor and paste it under "Remote" (You can also open Remote with alt+r)
    How to use: Right click on the main window of a channel, query, etc. where the text is. A highlight menu saying "Smogon" should be there. Follow the arrows to whatever you want to look up and you're set!
    Code:
    menu * {
      -
      Smogon
      .Navigate
      ..Thread : run http://www.google.com/cse?cx=014605736416305442304%3Ae5byd3ca664&q= $+ $replace($$?="What is the name of the thread you are looking for?",$chr(32),$chr(45))
      .Lookup
      ..BW
      ...Pokemon : run http://www.smogon.com/bw/pokemon/ $+ $$?="What Pokemon would you like to look up?"
      ...Pokemon's Moves : run http://www.smogon.com/bw/pokemon/ $+ $$?="What Pokemon's moveset would you like to look up?" $+ /moves
      ...Move : run http://www.smogon.com/bw/moves/ $+ $replace($$?="What move would you like to look up?",$chr(32),_)
      ...Item : run http://www.smogon.com/bw/items/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Ability : run http://www.smogon.com/bw/abilities/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Tier : run http://www.smogon.com/bw/tiers/ $+ $replace($$?="What Tier would you like to look up?",ubers,uber)
      ...Type : run http://www.smogon.com/bw/types/ $+ $$?="What type would you like to look up?"
      ..DPPt
      ...Pokemon : run http://www.smogon.com/dp/pokemon/ $+ $$?="What Pokemon would you like to look up?"
      ...Pokemon's Moves : run http://www.smogon.com/dp/pokemon/ $+ $$?="What Pokemon's moveset would you like to look up?" $+ /moves
      ...Move : run http://www.smogon.com/dp/moves/ $+ $replace($$?="What move would you like to look up?",$chr(32),_)
      ...Item : run http://www.smogon.com/dp/items/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Ability : run http://www.smogon.com/dp/abilities/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Tier : run http://www.smogon.com/dp/tiers/ $+ $replace($$?="What Tier would you like to look up?",ubers,uber)
      ...Type : run http://www.smogon.com/dp/types/ $+ $$?="What type would you like to look up?"
      ..RSE
      ...Pokemon : run http://www.smogon.com/rs/pokemon/ $+ $$?="What Pokemon would you like to look up?"
      ...Pokemon's Moves : run http://www.smogon.com/rs/pokemon/ $+ $$?="What Pokemon's moveset would you like to look up?" $+ /moves
      ...Move : run http://www.smogon.com/rs/moves/ $+ $replace($$?="What move would you like to look up?",$chr(32),_)
      ...Item : run http://www.smogon.com/rs/items/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Ability : run http://www.smogon.com/rs/abilities/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Tier : run http://www.smogon.com/rs/tiers/ $+ $replace($$?="What Tier would you like to look up?",ubers,uber)
      ...Type : run http://www.smogon.com/rs/types/ $+ $$?="What type would you like to look up?"
      ..GSC
      ...Pokemon : run http://www.smogon.com/gs/pokemon/ $+ $$?="What Pokemon would you like to look up?"
      ...Pokemon's Moves : run http://www.smogon.com/gs/pokemon/ $+ $$?="What Pokemon's moveset would you like to look up?" $+ /moves
      ...Move : run http://www.smogon.com/gs/moves/ $+ $replace($$?="What move would you like to look up?",$chr(32),_)
      ...Item : run http://www.smogon.com/gs/items/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Tier : run http://www.smogon.com/gs/tiers/ $+ $replace($$?="What Tier would you like to look up?",ubers,uber)
      ...Type : run http://www.smogon.com/gs/types/ $+ $$?="What type would you like to look up?"
      ..RBY
      ...Pokemon : run http://www.smogon.com/rb/pokemon/ $+ $$?="What Pokemon would you like to look up?"
      ...Pokemon's Moves : run http://www.smogon.com/rb/pokemon/ $+ $$?="What Pokemon's moveset would you like to look up?" $+ /moves
      ...Move : run http://www.smogon.com/rb/moves/ $+ $replace($$?="What move would you like to look up?",$chr(32),_)
      ...Item : run http://www.smogon.com/rb/items/ $+ $replace($$?="What item would you like to look up?",$chr(32),_)
      ...Tier : run http://www.smogon.com/rb/tiers/ $+ $replace($$?="What Tier would you like to look up?",ubers,uber)
      ...Type : run http://www.smogon.com/rb/types/ $+ $$?="What type would you like to look up?"
    }
    
    Thanks!
  2. MewMaster

    MewMaster

    Joined:
    Sep 18, 2010
    Messages:
    30
    Hey nice job Gold. Never see you on IRC anymore lol.
  3. (makeup)

    (makeup)
    is a Site Staff Alumnusis a Contributor Alumnus

    Joined:
    Feb 22, 2010
    Messages:
    2,874
    Thanks! Yeah, I don't really visit PurpleSurge anymore. I'm always on Smogon IRC though. Nice to see you after a while and thanks for the complement!
  4. Aizen

    Aizen

    Joined:
    Dec 3, 2010
    Messages:
    16
    I like this, it can and will come in handy. :)

    good job.
  5. Jared

    Jared

    Joined:
    Sep 26, 2009
    Messages:
    43
  6. (makeup)

    (makeup)
    is a Site Staff Alumnusis a Contributor Alumnus

    Joined:
    Feb 22, 2010
    Messages:
    2,874
    Wow, people still use this? Ok, I've updated the OP with new code that includes BW.

Users Viewing Thread (Users: 0, Guests: 0)