This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

The bot is freezing...why?

Old posts that have not been replied to for several years.
Locked
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

The bot is freezing...why?

Post by tessa1 »

Hi, somebody knows, why the bot is freezing

Code: Select all

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
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try using [open] instead of exec. Example:

Code: Select all

set bla [open "|/var/www/IRC/HUB/services/services"]
close $bla
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

Something like this?

Code: Select all

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
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

:?: :oops:
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

ok...i think i should learn...learn...learn :)
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

Do you mean this?

Code: Select all

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
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

pity, you were on the right track
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Locked