rendered paste bodypackage require http
bind pub - @stats firstsocket
proc firstsocket {nick userhost handle chan text} {
set rsn "\00310Stats for \00312$text:"
set site "http://ZetaScript.org/Zeta/stats.php?"
set url $site[http::formatQuery player $text]
set read [::http::data [::http::geturl $url -timeout 10000]]
foreach line [split $read \n] {
if {[lindex [split "$line" ","] "1"] != -1} {
if {[info exists $type] == 0} { set type "\00310[lindex [split "$line" ","] "0"]
\00312[lindex [split "$line" ","] "2"]" } else { set type "$type \00310[lindex [split "$line" ","] "0"] \00312[lindex [split "$line" ","] "2"]" }
}
putquick "PRIVMSG $chan :$rsn"
putquick "PRIVMSG $chan :$type"
}