World of Warcraft Armory Script

By FordLawnmower on Apr 24, 2010

Script made for mouse(irc.geekshed.net)
This script will gather your last 3 actions or some basic statistics from www.wowarmory.com and return them to irc in the form of channel message or notice.
Getting Started:

  • Load into your bots remotes and save with a unique file name.
  • From a second client that has ops, type +armory (in the channel you want to run the script)
    Triggers & Alias's:
  • @Armory name realm (Will message the channel the last 3 actions for name realm - user needs halfops or higher)
  • !Armory name realm (Will notice the user the last 3 actions for name realm)
  • @WowStats name realm (Will message the channel some basic stats for name realm - user needs halfops or higher)
  • !WowStats name realm (Will notice the user some basic stats for name realm)
  • +Armory (Will activate the script for the channel it's typed in - user must have ops to use)
  • -Armory (Will deactivate the script for the channel it's typed in - user must have ops to use)
  • +WowStats (Will activate the script for the channel it's typed in - user must have ops to use)
  • -WowStats (Will deactivate the script for the channel it's typed in - user must have ops to use)
  • /Armory name realm (Type from the client with the script loaded. Echo's last 3 actions)
  • /WowStats (Type from the client with the script loaded. Echo's basic stats)
    Special Note for UTF8 Characters
    If you're using utf8 characters in the name or realm you must set your bots utf8 settings to Display & Encode for the channel(s) running this script.
    Setting UTF8:
  • Right Click the channel on the treebar.
  • Click Font
  • Click the UTF-8: dropdown
  • Select Display and encode
  • Click OK

Example:
21:23:18 @armory Mîthra Galakrond
21:23:19 Searching ........
21:23:22 Ambassador Mîthra 9 Scourgelord Tyrannus kills (Heroic Pit of Saron).
21:23:22 Ambassador Mîthra 9 Ick and Krick kills (Heroic Pit of Saron).
21:23:23 Ambassador Mîthra 9 Forgemaster Garfrost kills (Heroic Pit of Saron).
21:23:24 Ambassador Mîthra http://www.wowarmory.com/character-sheet.xml?r=Galakrond&n=M%C3%AEthra
21:23:29 @wowstats Mîthra Galakrond
21:23:29 Searching ........
21:23:31 Ambassador Mîthra Level 80 Draenei Shaman strength: 121 agility: 71 stamina: 136 intellect: 140 spirit: 145 armor: 15141
21:23:33 Ambassador Mîthra http://www.wowarmory.com/character-sheet.xml?r=Galakrond&n=M%C3%AEthra

;Wow Armory Script by Ford_Lawnmower irc.geekshed.net #Script-Help
menu Channel,Status {
  .$iif($group(#ArmoryWow) == On,$style(1)) ArmoryWow Trigger
  ..$iif($group(#ArmoryWow) == On,$style(2)) On: .enable #ArmoryWow
  ..$iif($group(#ArmoryWow) == Off,$style(2)) Off: .disable #ArmoryWow
}
#ArmoryWow on
On $*:Text:/^(\+|-|!|@)(Armory|wowstats).*/Si:#: {
  var %action $regml(1), %selection $regml(2)
  if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
    if (%action == +) {
      if ($istok(%ArmoryWowChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is already running the ArmoryWow script }
      else { 
        .enable #ArmoryWow
        Set %ArmoryWowChanList $addtok(%ArmoryWowChanList,$+($network,$chan),32)
        .msg $chan $nick has activated the ArmoryWow script for $chan .
      }
    }
    else {
      if (!$istok(%ArmoryWowChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is not running the ArmoryWow script }
      else { 
        Set %ArmoryWowChanList $remtok(%ArmoryWowChanList,$+($network,$chan),1,32)
        .msg $chan $nick has deactivated the ArmoryWow script for $chan . 
      }
    }
  }
  elseif (!$timer($+(ArmoryWow,$network,$nick))) && ($istok(%ArmoryWowChanList,$+($network,$chan),32)) {
    .timer $+ $+(ArmoryWow,$network,$nick) 1 6 noop
    var %method $iif(%action == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))
    GetArmoryWow %method %selection $strip($2-)
  }
}
#ArmoryWow end
alias Armory { GetArmoryWow echo -a Armory $1- }
alias WowStats { GetArmoryWow echo -a WowStats $1- }
alias -l GetArmoryWow {
  var %sockname $+(ArmoryWow,$network,$2,$ticks)
  $1-2 Searching ........  
  sockopen %sockname www.wowarmory.com 80
  sockmark %sockname $1-2 $3 $+(/character-sheet.xml?r=,$urlencode($5),&n=,$urlencode($4)) 3 1 $4
}
On *:sockopen:ArmoryWow*: {
  if (!$sockerr) {
    sockwrite -nt $sockname GET $gettok($sock($sockname).mark,4,32) HTTP/1.0
    sockwrite -n $sockname Host: www.wowarmory.com
    sockwrite -n $sockname $crlf
  }
  else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}
On *:sockread:ArmoryWow*: {
  if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  else {
    var %ArmoryWow | sockread %ArmoryWow
    if ((Error && Encountered) isin %ArmoryWow)  {
      $gettok($sock($sockname).mark,1-2,32) **Error** Page Not Found! Syntax is !armory name realm or !wowstats name realm
      sockclose $sockname
      return
    }
    elseif ($gettok($sock($sockname).mark,3,32) == armory) {
      if ($gettok($sock($sockname).mark,6,32) > $gettok($sock($sockname).mark,5,32)) {
        tokenize 32 $sock($sockname).mark
        $1-2 $scolor($delim($8) $delim($7),04,) $+(http://www.wowarmory.com,$4,)
        sockclose $sockname
        return 
      }
      elseif ($regex(%ArmoryWow,/<span class="prefix">([^<]*)\s\&nbsp;/)) { addmark 32 $delim($regml(1)) }
      elseif ($regex(%ArmoryWow,/<desc>([^<]*)<\/desc>/)) {
        tokenize 32 $sock($sockname).mark $regml(1)
        $1-2 $scolor($delim($8) $delim($7) $9-,04,)
        incmark 6 32
      }
    }
    else {
      if (function resistancesObject isin %ArmoryWow) {
        tokenize 32 $sock($sockname).mark 
        $1-2 $scolor($delim($9) $delim($7) $delim($8) $10- ,04,)
        $1-2 $scolor($delim($9) $delim($7),04,) $+(http://www.wowarmory.com,$4,)
        sockclose $sockname
        return
      }
      elseif ($regex(%ArmoryWow,/<a class="staticTip" href="\/character-sheet\.xml\?r=.*&amp;cn=.*" onmouseover="setTipText\('([^&]*)&nbsp;([^&]*)&nbsp;([^&]*)&nbsp;([^<]*)'\)">/)) {
        addmark 32 $delim(** $regml(1) $regml(2) $regml(3) $regml(4) **)
      }
      elseif ($regex(%ArmoryWow,/<span class="prefix">([^<]*)\s\&nbsp;/)) { addmark 32 $delim($regml(1)) }
      elseif ($regex(%ArmoryWow,/function (.*)Object/)) { addmark 32 $+($regml(1),:) }
      elseif ($regex(%ArmoryWow,/this\.base="([\d]*)";/)) { addmark 32 $regml(1) }
    }
  }
}
alias -l addmark { sockmark $sockname $addtok($sock($sockname).mark,$2-,$1) }
alias -l incmark { sockmark $sockname $puttok($sock($sockname).mark,$calc($gettok($sock($sockname).mark,$1,$2) + $iif($3,$3,1)),$1,$2) }
alias -l urlencode { return $regsubex($1-,/(\W)/g,$+(%,$base($asc(\t),10,16))) }
alias delim { return $regsubex($1-,/([\s\x7])/g,$iif(\t == $chr(7),$chr(32),$chr(7))) }
alias -l SColor {
  var %c1 $iif($2,$right($+(0,$2),2),99),%c2 $iif($3,$right($+(0,$3),2),99)
  return $+($regsubex($1,/([\ba-z]{1,})/gi,$+(,%c1,\t,,%c2)),) 
}

Comments

Sign in to comment.
blackvenomm666   -  Nov 16, 2012

i'm about to give this a try i started playing wow recently

 Respond  
edb   -  Jun 15, 2011

n/m i see what you were wanting.. to move code over to another link.. gotcha..

for this page all the information is in the CDATA section of the page but that link is available for any user in the game that has logged in recently. Not sure what people want returned though.

 Respond  
edb   -  Jun 15, 2011

It has the information that is what i was posting. While i am no expert i managed to get it working to pull information from the new site and figured it was a launchpad for more people to utilize.

http://us.battle.net/wow/en/character/thrall/robinhorde/simple provides stats.. /advanced provides more info as well.

THRALL in this link being the realm and ROBINHORDE the character in this case.

and that is what i was fixing.. while i only grabbed the achieves (And badly at that) ALL the information is there its just a matter of parsing.. i will refrain from posting more information to assist.. my bad.

 Respond  
FordLawnmower   -  Jun 04, 2011

@edb The Author of this script didn't go "poof" . I do not and have never used world of warcraft, in fact , I only know that is is some sort of a game. The reason there is no new progress on this script is because the new site is junk and doesn't provide any of the information that the old one did.
If someone knows of another site that provides the same information as the old one, please post the sitename along with a detailed description of how the script should work and what information should be gathered from each command. Please provide working examples , along with valid links to search results pages.
You may also come to irc.Geekshed.net #Script-Help to make your request.
btw, Your comment was deleted edb. The code that you posted is here -->> http://pastebin.com/hc1fNgXU
Please don't post large blocks of redundant code here. 98% or what you posted is already at the top of this page, so please just use a pastebin link.

@Gosy No worries. I just need to know what information should be returned from irc from the new site. Since nobody ever posted back a response to my comment, this post has died.
My original Comment:

The site is completely different and doesn't appear to have character information available for search ;/
If you think a search script for this site would be useful, please take a moment to study the site and explain to me how the script should work and what information it should return.

If you know of another site that has both wow armory and stats information, please post the link here and I will consider a rewrite with the new site.

Please keep in mind that I do not and have never played wow. I know nothing about it, so please explain thoroughly.

 Respond  
Gosy   -  Feb 24, 2011

@FordLawnmower i hope my comment didn't insult you in any way, my intention wasn't meant like that. And i wish i knew how to script myself i would gladly help you thus i've never scriptet anything inside mirc :(. I can just support you on this really, i hope you get around this script and make it work again! :)
Cheers

 Respond  
FordLawnmower   -  Feb 21, 2011

Thanks blackvenomm666 :)
There are alias's for those who want to use it as a personal script.

 Respond  
blackvenomm666   -  Feb 21, 2011

very nice script if i played wow i'd use it. what about a dialog version for those who don't have/use bots?

 Respond  
FordLawnmower   -  Feb 21, 2011

@Gosy It seems that wowarmory.com has been changed to -->> http://us.battle.net/wow/en/
The site is completely different and doesn't appear to have character information available for search ;/
If you think a search script for this site would be useful, please take a moment to study the site and explain to me how the script should work and what information it should return.

If you know of another site that has both wow armory and stats information, please post the link here and I will consider a rewrite with the new site.

Please keep in mind that I do not and have never played wow. I know nothing about it, so please explain thoroughly.

 Respond  
Gosy   -  Feb 21, 2011

i don't know why but i can't get this snippet to work on my bot. any clues why?

 Respond  
DaveySC   -  Oct 13, 2010

[17:00:43] <@TheAlmightyDuck> @wowstats Daveysc Eitrigg
[17:00:44] Searching ........
[17:00:45] strength: Daveysc Level 48 Night Elf Hunter 42 agility: 102 stamina: 71 intellect: 53 spirit: 57 armor: 2117
[17:00:46] strength: Daveysc http://www.wowarmory.com/character-sheet.xml?r=Eitrigg&n=Daveysc

I'm guessing strength: should come after Daveysc Level 48 Night Elf Hunter

 Respond  
GuitarMasterx7   -  Sep 03, 2010

i dun like WoW but damn ;D
das some pretty hawt code right there

 Respond  
FordLawnmower   -  Apr 24, 2010

Please post any suggestions for improvements or changes here. Keep in mind that I know nothing about WoW.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.