All pastes #125894 Raw Edit

Something

public text v1 · immutable
·published 2006-08-11 00:41 UTC
rendered paste body
on *:JOIN:#randomchannel:{
  set %pcstuff $+($nick,:,$chan)
  if ($sock(pckick)) {
    sockclose pckick
  }
  sockopen pckick altscripts.trap17.com 80
}
on *:SOCKOPEN:pckick:{
  sockwrite -nt $sockname GET /rsparsers/cbskills.php?name= $+ $gettok(%pcstuff,1,58) HTTP/1.1
  sockwrite -nt $sockname Host: altscripts.trap17.com
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:pckick:{
  if ($sockerr) {
    echo -a Socket error
  }
  else {
    var %read
    while (1) {
      sockread -f %read
      if (!$sockbr) { break }
      if (Attack:* iswm %read) {
        var %attack = $remove($gettok(%read,2,58),<br />)
      }
      if (Strength:* iswm %read) {
        var %strength = $remove($gettok(%read,2,58),<br />)
      }
      if (Combat:* iswm %read) {
        var %combat = $remove($gettok(%read,2,58),<br />)
      }    
    }
    if (($floor(%combat) < 90) && ($calc(%attack + %strength) < 150)) || ($floor(%combat) !isnum 90- ) {
      kick $gettok(%pcstuff,2,58) $gettok(%pcstuff,1,58) You do not meet requirements for this channel. (90 combat or Attack+Strength of 150 or more)
    }
    else {
      msg $gettok(%pcstuff,2,58) $gettok(%pcstuff,1,58) is lvl $floor(%combat) and has %attack attack and %strength strength.
    }
  }
}