napa182 commented on a Page, 8Ball script  -  Dec 17, 2009

you can do a different take by making it into a socket script. to use it you ask in the form of a question.

<~napa182> 8ball will i ever find my car keys?
<~Sick0> [The magic 8ball says:] Outlook good.

on $*:text:/^(8ball\s(.+)\?)$/S:#:{ 
  if (!%ball8flood) { 
    set -u3 %ball8flood $nick 
    if ($sock(8ball)) .sockclose 8ball 
    sockopen 8ball pages.cs.wisc.edu 80 
    sockmark 8ball # 14[04The magic 8ball says:14]
  }
}
on *:sockopen:8ball: {
  sockwrite -nt $sockname GET /~craft/8ball.cgi HTTP/1.1 
  sockwrite -nt $sockname Host: $+(pages.cs.wisc.edu,$str($crlf,2)) 
}
on *:sockread:8ball: {
  var %8ball | sockread %8ball
  if ($regex(%8ball,/<h4>(.+)<\/h4>/)) { msg $sock(8ball).mark $regml(1) | sockclose 8ball }
}

just a different take

 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.