The other thing, it has some weird postings on IRC, for example, if the result has a "[" or and "]" in it, it prints a { } around the result. Any idea of how to get rid of that? It only does it when I use the
Code: Select all
lappend result [string trim $nick],
Code: Select all
puthelp "privmsg $channel :$nick ($times )"
Here's the full code.
Code: Select all
package require http
bind pub - !guid guid
proc guid {n u h channel t} {
set length [string length $t]
if {$length == 0|| $t == "help"} {puthelp "notice $n :Enter a GUID of 8 characters or more to return a list of all aliases associated with it.. GUID Checker Beta 0.5" ; return 0 }
if {$length < 8} {puthelp "privmsg $channel :GUID's must be 8 characters or more." ; return 0 }
set page [::http::geturl *site here*=$t]
set content [split [::http::data $page] \n]
regsub -all -nocase { } $content " " tosave
regsub -all -nocase {<[^>*>]} $tosave {} tosave
regsub -all -nocase {<td>|</td>|d>|td>} $tosave {} tosave
regsub -all -nocase {>} $tosave ">" tosave
regsub -all -nocase {<} $tosave "<" tosave
::http::cleanup $content
set result ""
for {set x 127} {$x<500} {incr x 6} {
set nick [lindex $tosave $x]
set times [lindex $tosave [expr {$x +1}]]
if {$nick == ""} {break}
# puthelp "privmsg $channel :$nick ($times )"
lappend result [string trim $nick],
}
if {$result == "html>,"} {
puthelp "privmsg $channel :Nothing found, please check GUID and try again!"
} else {
puthelp "privmsg $channel :Aliases used by GUID $t"
puthelp "privmsg $channel :$result"
}
}