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

	<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>2003-11-19T14:36:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Pitchat]]></name></author>
		<updated>2003-11-19T14:36:14-04:00</updated>

		<published>2003-11-19T14:36:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30341#p30341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30341#p30341"/>
		<title type="html"><![CDATA[exec alternative]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30341#p30341"><![CDATA[
heres the result with your code <br><br>[13:29] (Pitchat): .cours list<br>[13:29] (Espion): Cours files<br>[13:29] (Espion): end<br><br>the directory his /scripts/cours and there is 3 files already in there<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2723">Pitchat</a> — Wed Nov 19, 2003 2:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-19T13:53:54-04:00</updated>

		<published>2003-11-19T13:53:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30339#p30339</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30339#p30339"/>
		<title type="html"><![CDATA[exec alternative]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30339#p30339"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc cours:list {hand idx arg} { global cours putdcc $idx "Cours files" foreach liste [glob -nocomplain -dir $cours(path) *.cours] { putdcc $idx  [file join $cours(path) *.cours]} putdcc $idx "end" }</code></pre></div></div></blockquote>...if that's what your code looks like, no wonder (the extra line breaks before the body of the foreach <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">) This is what I meant:<div class="codebox"><p>Code: </p><pre><code>proc cours:list {hand idx arg} {   global cours  putdcc $idx "Cours files"  foreach liste [glob -nocomplain [file join $cours(path) *.cours]] {    putdcc $idx "[file tail [file rootname $liste]]"  }  putdcc $idx "end"}</code></pre></div>If it still doesn't work, check your path and working directory. Giving an absolute path would be best, as the working directory won't matter then.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Nov 19, 2003 1:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pitchat]]></name></author>
		<updated>2003-11-19T13:14:51-04:00</updated>

		<published>2003-11-19T13:14:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30336#p30336</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30336#p30336"/>
		<title type="html"><![CDATA[exec alternative]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30336#p30336"><![CDATA[
still doesnt work in this form <div class="codebox"><p>Code: </p><pre><code>set cours(path) "scripts/cours/"set cours(chan) "#pitchat"bind dcc o cours dcc:coursproc dcc:cours {hand idx arg} {  if {[info proc cours:[lindex $arg 0] ] == ""} {    putdcc $idx "###Syntaxe: .cours &lt;go|stop|list&gt; &lt;arg&gt;"    return 0    } {    cours:[lindex $arg 0] $hand $idx $arg  }}proc cours:go {hand idx arg} {  global line cours botnick  if {![file exists "$cours(path)/[lindex $arg 1].cours"]} {    cours:list $hand $idx $arg    return 0  }  set coursfile [open "$cours(path)/[lindex $arg 1].cours" r]  set cours(totline) 0  while {![eof $coursfile]} {    set cours(totline) [expr $cours(totline) +1]    set line($cours(totline)) [gets $coursfile]  }  putdcc $idx "Loaded ($cours(totline) lines)"  setuser $botnick xtra COUR "actif"  set cours(nb) "1"  cours:disp  close $coursfile}proc cours:disp {} {  global timer line cours   if {$cours(nb) &lt; $cours(totline)} {    putserv "PRIVMSG $cours(chan) :$line($cours(nb))"    set cours(nb) [expr $cours(nb)+1]    set tmp "cours:disp"    set timer [utimer 30 $tmp]    } {    putserv "PRIVMSG $cours(chan) :End"  }}proc cours:stop {hand idx arg} {  global timer cours  if {[info exists timer]} {    killutimer $timer     putdcc $idx "Oki"    putserv "NOTICE $cours(chan) :CLASS STOPPED BY $hand"  }}proc cours:list {hand idx arg} { global cours putdcc $idx "Cours files" foreach liste [glob -nocomplain -dir $cours(path) *.cours] { putdcc $idx  [file join $cours(path) *.cours]} putdcc $idx "end" }</code></pre></div>i really dont know where to look now<br><br>thanks for your efforts<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2723">Pitchat</a> — Wed Nov 19, 2003 1:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-19T08:05:11-04:00</updated>

		<published>2003-11-19T08:05:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30313#p30313</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30313#p30313"/>
		<title type="html"><![CDATA[exec alternative]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30313#p30313"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc cours:list {hand idx arg} {  global cours  putdcc $idx "Cours files"  foreach liste [glob -nocomplain -dir $cours(path) *.cours] {    putdcc $idx [file tail [file rootname $liste]]  }  putdcc $idx "end"}</code></pre></div>If -dir doesn't work, use [file join $cours(path) *.cours] instead<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Nov 19, 2003 8:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pitchat]]></name></author>
		<updated>2003-11-19T07:09:42-04:00</updated>

		<published>2003-11-19T07:09:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30310#p30310</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30310#p30310"/>
		<title type="html"><![CDATA[exec alternative]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30310#p30310"><![CDATA[
i have replace the exec ls thing with glob but instead of en error a have this <div class="codebox"><p>Code: </p><pre><code>[04:12] (Pitchat): .cours list[04:12] (Espion): Cours files[04:12] (Espion): end</code></pre></div>and it doesnt lisdt the files in the directory ( /scripts/cours )<br><br>i read the glob page but i do not figure how to apply this in my script since i am quite new at tcl <br><div class="codebox"><p>Code: </p><pre><code>proc cours:list {hand idx arg} {  global cours  putdcc $idx "Cours files"  foreach liste [glob $cours(path)] {    if {[string match "*.cours" $liste]} {      putdcc $idx "[lindex [split $liste .] 0]"    }  }  putdcc $idx "end"}</code></pre></div>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2723">Pitchat</a> — Wed Nov 19, 2003 7:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-19T04:25:19-04:00</updated>

		<published>2003-11-19T04:25:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30302#p30302</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30302#p30302"/>
		<title type="html"><![CDATA[exec alternative]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30302#p30302"><![CDATA[
use <a href="http://tcl.tk/man/tcl8.4/TclCmd/glob.htm" class="postlink">glob</a> instead of 'exec ls'<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Nov 19, 2003 4:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pitchat]]></name></author>
		<updated>2003-11-18T23:27:38-04:00</updated>

		<published>2003-11-18T23:27:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30291#p30291</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30291#p30291"/>
		<title type="html"><![CDATA[exec alternative]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30291#p30291"><![CDATA[
Hi again !<br><br>i use a little scripts that is some sort of "skool.tcl" scripts but it was made for linux eggdrop and i have an error wich is cause by the " exec" commands , i isolate the proc responsible and i`d like to know how can i do the same thing without using the exec command ( you must have guessed , i`m on windows ! ) <br><br><br>heres the error <br><br>[22:10] (Espion): [22:10] Tcl error [dcc:cours]: couldn't execute "ls": no such file or directory<br><br>thanks <br><br>Pitchat<div class="codebox"><p>Code: </p><pre><code>set cours(path) "scripts/cours"set cours(chan) "#pitchat"bind dcc o cours dcc:coursproc dcc:cours {hand idx arg} {  if {[info proc cours:[lindex $arg 0] ] == ""} {    putdcc $idx "###Syntaxe: .cours &lt;go|stop|list&gt; &lt;arg&gt;"    return 0    } {    cours:[lindex $arg 0] $hand $idx $arg  }}proc cours:go {hand idx arg} {  global line cours botnick  if {![file exists "$cours(path)/[lindex $arg 1].cours"]} {    cours:list $hand $idx $arg    return 0  }  set coursfile [open "$cours(path)/[lindex $arg 1].cours" r]  set cours(totline) 0  while {![eof $coursfile]} {    set cours(totline) [expr $cours(totline) +1]    set line($cours(totline)) [gets $coursfile]  }  putdcc $idx "Loaded ($cours(totline) lines)"  setuser $botnick xtra COUR "actif"  set cours(nb) "1"  cours:disp  close $coursfile}proc cours:disp {} {  global timer line cours   if {$cours(nb) &lt; $cours(totline)} {    putserv "PRIVMSG $cours(chan) :$line($cours(nb))"    set cours(nb) [expr $cours(nb)+1]    set tmp "cours:disp"    set timer [utimer 30 $tmp]    } {    putserv "PRIVMSG $cours(chan) :End"  }}proc cours:stop {hand idx arg} {  global timer cours  if {[info exists timer]} {    killutimer $timer     putdcc $idx "Oki"    putserv "NOTICE $cours(chan) :CLASS STOPPED BY $hand"  }}proc cours:list {hand idx arg} {  global cours  putdcc $idx "Cours files"  foreach liste [exec ls $cours(path)] {    if {[string match "*.cours" $liste]} {      putdcc $idx "[lindex [split $liste .] 0]"    }  }  putdcc $idx "end"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2723">Pitchat</a> — Tue Nov 18, 2003 11:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
