| View previous topic :: View next topic |
| Author |
Message |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Mon Feb 06, 2006 4:22 pm Post subject: exec in backround/with callback possible? |
|
|
Hey
I want a eggdrop to start a external application. Exec wait`s until the prozess ends and will block anything else. Thats what i want to prevent. Is there a way to start a process and to get a callback after it?
best regards
sKy _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Feb 06, 2006 10:00 pm Post subject: |
|
|
You can use
instead, which is supposed to do the same without waiting like exec does.
A forum search on the topic will result in great information about it. Also, you can take a look at bgexec.tcl by strikelight which does what you want. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Feb 07, 2006 12:02 am Post subject: |
|
|
search for "tail -f" _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Tue Feb 07, 2006 3:48 pm Post subject: |
|
|
My failure, i forgot to add thats about windrop.
exec and open |
will always return an error like:
Tcl error: couldn't create error file for command: no such file or directory
Is it possible to fix that?
EDIT:
BgExec ( http://wiki.tcl.tk/12704 ) won`t work too, cause the mainproc is going to use open | aswell too.
Is there any way to execute something (windrop)? _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Mon Feb 20, 2006 5:55 pm Post subject: |
|
|
anyone? _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Feb 20, 2006 7:44 pm Post subject: |
|
|
You'll need to find the appropriate ported Unix tools to use with Windrop or install cygwin and compile them yourself. The tool(s) are then copied into your Windrop main folder. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Feb 20, 2006 7:50 pm Post subject: |
|
|
what's the Tcl version?
this thing looks pretty ancient to me _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Mon Feb 20, 2006 8:23 pm Post subject: |
|
|
i got it from here
http://windrop.sourceforge.net/downloads.html
before i got Eggdrop v1.6.17 Handlen32 (08.07.2005)
and now i`ve updated to Eggdrop v1.6.18+spelling-errors-suck Handlen32 (25.12.2005)
info tclversion 8.4
info patchlevel 8.4.12
the error still comes up.
it`s not cause i use handlen32 version? (i doub`t that this has anything to do with it)
btw: what means "spelling-errors-suck"? _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Feb 20, 2006 8:52 pm Post subject: |
|
|
check your temp-path and if you have c:\tmp; also check the FAQ at windrop's website
or wait for DeKus, he's our windrop guru; I personally have never used the thing, Windows is desktop OS to me _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Fri Feb 24, 2006 10:36 am Post subject: |
|
|
The temp path is correct (otherwise the bot won`t start).
--
from here: http://wiki.tcl.tk/12704 (is working anyway, eggdrop just doesn`t have the command auto_execok)
| Code: | set redir [expr {[info patchlevel] >= "8.4.7"?{2>@1}:{2>@stdout}}]
if [catch {open "| $prog $redir" r} pH] { |
i wonder that i can open and execute something on that way. but i don`t really understand why. could someone explain what these changes do?
2>@1
2>@stdout _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sat Feb 25, 2006 7:22 am Post subject: |
|
|
you can savely delete them for your script. > changes the default output (stdout) which is usually the console (which you read from with gets/read). example from tclsh console:
| Code: | ~$ tclsh
% open "| uname" r
file3
% read file3
Linux
% close file3
% |
I hope you will understand now better how it works. Don't forget to use fileevent for true asyncronous acces (this above is syncron, too).
So dont forget to save the return value of open, because you will need it to read from . _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Sun Feb 26, 2006 9:54 pm Post subject: |
|
|
Thank you, but i know how open | and exec work. =) My code works already on unix/eggdrop system without problems.
My tests:
- with unix: eggdrop 1.6.17 - working fine
channelid`s like file3
- with unix: tclsh - working fine
channelid`s like file3
- with windows xp: windrop 1.6.17 - Tcl error: couldn't create error file for command: no such file or directory
- with windows xp: 1.6.18cvs - Tcl error: couldn't create error file for command: no such file or directory
- with windows xp: 1.6.16 - working fine
(but this version is outdated, i don`t really want to use it)
the channelid`s are like file107e0560
the incomprehensible was that this (from bgExec):
set redir [expr {[info patchlevel] >= "8.4.7"?{2>@1}:{2>@stdout}}]
if [catch {open "| $prog $redir" r} pH] {
will work with windrop 1.6.17 and 1.6.18cvs [but for read acess mode r only :/].
I think the problem is about the windrop/cygwin/tcl version? Is there another solution then using windrop 1.6.16?
DeKus: May I pm you on irc? _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Feb 27, 2006 12:33 am Post subject: |
|
|
report the bug to windrop dev folks, we can't help you any further _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
|