<?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/21231" />

	<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>2023-01-08T06:39:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2023-01-08T06:39:22-04:00</updated>

		<published>2023-01-08T06:39:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111601#p111601</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111601#p111601"/>
		<title type="html"><![CDATA[a help for this part of a tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111601#p111601"><![CDATA[
Thanks SpiKe^^<br>you have solved the whole code for me all working<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Sun Jan 08, 2023 6:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-07T19:46:27-04:00</updated>

		<published>2023-01-07T19:46:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111600#p111600</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111600#p111600"/>
		<title type="html"><![CDATA[strftime]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111600#p111600"><![CDATA[
Try put this, or something like this, in the text you want dated...<div class="codebox"><p>Code: </p><pre><code>[strftime "on %x at %X"]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Jan 07, 2023 7:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2023-01-07T12:02:19-04:00</updated>

		<published>2023-01-07T12:02:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111599#p111599</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111599#p111599"/>
		<title type="html"><![CDATA[a help for this part of a tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111599#p111599"><![CDATA[
thanks SpiKe^^<br>the list solution works for me.<br>for the date and time to be written in each request to be written in list_requests.txt can you help me thank you<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Sat Jan 07, 2023 12:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-07T10:29:04-04:00</updated>

		<published>2023-01-07T10:29:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111598#p111598</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111598#p111598"/>
		<title type="html"><![CDATA[a help for this part of a tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111598#p111598"><![CDATA[
This should add the new "Start List of requests" line...<br><div class="codebox"><p>Code: </p><pre><code>proc requestlist {nick uhost hand chan arg} {       global adminchans1       if {$chan == $adminchans1} {               set filename "lista_peticiones.txt"               set in [open $filename r]               set reqnumber 0               set data [split [read -nonewline $in] "\n"]               close $in               if {![llength $data]} {                 putnow "PRIVMSG $adminchans1 :No hay solicitudes por el momento."                 return 0               }               putnow "PRIVMSG $adminchans1 :Inicio Listado peticiones."               foreach line $data {   incr reqnumber                 putnow "PRIVMSG $adminchans1 :$reqnumber: $line "               }               putnow "PRIVMSG $adminchans1 :Fin Listado peticion."       }       return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Jan 07, 2023 10:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2023-01-07T07:14:46-04:00</updated>

		<published>2023-01-07T07:14:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111596#p111596</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111596#p111596"/>
		<title type="html"><![CDATA[a help for this part of a tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111596#p111596"><![CDATA[
Hi Spike^^<br>Thank you for collaborating. What you have posted works, it seems that I forgot to put in the previous examples when the list begins with: Start List of requests. One last bit of help could be that when I send the list it goes like this:<br><ul><li>@dj : !listapedidos<br>@radio : Inicio Listado peticiones.<br>@radio : pepe A Solicitado una lechuga amarilla En El Canal #pruebas<br>@radio : pepe A Solicitado una cocacola sin gas En El Canal #pruebas<br>@radio : Fin Listado petición.</li></ul>In this part how can I put timestamps on it so that it would look like this in the listings:<br>@radio : pepe A Requested four takeaway pizzas on 07/01/23 at 12:15 In The Channel #tests<br><div class="codebox"><p>Code: </p><pre><code> set tempeti [open "lista_peticiones.txt" a]            put $tempeti "$nick A Solicitado $arg En El Canal $chan"            close $tempeti</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Sat Jan 07, 2023 7:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-06T17:37:36-04:00</updated>

		<published>2023-01-06T17:37:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111595#p111595</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111595#p111595"/>
		<title type="html"><![CDATA[try this.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111595#p111595"><![CDATA[
Try this<div class="codebox"><p>Code: </p><pre><code>proc requestlist {nick uhost hand chan arg} {       global adminchans1       if {$chan == $adminchans1} {               set filename "lista_peticiones.txt"               set in [open $filename r]               set reqnumber 0               set data [split [read -nonewline $in] "\n"]               close $in               if {![llength $data]} {                 putnow "PRIVMSG $adminchans1 :No hay solicitudes por el momento."                 return 0               }               foreach line $data {   incr reqnumber                 putnow "PRIVMSG $adminchans1 :$reqnumber: $line "               }               putnow "PRIVMSG $adminchans1 :Fin Listado peticion."       }       return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Jan 06, 2023 5:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2023-01-06T14:15:34-04:00</updated>

		<published>2023-01-06T14:15:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111594#p111594</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111594#p111594"/>
		<title type="html"><![CDATA[Re: a help for this part of a tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111594#p111594"><![CDATA[
hello crazycat<br>with this code I request the list of requests<br><blockquote class="uncited"><div>First of all, congratulations all Happy New Year 2023.<br><br>When users make a musical request, the bot sends it to the dj room and writes it in a txt.<br>When I request the order list<br>It always comes out, whether there are requests or not: No requests at the moment.<br> Any suggestion to fix it?<div class="codebox"><p>Code: </p><pre><code>     bind pub -|- !listapedidos requestlistproc requestlist {nick uhost hand chan arg} {       global adminchans1       if {$chan == $adminchans1} {               set reqnumber 1               set filename "lista_peticiones.txt"               set in [open $filename r]               while {1} {                       set line [gets $in]                       if {$line == ""} {                               putnow "PRIVMSG $adminchans1 :No hay solicitudes por el momento."                               break                       } else {                               if {[eof $in]} {                                       putnow "PRIVMSG $adminchans1 :Fin Listado peticion."                                       close $in                                       break                               }                               if {$reqnumber == 0} {                                       putnow "PRIVMSG $adminchans1 :Inicio Listado peticiones"                                       incr reqnumber                               } else {                                       putnow "PRIVMSG $adminchans1 :$reqnumber: $line "                                       #putnow "PRIVMSG $adminchans1 :Fin Listado peticiones"                                       incr reqnumber                                                                                                            }                       }               }       }}</code></pre></div></div></blockquote>this is how you write lista_peticiones.txt<br><div class="codebox"><p>Code: </p><pre><code>       set tempeti [open "lista_peticiones.txt" a]             puts $tempeti "$nick A Solicitado $arg En El Canal $chan"             close $tempeti</code></pre></div><br>what it does when there are requests:<br><ul> <li>@dj : !listapedidos<br>@radio : pepe A Solicitado cuatro pizzas para llevar En El Canal #pruebas<br> @radio : pepe A Solicitado unas hamburguesas con todo En El Canal #pruebas<br>@radio : pepe A Solicitado una lechuga verde En El Canal #pruebas<br>@radio : pepe A Solicitado uno de lomo con todo En El Canal #pruebas<br>@radio : pepe A Solicitado una lechuga amarilla En El Canal #pruebas<br>@radio : pepe A Solicitado una cocacola sin gas En El Canal #pruebas<br>@radio : No hay solicitudes por el momento.</li></ul>when should it be:<br><ul> <li>@dj : !listapedidos<br>@radio : pepe A Solicitado cuatro pizzas para llevar En El Canal #pruebas<br> @radio : pepe A Solicitado unas hamburguesas con todo En El Canal #pruebas<br>@radio : pepe A Solicitado una lechuga verde En El Canal #pruebas<br>@radio : pepe A Solicitado uno de lomo con todo En El Canal #pruebas<br>@radio : pepe A Solicitado una lechuga amarilla En El Canal #pruebas<br>@radio : pepe A Solicitado una cocacola sin gas En El Canal #pruebas<br>@radio : Fin Listado petición.</li></ul>when there is no request list it should be like this:<br><ul> <li>@dj : !listapedidos<br>@radio : No hay solicitudes por el momento.</li></ul>That's what I need the code to do if you can contribute, thank you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Fri Jan 06, 2023 2:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2023-01-06T11:10:13-04:00</updated>

		<published>2023-01-06T11:10:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111593#p111593</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111593#p111593"/>
		<title type="html"><![CDATA[a help for this part of a tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111593#p111593"><![CDATA[
Change your loop:<div class="codebox"><p>Code: </p><pre><code>while {[gets $in line] &gt;= 0} {</code></pre></div>See example @ <a href="https://www.tcl.tk/man/tcl8.4/TclCmd/gets.html" class="postlink">https://www.tcl.tk/man/tcl8.4/TclCmd/gets.html</a><br><br>And if your first line is empty (depend on how your file is done), it's normal.<br><br>Without the complete code, I can't help you further<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Fri Jan 06, 2023 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2023-01-06T09:53:00-04:00</updated>

		<published>2023-01-06T09:53:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111591#p111591</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111591#p111591"/>
		<title type="html"><![CDATA[a help for this part of a tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111591#p111591"><![CDATA[
First of all, congratulations all Happy New Year 2023.<br><br>When users make a musical request, the bot sends it to the dj room and writes it in a txt.<br>When I request the order list<br>It always comes out, whether there are requests or not: No requests at the moment.<br> Any suggestion to fix it?<div class="codebox"><p>Code: </p><pre><code>     bind pub -|- !listapedidos requestlistproc requestlist {nick uhost hand chan arg} {       global adminchans1       if {$chan == $adminchans1} {               set reqnumber 1               set filename "lista_peticiones.txt"               set in [open $filename r]               while {1} {                       set line [gets $in]                       if {$line == ""} {                                                                putnow "PRIVMSG $adminchans1 :No hay solicitudes por el momento."                                                                                      break                              } else {                               if {[eof $in]} {                                       putnow "PRIVMSG $adminchans1 :Fin Listado peticion."                                       close $in                                       break                               }                               if {$reqnumber == 0} {                                       putnow "PRIVMSG $adminchans1 :Inicio Listado peticiones"                                       incr reqnumber                               } else {                                       putnow "PRIVMSG $adminchans1 :$reqnumber: $line "                                       #putnow "PRIVMSG $adminchans1 :Fin Listado peticiones"                                       incr reqnumber                                                                                                            }                       }               }       }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Fri Jan 06, 2023 9:53 am</p><hr />
]]></content>
	</entry>
	</feed>
