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

	<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-04-09T06:55:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-09T06:55:46-04:00</updated>

		<published>2003-04-09T06:55:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18770#p18770</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18770#p18770"/>
		<title type="html"><![CDATA[killing an exec process]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18770#p18770"><![CDATA[
wow, that script does really what i want. thanks a lot for your time. since i am a newbie with tcl i needed some time to understand and extend the script but it works now. thx :)<p>Statistics: Posted by Guest — Wed Apr 09, 2003 6:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-04-08T15:11:43-04:00</updated>

		<published>2003-04-08T15:11:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18742#p18742</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18742#p18742"/>
		<title type="html"><![CDATA[killing an exec process]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18742#p18742"><![CDATA[
Again, using the open command, this can be done.<br><br>As it had proved, no blocking takes place  (otherwise the while loop wouldn't even work).<br><br>This would be a three part script.<br><br>1: Launcher: This will start the program, store the file ponter in a global variable and start a timer.<br><br>2: A checker: Will run on a timer, and check the process every so often, as to automaticaly clear it up, rather than only have it done manualy.<br><br>3: Manual kill: To manualy kill the program.<br><br>IE.<br><div class="codebox"><p>Code: </p><pre><code>set ourargs(on) 0set ourargs(fp) 0bind pub - "start" pub:startproc pub:start {nick uh hand chan arg} {  global ourargs  if {$ourargs(on)} {    #Allready running, return    return  }  set ourargs(fp) [open "|/path/to/prog"]  set ourargs(on) 1  utimer 5 [list ourcheck]  #list not needed in the case, but it's a habit, and a good one for safety}proc ourcheck {} {  global ourargs  if {$ourargs(on)} {    if {[eof $ourargs(fp)]} {      close $ourargs(fp)      set ourargs(on) 0    }    utimer 5 ourcheck  }}bind pub - "stop" pub:stopproc pub:stop {nick uh hand chan arg} {  global ourargs  if {!$ourargs(on)} {    #No running, don't bother    return  }  close $ourargs(fp)  set ourargs(on) 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Apr 08, 2003 3:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-08T14:26:54-04:00</updated>

		<published>2003-04-08T14:26:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18737#p18737</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18737#p18737"/>
		<title type="html"><![CDATA[killing an exec process]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18737#p18737"><![CDATA[
hehe, thx for doublechecking  :D <br><br>but on second thought, this solution is not ideal for the problem because the running time of the prog varies a lot, it depends heavily on the input params.<br>i really need a !trigger which kills the process instantly, whenever wanted. so i guess i dont get around the 2 scripts or even 2 bots since no procedure can be called as a long as the procedure that called the process didnt return, right?<p>Statistics: Posted by Guest — Tue Apr 08, 2003 2:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-04-08T09:05:21-04:00</updated>

		<published>2003-04-08T09:05:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18724#p18724</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18724#p18724"/>
		<title type="html"><![CDATA[killing an exec process]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18724#p18724"><![CDATA[
My bad, along with the "incr" counter, you will also need to use the "gets" command.<br><br>Without it, EOF will never be read, thus will never be reported.<br><br>A simple<br><div class="codebox"><p>Code: </p><pre><code>set null [gets $fp]</code></pre></div>Will do.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Apr 08, 2003 9:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-08T09:02:00-04:00</updated>

		<published>2003-04-08T09:02:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18721#p18721</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18721#p18721"/>
		<title type="html"><![CDATA[killing an exec process]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18721#p18721"><![CDATA[
this looks like a good solution,  im trying to implement it.<br>thanks a lot for your help :)<p>Statistics: Posted by Guest — Tue Apr 08, 2003 9:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-04-07T14:02:12-04:00</updated>

		<published>2003-04-07T14:02:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18681#p18681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18681#p18681"/>
		<title type="html"><![CDATA[killing an exec process]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18681#p18681"><![CDATA[
The exec command is just one way of doing things. You can also run applications using the "open" command, and using a pipe as the first character.<br><br>This way, you can create a loop, that will continue until you feel the program has completed, or you wish to kill it.<br><br>EG<br><div class="codebox"><p>Code: </p><pre><code>set fp [open "|/path/to/my/cpp/application" r]set i 0while {($i &lt; 1000) &amp;&amp; (![eof $fp])} {  incr $i}if {[eof $fp]} {  close $fp  # Application finished normaly} else {  # Need to send a kill signal, then close the file pointer.}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Apr 07, 2003 2:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-07T13:34:01-04:00</updated>

		<published>2003-04-07T13:34:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18680#p18680</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18680#p18680"/>
		<title type="html"><![CDATA[killing an exec process]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18680#p18680"><![CDATA[
hi all,<br>i have a eggdrop tcl script which calls an external c++ program with the help of the exec command. the problem is that the prog is not too stable and sometimes needs to be killed and restarted. but i think that the procedure which invoked the process returns only after the c++ program returns and therefore i cant call another procedure in the same script that could kill the process, because it waits until the proc that called the c++ prog returns.<br> <br>so is it possible to load 2 scripts on the same bot, one that executes the program and the other one with the ability to kill the process? or do i need 2 bots one for executing and one for killing? or is it much more simple if you know eggdrop and tcl better than me? ;P<br>any help is appreciated, thx :)<br><br>-focco<p>Statistics: Posted by Guest — Mon Apr 07, 2003 1:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
