Raw finder

By Lindrian on Oct 21, 2007

This is a simple "raw finder". you input your raw (name/number) and it opens a socket and retrieves information.
Syntax: /raw.find <number|name>
eg: /raw.find who
/raw.find 366
etc.

Why?

Well, since I do some pretty advanced coding these days, and using raws instead of on join events (and misc) is usually more accurate (for the stuff i do), i cant bother to look at a website all the time, so I simply made this script.

I found it very great and usful myself.

alias raw.find {
  if ($1) {
    unset %raw.*
    if ($sock(raw)) .sockclose raw
    .sockopen raw script.quakenet.org 80
    var %j = $iif($1 isnum,$right($+(00,$1),3),$1)
    echo -a 
    echo -a Looking up raw %j $+ ... Please hold.
    echo -a 
    .sockmark raw %j
  }
  else {
    echo -a Syntax: /raw.find <numeric|name>
  }
}
on *:sockopen:raw: {
  if ($sockerr) {
    echo -a Failed connecting to the server: $sock($sockname).wsmsg
    .sockclose $sockname
  }
  else {
    .sockwrite -n $sockname GET $+(/index.php?p=raws&,$iif($sock($sockname).mark isnum,a,b),=,$sock($sockname).mark) HTTP/1.1
    .sockwrite -n $sockname HOST: script.quakenet.org
    .sockwrite -n $sockname $crlf 
  }
}
on *:sockread:raw: {
  var %g 
  sockread %g
  if ($regex(%g,/<tr><td class="RawsHeader1">(.*?)</td><td class="RawsHeader2">(.*?)</td></tr>/)) {
    %raw.z = $regml(1)
  }
  if ($regex(%g,/<tr><td class="RawsBody1">(.*?)</td><td colspan=".*?" class="RawsBody2">(.*?)</td></tr>/)) {
    if (!%raw.x) {
      echo -a $+(,[,$sock($sockname).mark,],)
      echo -a 
      %raw.x = 1
    }
    echo -a $+(,$regml(1),) $remove($replace($regml(2),&gt,>,&lt,<),;)
    %raw.y = $calc(%raw.y + 1)
    if (%raw.y == 3) {
      if (%raw.z) echo -a Numeric: $iif($v1 isnum,$v1,$v1 (Not numeric))
      echo -a Link: http://script.quakenet.org/index.php?p=raws& $+ $iif($sock($sockname).mark isnum,a= $+ $v1,b= $+ $v1)
      echo -a 
      %raw.y = 0
    }
  }
}
on *:sockclose:raw: {
  if (!%raw.x) {
    echo -a There was no result for raw $sock($sockname).mark $+ ...
    unset %raw.*
  }
  else echo -a $+(,[,/,$sock($sockname).mark,],)
}

Comments

Sign in to comment.
napa182   -  Oct 22, 2007

Ur welcome and i score this 8/10 ;)

 Respond  
Lindrian   -  Oct 22, 2007

Hehe, thank you too napa182, greatly appreciated.

 Respond  
napa182   -  Oct 22, 2007

nice work Lindrian.. I too will be useing it ;)

 Respond  
Lindrian   -  Oct 22, 2007

Thank you Ollie :)

 Respond  
Olliegod   -  Oct 21, 2007

Very useful script, I\'ll be using this quite a bit. Thanks.

 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.