La urmatorul script da eroarea: Tcl error [stiri]: can't read "news": no such variable
Code:
set max "6"
set chan "#pascani"
set url "http://www.newspascani.ro/modules/news/index.php"
set msg "Ultimele 5 stiri:"
bind pub - !stiri stiri
package require http;
proc stiri {nick host hand chan text} {
global url max
set tectoken [::http::geturl "$url"];
set tecdata [tec_html [::http::data $tectoken]]
http::cleanup $tectoken
set max $max
set num 0
foreach tmp [split $tecdata \n] {
if {[regexp {^.*<p class="itemText">(.*)</p>} $tmp tmp datum]} {
set news $datum
}
if {[regexp {^.*<span class="itemPermaLink"><a href="(.*)">} $tmp tmp url]} {
set url $url
}
if {$num < $max} {
puthelp "PRIVMSG $nick :$news"
puthelp "PRIVMSG $nick :$url"
incr num
}
}
}
Pliz daca imi puteti zice ce am gresit :-?