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.

Bot crashing when getting no response using a TCL script

Old posts that have not been replied to for several years.
Locked
c
cvanmeer
Halfop
Posts: 40
Joined: Tue Dec 02, 2003 1:00 pm
Location: The Netherlands
Contact:

Bot crashing when getting no response using a TCL script

Post by cvanmeer »

Hi all,

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

Code: Select all

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
Locked