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.

Finally traced the timer error

Old posts that have not been replied to for several years.
Locked
A
AW

Finally traced the timer error

Post by AW »

Hi, i was trying to trace the timer error for a long time, finally i got it, proc name, i will appreciate if someone will help me to fix this timer error
its an antisocks tcl.
<Ta> Timer timer338 due in 13 sek., proc: timeout sock12 216.123.73.107 join #testing [ChatBug]

<Ta> [02:44] Tcl error in script for 'timer338':
<Ta> [02:44] invalid command name "ChatBug"


codes:
if {[catch {puts $sock $data}]} {
if {$type == "dcc"} { putdcc [lindex $args 0] "\002NO SOCKS\002: not a socks host $host." }
if {$type == "msg"} { putserv "NOTICE [lindex $args 0] :\002NO SOCKS\002: not a socks host $host."}
if {$type == "pub"} { putserv "PRIVMSG [lindex $args 0] :\002NO SOCKS\002: not a socks host $host." }
if {[info exists timeout($sock)]} { unset timeout($sock) }
catch {close $sock}
}
}

# Scanner.
proc wingate {host type args} {
global timeout
set args [join $args " "]
# Not a valid host.
if {[catch {set sock [socket -async $host 1080]}]} {
if {$type == "dcc"} { putdcc [lindex $args 0] "\002Not Valid\002: Unable to connect to $host." }
if {$type == "msg"} { putserv "NOTICE [lindex $args 0] :\002Not Valid\002: Unable to connect to $host." }
if {$type == "pub"} { putserv "PRIVMSG [lindex $args 0] :\002Not Valid\002: Unable to connect to $host." }
return 0
}
fileevent $sock writable [list gotconnect $sock $host $type $args] ;# wait for connect.
fileevent $sock readable [list gotread $sock $host $type $args] ;#wait for responce.
# Timeout after 15seconds
set timeout($sock) ""
utimer 15 "timeout $sock $host $type $args"
}

# Connection timed out.
proc timeout {sock host type args} {
global timeout
if {[info exists timeout($sock)]} {
unset timeout($sock)
fileevent $sock writable {} ;# remove previous handler
fileevent $sock readable {} ;# remove previous handler
close $sock ;# close the socket
if {$type == "dcc"} { putdcc [lindex $args 0] "\002TIME OUT\002: Timeout on connection to $host." }
if {$type == "msg"} { putserv "NOTICE [lindex $args 0] :\002TIME OUT\002: Timeout on connection to $host." }
if {$type == "pub"} { putserv "PRIVMSG [lindex $args 0] :\002TIME OUT\002: Timeout on connect to $host." }
}
return 0
}

i will really appreciate for your kind help
thank you
AW
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is the fault of the script calling the timer.

If you notice in the debug lines, one of the arguments to the script is [chatbug], and the script is complaining that [chatbug] does not exist.

This is due to the way the timer has been called.

Changing the utimer line to the following should work.

Code: Select all

utimer 15 [list timeout $sock $host $type $args]
Where did you get the debug code from, or is it a modified version of mine? I would appreciate a copy (with credits) for an upcoming eggdrop Tcl toolkit.
A
AW

Post by AW »

Thank you so much, ppslim, it worked.
oh actually i have a small script, which displays the procedure's stuff like when i type timer commands..
Timer timer19536 due in 3 min., proc: cl_timer
since i had seen that, when that userw as join the chn, and saw the timer error in a partyline, so i asked that user if he can part n rejoin the chn, so he did that, and then when i displayed that timer command, it showed there..
u want me to email you?

thanks
regards
AW
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

So your script, rather than only dislpay on an error. It just displays information as a timer is being set, so that should an error occur, it can be looked into easier.
Locked