Out War Stats Updated

By LordHawk on Dec 19, 2008

This is simple a updated version of http://www.hawkee.com/snippet/1599/ I DID not write the first version. They have added new servers since he last made the snippet.

/*
Outwar.com Stats Script
--
Usage:
!outwar <Sigil/Torax/Fabar/Zimbob/Rancid/Quiver> <User's name>
--
*/

on *:TEXT:!outwar*:#: {
  if (!$regex($2,(S|s)igil|(T|t)orax|(F|f)abar|(Z|z)imbob|(R|r)ancid|(Q|q)uiver)) || (!$3) { halt }
  sockopen outwar $+($lower($regml(1)),.outwar.com) 80
  sockmark outwar $2- $chan
}
on *:SOCKOPEN:outwar: {
  var %s = sockwrite -n $sockname
  %s GET $+(/profile.php?transnick=,$gettok($sock($sockname).mark,2,32)) HTTP/1.1
  %s Host: $+($gettok($sock($sockname).mark,1,32),.outwar.com)
  %s Connection: close
  %s $crlf
}
on *:SOCKREAD:outwar: {
  var %a
  sockread -f %a
  if ($+(%s.exp,%s.cl,%s.gr,%s.pa,%s.un)) {
    var %r = $iif(%s.pa,$gettok(%a,5,60),$gettok(%a,4,60))
    var %r = $gettok(%r,2,62)
    set %s $+(%s,$chr(42),$+(%s.exp,%s.cl,%s.hp,%s.gr,%s.pa,%s.un) %r)
    unset %s.*
  }
  else {
    if (*size="1">EXPERIENCE</font>* iswm %a) {
      set %s.exp EXPERIENCE
    }
    if (*size="1">CLASS</font>* iswm %a) {
      set %s.cl CLASS
    }
    if (*<a href="page.php?x=* iswm %a) {
      set %s.hp = $3
    }
    if (*size="1">Growth Yesterday</font>* iswm %a) {
      set %s.gr GROWTH YESTERDAY
    }
    if (*size="1">PARENT</font>* iswm %a) {
      set %s.pa PARENT
    }
    if (*<a href="crewprofile.php?id=* iswm %a) {
      var %r = $gettok(%a,4,60)
      %r = $gettok(%r,2,62)
      set %s $+(%s,$chr(42),$gettok($sock($sockname).mark,2,32) is a %r) 
    }
  }
}
on *:SOCKCLOSE:outwar: {
  var %x = $numtok(%s,42),%y = 1
  msg $gettok($sock($sockname).mark,3,32) 4- Stats for $gettok($sock($sockname).mark,2,32) on $gettok($sock($sockname).mark,1,32) 4-
  while (%y <= %x) {
    .timer 1 1 msg $gettok($sock($sockname).mark,3,32) $gettok(%s,%y,42)
    inc %y
  }
  .timer 1 1 msg $gettok($sock($sockname).mark,3,32) 4- End of Stats 4-
  unset %s
}

Comments

Sign in to comment.
napa182   -  Dec 19, 2008

on the !$regex
instead of

(!$regex($2,(S|s)igil|(T|t)orax|(F|f)abar|(Z|z)imbob|(R|r)ancid|(Q|q)uiver))

you can do this

(!$regex($2,/(Sigil|Torax|Fabar|Zimbob|Rancid|Quiver)/i))
 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.