Ok, here you go:

Code:
on *:start: {
  if (!$hget(NewGameData)) {
    hmake NewGameData 100
    if ($isfile($+(",$scriptdir\NewGameData.hsh"))) { hload NewGameData $+(",$scriptdir\NewGameData.hsh") }
  }
  if (!$hget(OldGameData)) {
    hmake OldGameData 100
    if ($isfile($+(",$scriptdir\OldGameData.hsh"))) { hload OldGameData $+(",$scriptdir\OldGameData.hsh") }
  }
  .timerGameData 0 3600 GameData
}

; Socket Stuff
alias GameData {
  if ($hget(OldGameData)) { hfree OldGameData }
  if ($isfile($+(",$scriptdir\OldGameData.hsh"))) { .remove $+(",$scriptdir\OldGameData.hsh") }
  if ($hget(NewGameData)) {
    hsave NewGameData $+(",$scriptdir\NewGameData.hsh")
    hfree NewGameData
  }
  hmake NewGameData 100
  hmake OldGameData 100
  if ($isfile($+(",$scriptdir\NewGameData.hsh"))) {
    hload OldGameData $+(",$scriptdir\NewGameData.hsh")
    hsave OldGameData $+(",$scriptdir\OldGameData.hsh")
  }
  sockopen GameData a.swirve.com 80
}

on *:sockopen:GameData: {
  sockwrite -n $sockname GET /data/ranks.txt HTTP/1.0
  sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
  sockwrite -n $sockname Host: a.swirve.com
  sockwrite -n $sockname Accept-Language: en-us
  sockwrite -n $sockname Accept-Encoding: gzip, deflate
  sockwrite -n $sockname Accept: */* $+ $crlf $+ $crlf
}

on *:sockread:GameData: {
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    var %temptext
    sockread %temptext
    if (!%temptext) { hsave NewGameData $+(",$scriptdir\NewGameData.hsh") | halt }
    tokenize 32 $gettok(%temptext,2-,41)
    hadd NewGameData $gettok(%temptext,1,32) $gettok($gettok(%temptext,2-,32),1,40) 03§ $1 03§ $2 03§ $iif($5,$3 03§ $4 03§ $5,03§ $3 03§ $4)
  }
}

; Trigger Stuff
on *:text:!who &:#yourchannel: {
  if ($hget(NewGameData,$2)) {
    msg $chan $2 $+ : $v1
  }
  else msg $chan No data on $2 $+ .
}

on *:text:!cpwho &:#yourchannel: {
  if ($hget(OldGameData,$2) || $hget(NewGameData,$2)) {
    if ($hget(OldGameData,$2) && $hget(NewGameData,$2)) {
      msg $chan New Data for $2 $+ : $hget(NewGameData,$2)
      msg $chan Old Data for $2 $+ : $hget(OldGameData,$2)
    }
    elseif ($hget(NewGameData,$2)) {
      msg $chan New Data for $2 $+ : $hget(NewGameData,$2)
      msg $chan Old Data for $2 $+ : N/A
    }
    else {
      msg $chan New Data for $2 $+ : N/A
      msg $chan Old Data for $2 $+ : $hget(OldGameData,$2)
    }
  }
  else msg $chan No data on $2 $+ . 
}

on *:input:#yourchannel: {
  if ($1 == !who && $2) {
    if ($hget(NewGameData,$2)) {
      msg $chan $2 $+ : $v1
    }
    else msg $chan No data on $2 $+ .
  }
  elseif ($1 == !cpwho && $2) {
    if ($hget(OldGameData,$2) || $hget(NewGameData,$2)) {
      if ($hget(OldGameData,$2) && $hget(NewGameData,$2)) {
        msg $chan New Data for $2 $+ : $hget(NewGameData,$2)
        msg $chan Old Data for $2 $+ : $hget(OldGameData,$2)
      }
      elseif ($hget(NewGameData,$2)) {
        msg $chan New Data for $2 $+ : $hget(NewGameData,$2)
        msg $chan Old Data for $2 $+ : N/A
      }
      else {
        msg $chan New Data for $2 $+ : N/A
        msg $chan Old Data for $2 $+ : $hget(OldGameData,$2)
      }
    }
    else msg $chan No data on $2 $+ . 
  }
}


You'll need to change 3 #yourchannel things to your channel name or to # for all channels.

Also, you may want to change the formatting of how the text is output to the channel. To change how the pieces of data are output to the channel, look for the line that starts with "hadd". You can adjust the 03§ parts to change the character/color between each piece of data. Right now, only that character is colored, but you can also color the other text if you want to. I'd recommend having it a different color than the dividing character so you can easily see what is what. To change the beginning text on the line, just look for the lines that start with "msg $chan".

At the top, you'll find a timer. Change the 3600 to the number of seconds you want between getting new data. 3600 == 1 hour. I didn't bother making some setup screen for just that one thing.

It is also set up to handle !who and !cpwho from other users and also from the bot (only in the specified channel(s) ). I didn't put a way to look it up by the name instead of the number. If you really think that would be used, let me know and I can throw in that part for you using $hfind.

Any questions, just ask. You'll want to restart mIRC after loading the script to get the timer started.

If you don't want to restart, you can just type the timer line (with a / in front of it) into your edit box and hit enter and then type /gamedata and hit enter to load in the data. (That /gamedata part is not needed if you restart mIRC).


Invision Support
#Invision on irc.irchighway.net