All pastes #2058461 Raw Edit

Someone

public text v1 · immutable
#2058461 ·published 2011-05-13 17:02 UTC
rendered paste body
On *:Text:!forums:*: {
  sockopen forumstitle services.runescape.com 80
  set %username $nick
  set %chan $chan
}
On *:SockOpen:forumstitle: {
  sockwrite -n $sockname GET /m=forum/forums.ws?39,40 HTTP/1.0
  sockwrite -n $sockname Host: http://services.runescape.com
  sockwrite -n $sockname $crlf
}

On *:SockRead:forumstitle: {
  if ($sockerr) { halt }
  Else {
    var %forums
    sockread %forums
    if (*a class="sticky2" href="forums.ws* iswm %forums) {
      tokenize 62 %forums | set %topictitle $remove($2,</a)
      tokenize 34 %forums | set %topicurl http://forum.runescape.com/ $+ $4
      sockread %forums
      if (*<span class="nt">created by <span class="username">* iswm %forums) {
        tokenize 62 %forums | set %topicuser $remove($3,</span)
        /echo %topicuser
        sockopen combat www.draynor.net 80
        unset %forums
        sockclose $sockname
      }
    }
  }
}



On *:SockOpen:combat: {
  //echo -a potato
  sockwrite -n $sockname GET /runescape_stats/ $+ $replace(%topicuser,$chr(32),$chr(37) $+ 20)) HTTP/1.0
  sockwrite -n $sockname Host: www.draynor.net
  sockwrite -n $sockname $crlf
}

On *:SockRead:combat: {
  if ($sockerr) { halt }
  Else {
    var %combat
    sockread %combat
    if (*<h4 style="float:right;display:inline;">Combat: <span style="vertical-align:middle;"><img src="/static/img/F2P.gif" /></span>* iswm %combat) {
      //echo -a working
      tokenize 62 %combat | set %usercombat $remove($5,<span style="vertical-align:middle;")
      msg %chan 4Topic Name:2 %topictitle 4Username:2 %topicuser 4Combat level:9 %usercombat 4URL:1 %topicurl
      unset %combat
      sockclose $sockname

    }
  }
}