SHARE
TWEET

Torn.com User Info

Ford Apr 24th, 2011 664 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Torn.com user info by Ford_Lawnmower irc.geekshed.net #Script-Help
  2. menu Channel,Status {
  3.   .$iif($group(#TornInfo) == On,$style(1)) TornInfo Trigger
  4.   ..$iif($group(#TornInfo) == On,$style(2)) On: .enable #TornInfo
  5.   ..$iif($group(#TornInfo) == Off,$style(2)) Off: .disable #TornInfo
  6. }
  7. #TornInfo on
  8. On $*:Text:/^(\+|-|!|@)TornInfo.*/Si:#: {
  9.   var %action $regml(1)
  10.   if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
  11.     if (%action == +) {
  12.       if ($istok(%TornInfoChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is already running the TornInfo script }
  13.       else {
  14.         .enable #TornInfo
  15.         Set %TornInfoChanList $addtok(%TornInfoChanList,$+($network,$chan),32)
  16.         .msg $chan $nick has activated the TornInfo script for $chan .
  17.       }
  18.     }
  19.     else {
  20.       if (!$istok(%TornInfoChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is not running the TornInfo script }
  21.       else {
  22.         Set %TornInfoChanList $remtok(%TornInfoChanList,$+($network,$chan),1,32)
  23.         .msg $chan $nick has deactivated the TornInfo script for $chan .
  24.       }
  25.     }
  26.   }
  27.   elseif (!$timer($+(TornInfo,$network,$nick))) && ($istok(%TornInfoChanList,$+($network,$chan),32)) {
  28.     .timer $+ $+(TornInfo,$network,$nick) 1 6 noop
  29.     var %method $iif(%action == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))
  30.     GetTornInfo %method $2-
  31.   }
  32. }
  33. #TornInfo end
  34. alias TornInfo { GetTornInfo echo -a $1- }
  35. alias -l GetTornInfo {
  36.   $1-2 Searching........
  37.   var %sockname $+(TornInfo,$network,$2,$ticks)
  38.   sockopen %sockname www.torn.com 80
  39.   sockmark %sockname $1-2 $+(/profiles.php?XID=,$3)
  40. }
  41. On *:sockopen:TornInfo*: {
  42.   if (!$sockerr) {
  43.     sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0
  44.     sockwrite -n $sockname Host: www.torn.com
  45.     sockwrite -n $sockname $crlf
  46.   }
  47.   else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  48. }
  49. On *:sockread:TornInfo*: {
  50.   if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  51.   else {
  52.     var %TornInfo | sockread %TornInfo
  53.     if ($regex(%TornInfo,/(Name:)<\/font>\s<font color.*><b>([^<]*)\[/i)) $gettok($sock($sockname).mark,1-2,32) $regml(1) $regml(2)
  54.     elseif ($regex(%TornInfo,/(Age:)<\/font>([^<]*)<br>/i)) $gettok($sock($sockname).mark,1-2,32) $regml(1) $regml(2)
  55.     elseif ($regex(%TornInfo,/(Job:)<\/font>([^<]*)<br>.*(Last\saction:)<\/font>([^<]*)<br>/i)) {
  56.       $gettok($sock($sockname).mark,1-2,32) $regml(1) $regml(2) $regml(3) $regml(4)
  57.       sockclose $sockname
  58.     }
  59.     elseif ($regex(%TornInfo,/(Faction:)<\/font>([^<]*)<br>/i)) $gettok($sock($sockname).mark,1-2,32) $regml(1) $regml(2)
  60.     elseif ($regex(%TornInfo,/(Level:)<\/font>([^<]*)<br><font color.*>(Rank:)<\/font>([^<]*)<br>/i)) $gettok($sock($sockname).mark,1-2,32) $regml(1) $regml(2) $regml(3) $regml(4)
  61.     elseif ($regex(%TornInfo,/(Gender:)<\/font>([^<]*)<br>/i)) $gettok($sock($sockname).mark,1-2,32) $regml(1) $regml(2)
  62.   }
  63. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top