egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The bot is freezing...why?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Sun Oct 02, 2005 5:42 pm    Post subject: The bot is freezing...why? Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Oct 02, 2005 5:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Oct 02, 2005 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Sun Oct 02, 2005 6:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Oct 02, 2005 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Sun Oct 02, 2005 6:31 pm    Post subject: Reply with quote

Question Embarassed
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Oct 02, 2005 6:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Sun Oct 02, 2005 6:51 pm    Post subject: Reply with quote

ok...i think i should learn...learn...learn Smile
Back to top
View user's profile Send private message
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Sun Oct 02, 2005 7:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Oct 02, 2005 7:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Oct 02, 2005 7:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber