All pastes #275746 Raw Edit

O.o RSP Not Workin'

public text v1 · immutable
·published 2006-12-11 19:46 UTC
rendered paste body
on $*:TEXT:/^[@.!]rsplayers */Si:#: {
  if (%active. [ $+ [ $chan ] ] == YES) {
    if ($left($1,1) == @) {
      if ($readini(C:\mIRC\ELIXIR\chanconf.ini,$chan,global) == NO) {
        /notice $nick 4[3-1RS PLAYERS3-4]7 The @ commands are deactivated for the channel $chan $+ .
        halt
      }
      else {
        goto two
      }
    }
    :two
    set %rsp = 1
    while ($sock(RsPlayers. $+ %rsp)) {
      inc %rsp
    }
    set %rsp.target. $+ %rsp $iif($left($1,1) == @,msg $chan, .notice $nick ) 4[3-1RS PLAYERS3-4]7
    set %rsp.target.nick. $+ %rsp $nick
    var %sockname = RsPlayers. $+ %rsp
    sockopen %sockname www.runescape.com 80
    /halt
  }
  else {
    /notice $nick 4[3-1RS NEWS3-4]7 The channel havent activated the bot yet. Please type !activate $me to activate the bot.
  }
}
on *:SOCKOPEN:RsPlayers.*: {
  sockwrite -nt $sockname GET /lang/en/aff/runescape/title.ws HTTP/1.1
  sockwrite -nt $sockname Host: www.runescape.com
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:RsPlayers.*: {
  if ($sockerr) {
    %rsp.target. $+ %rsp Socketing Error: $sockerr $+ .
    halt
  }
  else {
    var %sockreader
    sockread %sockreader
    if (*There*are*currently* iswm %sockreader) {
      noop $regex(%sockreader,/There are currently(.*?)people playing!/Si)
      var %rsp.players $nohtml($nohtml($regml(1)))
      %rsp.target. $+ %rsp There are currently %rsp.players people playing Runescape.
      sockclose $sockname
      unset %rsp.*
    }
  }
}