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 

Bot crashing when getting no response using a TCL script

 
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
cvanmeer
Halfop


Joined: 02 Dec 2003
Posts: 40
Location: The Netherlands

PostPosted: Thu Jan 08, 2004 1:43 pm    Post subject: Bot crashing when getting no response using a TCL script Reply with quote

Hi all,

I have a bit of a problem, I hope you can give me some directions.
I have the following code:

Code:
proc sendstart {nick host hand chan text} {
 global server port
 set s [ socket $server $port]
 puts $s "$text"
 flush $s
 set line [gets $s]
 putquick "PRIVMSG $chan :$line"
}


This will send the input the user gives after !send (ie. !send version) and it would return some info he get's from the server.

But the problem is this. If the other server I connect to is not available, or the service isn't returning anything, my bot times out and crashes. Is there a way to prevent this? I though of using a timer and check after 5 seconds, if there is no result, return with "Problem with service"

But I don't know how to do this
Anyone got some suggestions?

Thankx,

Chrizz
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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