View previous topic :: View next topic |
Author |
Message |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Sun Oct 02, 2005 5:42 pm Post subject: The bot is freezing...why? |
|
|
Hi, somebody knows, why the bot is freezing
Code: |
set ochan "#opers"
bind pub - !startservices startservices_msg
proc startservices_msg {nick uhost hand chan arg} {
if {$::ochan != $chan} {return 0}
exec /var/www/IRC/HUB/services/services
exec /var/www/IRC/NeoStats/neostats
exec /var/www/IRC/Eggdrop/eggdrop
return 1
} |
greets tessa |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Oct 02, 2005 5:59 pm Post subject: |
|
|
Try using [open] instead of exec. Example:
Code: | set bla [open "|/var/www/IRC/HUB/services/services"]
close $bla |
_________________ 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: Sun Oct 02, 2005 6:01 pm Post subject: |
|
|
because of your unresponsive (or maybe interactive, waiting input) external apps you spawn with [exec], which waits for them to finish _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
Back to top |
|
 |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Sun Oct 02, 2005 6:14 pm Post subject: |
|
|
Something like this?
Code: |
set ochan "#opers"
bind pub - !startservices startservices_msg
proc startservices_msg {nick uhost hand chan arg} {
if {$::ochan != $chan} {return 0}
set bla [open "|/var/www/IRC/HUB/services/services"]
close $bla
set blo [open "|/var/www/IRC/NeoStats/neostats"]
close $blo
set blu [open "|/var/www/IRC/Eggdrop/eggdrop"]
close $blu
return 1
} |
|
|
Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Oct 02, 2005 6:18 pm Post subject: |
|
|
possibly like it, but not quite; you need asynchronous I/O
search forum 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 |
|
 |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Sun Oct 02, 2005 6:31 pm Post subject: |
|
|
 |
|
Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Oct 02, 2005 6:41 pm Post subject: |
|
|
instead of making faces, do the search and try to understand what you find (go to tcl.tk and read about [fconfigure] and [fileevent]) _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
Back to top |
|
 |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Sun Oct 02, 2005 6:51 pm Post subject: |
|
|
ok...i think i should learn...learn...learn  |
|
Back to top |
|
 |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Sun Oct 02, 2005 7:02 pm Post subject: |
|
|
Do you mean this?
Code: |
bind pub - !startservices startservices_msg
proc startservices_msg {nick uhost hand chan arg} {
if {$::ochan != $chan} {return 0}
set fc [open "|tail -f /var/www/IRC/HUB/services/services"]
fconfigure $fc -blocking 0
fileevent $fc readable {putserv "privmsg $::ochan :[load $fc]"}
}
return 1
} |
|
|
Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Oct 02, 2005 7:36 pm Post subject: |
|
|
nope, that tail has nothing to do with your stuff, don't take things literally; also, it's not [load], it's [read] _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Oct 02, 2005 7:54 pm Post subject: |
|
|
pity, you were on the right track _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
Back to top |
|
 |
|