!rsn Runescape Name Looker

By SomeMessyScripter on Oct 09, 2009

This is just a Runescape Name look up, made recently, I don't think there are any bugs in it so far although the colours do look a little dodgey :)

on $*:TEXT:/^[!@.](name|nick|rsn)/Si:#: {
  if (!$2) { $iif($left($1,1) == @,msg #,.notice $nick) 4Error! 14Lookup name not supplied! | halt }
  if ($len($2) > 12) { $iif($left($1,1) == @,msg #,.notice $nick) 4Error! 14No more than 12 characters allowed! | halt }
  else {
    set %nick.query $replace($2-,$chr(32),_)
    set %nick.ans $iif($left($1,1) == @,msg #,.notice $nick)
    sockopen Nick. [ $+ [ $ticks ] ] www.rscript.org 80
} }
on *:SOCKOPEN:Nick.*:{
  sockwrite -nt $sockname GET $+(/lookup.php?type=namecheck&name= $+ %nick.query) HTTP/1.1
  sockwrite -nt $sockname Host: rscript.org
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:Nick.*:{
  if ($sockerr) { %nick.ans 4Error! 14 An error in the socket has caused this error4 " $+ $sockerr $+ "14 Please memo "botmaster" with this socket error. | halt } 
  else { 
    var %nick.read
    sockread %nick.read
    if (*NAMECHECK:* iswm %nick.read) { 
      tokenize 32 %nick.read 
      if ($2 == AVALIBLE) { set %nick.avlbty 9Available! } 
      elseif ($2 == NOTAVALIBLE) { set %nick.avlbty 4Not Available. } 
      %nick.ans 14[NICK14]4 %nick.Query 14is %nick.avlbty
      sockclose $sockname

} } }

Comments

Sign in to comment.
poborski   -  Sep 13, 2011

on $:TEXT:/^!@./Si:#: {
if (!$2) { $iif($left($1,1) == @,msg #,.notice $nick) 4Error! 14Lookup name not supplied! | halt }
if ($len($2-) > 12) { $iif($left($1,1) == @,msg #,.notice $nick) 4Error! 14No more than 12 characters allowed! | halt }
else {
set %nick.query $replace($2-,$chr(32),_)
set %nick.ans $iif($left($1,1) == @,msg #,.notice $nick)
sockopen Nick. [ $+ [ $ticks ] ] www.rscript.org 80
} }
on
:SOCKOPEN:Nick.:{
sockwrite -nt $sockname GET $+(/lookup.php?type=namecheck&name= $+ %nick.query) HTTP/1.1
sockwrite -nt $sockname Host: rscript.org
sockwrite -nt $sockname $crlf
}
on
:SOCKREAD:Nick.:{
if ($sockerr) { %nick.ans 4Error! 14 An error in the socket has caused this error4 " $+ $sockerr $+ "14 Please memo "botmaster" with this socket error. | halt }
else {
var %nick.read
sockread %nick.read
if (
NAMECHECK:* iswm %nick.read) {
tokenize 32 %nick.read
if ($2 == AVALIBLE) { set %nick.avlbty 9Available! }
elseif ($2 == NOTAVALIBLE) { set %nick.avlbty 4Not Available. }
%nick.ans 14[NICK14]4 %nick.Query 14is %nick.avlbty
sockclose $sockname

} }

 Respond  
poborski   -  Sep 13, 2011

there is a error on this it was suppost to be 12 caracters if u add 13 caracters it will still accept if u give like a space

 Respond  
SomeMessyScripter   -  Oct 11, 2009

Oh I spose so

 Respond  
knoeki   -  Oct 09, 2009

idea: instead of letting the bot say "please memo botmaster", why not have the bot send the memo instead? ;_)

 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.