<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19366" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2013-03-01T13:25:00-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19366</id>

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-03-01T13:25:00-04:00</updated>

		<published>2013-03-01T13:25:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101157#p101157</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101157#p101157"/>
		<title type="html"><![CDATA[Ansa.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101157#p101157"><![CDATA[
Try this forum string and see if that helps...<br><a href="http://forum.egghelp.org/viewtopic.php?p=94646" class="postlink">http://forum.egghelp.org/viewtopic.php?p=94646</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Mar 01, 2013 1:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Kaa]]></name></author>
		<updated>2013-03-01T12:44:45-04:00</updated>

		<published>2013-03-01T12:44:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101156#p101156</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101156#p101156"/>
		<title type="html"><![CDATA[Ansa.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101156#p101156"><![CDATA[
<blockquote class="uncited"><div>After doing this change, have you rehashed the bot?</div></blockquote>putdcc -raw 0 [string length $str] $str<br><br>Error: Tcl error [ansa:request]: wrong # args: should be "putdcc idx text ?o                ptions?"<br><br>putnow 0 [string length $str] $str<br><br>Error:  Tcl error [ansa:request]: wrong # args: should be "putnow text ?options?"<br><br>I do not solve the problem. That's why I made ​​this post.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9415">Kaa</a> — Fri Mar 01, 2013 12:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-03-01T12:16:29-04:00</updated>

		<published>2013-03-01T12:16:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101155#p101155</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101155#p101155"/>
		<title type="html"><![CDATA[Ansa.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101155#p101155"><![CDATA[
After doing this change, have you rehashed the bot?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Mar 01, 2013 12:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Kaa]]></name></author>
		<updated>2013-03-01T09:52:45-04:00</updated>

		<published>2013-03-01T09:52:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101154#p101154</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101154#p101154"/>
		<title type="html"><![CDATA[Ansa.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101154#p101154"><![CDATA[
<blockquote class="uncited"><div>The error is self explanatory. How hard it to change an word on your own? Hint:<div class="codebox"><p>Code: </p><pre><code>putdccraw 0 [string length $str] $str</code></pre></div></div></blockquote>I changed before this post:<br><br>putdcc 0 [string length $str] $str<br>putnow 0 [string length $str] $str<br><br>but alway error...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9415">Kaa</a> — Fri Mar 01, 2013 9:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-03-01T09:13:06-04:00</updated>

		<published>2013-03-01T09:13:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101153#p101153</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101153#p101153"/>
		<title type="html"><![CDATA[Ansa.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101153#p101153"><![CDATA[
The error is self explanatory. How hard it to change an word on your own? Hint:<div class="codebox"><p>Code: </p><pre><code>putdccraw 0 [string length $str] $str</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Mar 01, 2013 9:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Kaa]]></name></author>
		<updated>2013-03-01T07:14:35-04:00</updated>

		<published>2013-03-01T07:14:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101151#p101151</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101151#p101151"/>
		<title type="html"><![CDATA[Ansa.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101151#p101151"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>### GLOBALS ###set ansa(version) "3.1"set ansa(url) "http://www.ansa.it/main/notizie/awnplus/^RUBRICA/synd/ansait_awnplus_^RUBRICA_medsynd_Today_Idx.xml"set ansa(timeout) 5000### Percorso di salvataggio dei Database delle news (la directory deve esistere)set ansa(filepath) "ansa-tmp"proc ansa:send { str } {set str "$str\n"putdccraw 0 [string length $str] $str}proc get:rubriche { {char ""} } {set rubriche { topnews italia mondo calcio sport spettacolo economia cultura scienza internet moda musica cinema }if { $char != ""} {return [ join $rubriche $char ]} else {return $rubriche}}### END GLOBALS ###### FLAGS ###setudef flag ansaforeach rubrica [get:rubriche] {  setudef flag ansa_$rubrica}### END FLAGS ###### BINDS ###bind time - "00 * * * *" ansa:checkbind time - "15 * * * *" ansa:checkbind time - "30 * * * *" ansa:checkbind time - "45 * * * *" ansa:checkbind pub - !ansa ansa:request### END BINDS ###### PROCS ###package require httphttp::config -useragent "Mozilla/1.0"proc strlastpos { string char {max 0} } {if { $max == 0} { set max [ string length $string ] }if { [ string length $string ] &lt;= $max } { return [ string length $string ] }for { set i 0 } { $i &lt; $max } { incr i } {if { [ string index $string [ expr $max - $i ] ] == $char } {return [ expr $max - $i ]}}return $max}proc ansa:mkdir { path } {set dir ""foreach folder [ split ${path} "/" ] {set dir "${dir}${folder}/"if { ! [ file exists ${dir} ] } {file mkdir ${dir}}}}proc max:privmsg:chars target {global botname#:nick!user@host PRIVMSG target :return [ expr 510 - 1 - [ string length $botname ] - 30 - [ string length $target ] - 2 ]}proc ansa:request { nick uhost hand chan arg } {global ansaif { [ lsearch [ channel info $chan ] "+ansa" ] == -1 } { return }putlog "ANSA :: request \"!ansa $arg\" from $nick!$uhost on $chan"### HELP ###if { $arg == "" || $arg == "help" } {set rubriche [ get:rubriche ", " ]ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037HELP\037 - Lo script visualizza le notizie ANSA in canale.\Si possono vedere le ultime notizie con \002!ansa list\002 e richiamare la singola notizia con \002!ansa numero\002.\Gli operatori del canale possono aggiungere una rubrica con \002!ansa add rubrica\002 o rimuoverla con\\002!ansa del rubrica\002."ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037HELP\037 - Per avere una lista delle rubriche attualmente seguite\\002!ansa info\002. Le rubriche disponibili sono: $rubriche."return}### END HELP ###set max_chars [ max:privmsg:chars $chan ]set argom [ lindex $arg 0 ]set rubrica [ lindex $arg 1 ]set rubriche [ ansa:rub $chan ]### CONTROLLO ARGOMENTI ###switch -- $argom {info {if { [ llength $rubriche ] == 0 } { lappend rubriche "nessuna" }ansa:send "PRIVMSG $chan :\037ANSA\037 \002::\002 \037INFO\037 - Le rubriche ANSA seguite\da \002$chan\002 sono: $rubriche"}add {if { ! [ isop $nick $chan ] } {ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037ERROR\037 - Devi essere operatore in $chan per aggiungere una rubrica."return}if { [ lsearch -exact [ get:rubriche ] $rubrica ] &gt; -1 } {if { [ lsearch -exact $rubriche $rubrica ] &gt; -1 } {ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037ERROR\037 - Il canale \002$chan\002 segue già la rubrica\\002$rubrica\002. Se si desidera rimuoverla \002!ansa rem $rubrica\002. Per una lista \002!ansa info\002"} else {# AGGIORNAMENTO RUBRICAansa:update new $rubricachannel set $chan +ansa_${rubrica}ansa:send "PRIVMSG $chan :\037ANSA\037 \002::\002 \037ADD\037 - Ho aggiunto \002$rubrica\002.\Ora le rubriche ANSA seguite da \002$chan\002 sono: [ ansa:rub $chan ]."}} else {        set rubr [ get:rubriche ",  " ]ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037ERROR\037 - \002$rubrica\002 è una rubrica non valida.\Devi scegliere tra: $rubr."}}del {if { ! [ isop $nick $chan ] } {ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037ERROR\037 - Devi essere operatore in $chan per rimuovere una rubrica."return}if { [ lsearch -exact [ get:rubriche ] $rubrica ] &gt; -1 } {if { [ lsearch -exact $rubriche $rubrica ] &gt; -1 } {channel set $chan -ansa_${rubrica}set temp [ lsearch -exact $rubriche $rubrica ]set rubriche [ ansa:rub $chan ]if { [ llength $rubriche ] == 0 } { set rubriche "nessuna" }ansa:send "PRIVMSG $chan :\037ANSA\037 \002::\002 \037DEL\037 - Ho rimosso \002$rubrica\002.\Ora le rubriche ANSA seguite da \002$chan\002 sono: $rubriche"} else {ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037ERROR\037 - Il canale \002$chan\002 non segue la rubrica\\002$rubrica\002. Se si desidera inserirla \002!ansa add $rubrica\002. Per una lista \002!ansa info\002"}} else {        set rubr [ get:rubriche ",  " ]ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037ERROR\037 - \002$rubrica\002 è una rubrica non valida.\Devi scegliere tra: $rubr."}}list {if { $rubrica == "" } {ansa:send "PRIVMSG $nick :\037ANSA\037 \002::\002 \037ERROR\037 - Per avere la lista delle news devi specificare la rubrica con\\002!ansa list rubrica\002. Le rubriche seguite da $chan sono: [ ansa:rub $chan ]."} else {set num 1set risposta ""set ansafile [ open "$ansa(filepath)/$rubrica.news" r ]if { [ lsearch -exact $rubriche $rubrica ] &gt; -1 } {while { [ gets $ansafile linedb ] &gt; -1 } {if { [ regexp -all -- {(.+)\t(.+)\t.+_(\d+).html} $linedb all title description refer ] } {set risposta "$risposta - $title (\037$refer\037)"if { $num &gt; 4 } { break }incr num}}if { $risposta != "" } { ansa:send "PRIVMSG $chan :\037ANSA\037 \002::\002 \[\037$rubrica\037\]$risposta" }}close $ansafile}}url {set id [ lindex $arg 1 ]if { [ regexp -- {\d+} $id ] } {set url ""set found 0foreach rubrica [ get:rubriche ] {set ansafile [ open "$ansa(filepath)/$rubrica.news" r ]while { [ gets $ansafile linedb ] &gt; -1 &amp;&amp; $found != 1 } {if { [ regexp -all -- {(.+)\t(.*)\t(.+)} $linedb all title description link ] } {if { [ string match -nocase *_$id.html $link ] } {                set url $linkansa:send "PRIVMSG $chan :\037ANSA\037 \002::\002 \[\037$rubrica\037\] \002::\002 $url"set found 1}}}close $ansafile}}}}if { [ regexp -- {\d+} $argom ] } {set url ""set found 0foreach rubrica [ get:rubriche ] {set ansafile [ open "$ansa(filepath)/$rubrica.news" r ]while { [ gets $ansafile linedb ] &gt; -1 &amp;&amp; $found != 1 } {if { [ regexp -all -- {(.+)\t(.*)\t(.+)} $linedb all title description link ] } {if { [ string match -nocase *_$argom.html $link ] } {            set url $link### STAMPA NOTIZIAset http [ ::http::geturl $url ]set html [ ::http::data $http ]::http::cleanup $httpif { [ regexp -all -- {&lt;div[^&gt;]* id\=\"content-corpo\"[^&gt;]*&gt;(.+?)&lt;/div&gt;&lt;!\-\-\s/\#corpo\s\-\-&gt;} $html all risposta ] } {regsub -all -- {\n} $risposta " " rispostaregsub -all -- {\s+} $risposta " " rispostaregsub -all -- {\/} $risposta "/" rispostaregsub -all -- {\&amp;#\d+;} $risposta "" rispostaregsub -all -- {&lt;/?[^&gt;]+&gt;} $risposta "" rispostaregsub -- {^\s*\(ANSA\)\s*-?\s*} $risposta "" rispostaregsub -- {\s*\(ANSA\).*$} $risposta "" rispostaregsub -all -- {\s\s+} $risposta " " rispostaset risposta "\037ANSA\037 \002::\002 \[\037$rubrica\037\] (\002$argom\002) [ string trim $risposta ]"while { [ string length $risposta ] &gt; 0 } {set limit [ strlastpos $risposta " " $max_chars ]set risptemp [ string range $risposta 0 $limit ]set risposta [ string range $risposta $limit end ]if { [ string length $risposta ] != 0 } {ansa:send "PRIVMSG $chan :$risptemp ..."} else {ansa:send "PRIVMSG $chan :$risptemp"}}unset risposta}set found 1}}}close $ansafile}if { $found != 1 } {ansa:send "PRIVMSG $chan :\037ANSA\037 \002::\002 \037ERRORE\037 - Notizia non trovata !"}}}proc ansa:rub chan {set rubriche {}if { [ validchan $chan ] } {foreach rubrica [ get:rubriche ] {if { [ lsearch -exact [ channel info $chan ] "+ansa_$rubrica" ] &gt; -1 } { lappend rubriche $rubrica }}} else {foreach chan [ channels ] {foreach rubrica [ get:rubriche ] {if { [ lsearch -exact [ channel info $chan ] "+ansa_$rubrica" ] &gt; -1 } {if { [ lsearch -exact $rubriche $rubrica ] == -1 } { lappend rubriche $rubrica }}}}}return $rubriche}proc ansa:update { tipo rubrica } {global ansaset ansafile [ open "$ansa(filepath)/$rubrica.news" r ]set ansafilet [ open "$ansa(filepath)/$rubrica.tmp" a ]while { [ gets $ansafile linedb ] &gt; -1 } {if { [ regexp -nocase -- {(.+)\t(.*)\t(.+)} $linedb all title description link ] } {if { [ regexp -all -- {.+_(\d+).html} $link all refer ] } {lappend riferimenti $refer}}}close $ansafileset risposta ""regsub -all -- {\^RUBRICA} $ansa(url) "$rubrica" urlset http [ http::geturl $url ]set html [ http::data $http ]::http::cleanup $httpregsub -all -- {\n} $html "" htmlregsub -all -- {&lt;item&gt;} $html "\n&lt;item&gt;" html### Lettura del Feed RSSforeach line [ split $html "\n" ] {if { [ regexp -nocase -- {&lt;item&gt;&lt;title&gt;&lt;!\[CDATA\[(.+)\]\]&gt;&lt;/title&gt;&lt;description&gt;&lt;!\[CDATA\[(.*)\]\]&gt;&lt;/description&gt;&lt;link&gt;(.+)&lt;/link&gt;.*&lt;/item&gt;} $line all title description link ] } {if { [ regexp -all -- {.+_(\d+).html} $link all refer ] } {if { [ info exists riferimenti ] &amp;&amp; [ lsearch -exact $riferimenti $refer ] == -1 } {regsub -all -- {\/} $title "/" titleregsub -all -- {\"} $title "'" titleset risposta "$risposta $title (\037$refer\037)"}puts $ansafilet "$title\t$description\t$link"}}}close $ansafiletif { $risposta != "" &amp;&amp; $tipo == "new" } {set risposta "\037ANSA\037 \002::\002 \[\037$rubrica\037\]$risposta"foreach chan [ channels ] {set max_chars [ max:privmsg:chars $chan ]if { [ lsearch -exact [ channel info $chan ] "+ansa_$rubrica" ] &gt; -1 } {if { [ string length $risposta ] &gt; $max_chars } {set risptemp [ string range $risposta 0 [ expr $max_chars - 8 ] ]ansa:send "privmsg $chan :$risptemp\017..."set risptemp [ string range $risposta [ expr $max_chars - 7 ] end ]ansa:send "privmsg $chan :\017...$risptemp"} else {ansa:send "privmsg $chan :$risposta"}}}}if { [ file exists "$ansa(filepath)/$rubrica.tmp" ] } { file rename -force -- "$ansa(filepath)/$rubrica.tmp" "$ansa(filepath)/$rubrica.news" }}proc ansa:check { min ora giorno mese anno } {set rubriche [ get:rubriche ]if { [ llength $rubriche ] &gt; 0 } {if { $anno == 0 } {foreach rubrica $rubriche { ansa:update init $rubrica }putlog "\037ANSA\037 \002::\002 \037NEWS\037 - News aggiornate"} else {foreach rubrica $rubriche { ansa:update new $rubrica }}if { [ file exists "$::ansa(filepath)/$rubrica.tmp" ] } { file rename -force -- "$::ansa(filepath)/$rubrica.tmp" "$::ansa(filepath)/$rubrica.news" }}}### END PROCS ###### CREAZIONE DELLA DIRECTORY DI SALVATAGGIO DEI FILE ###ansa:mkdir $ansa(filepath)### PULIZIA FILE TEMPORANEI ###foreach rubrica [ get:rubriche ] {if { [ file exists "$ansa(filepath)/$rubrica.tmp" ] } { file rename -force -- "$ansa(filepath)/$rubrica.tmp" "$ansa(filepath)/$rubrica.news" }if { ![ file exists "$ansa(filepath)/$rubrica.news" ] } {set ansafile [ open "$ansa(filepath)/$rubrica.news" w ]close $ansafile}}after 1500 ansa:check 0 0 0 0 0</code></pre></div>I have this error in partyline: Tcl error [ansa:request]: putdccraw is deprecated. Please use putdcc/putnow instead. <br><br>Can you help me to resolve it? Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9415">Kaa</a> — Fri Mar 01, 2013 7:14 am</p><hr />
]]></content>
	</entry>
	</feed>
