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.

invalid idx

Old posts that have not been replied to for several years.
Locked
t
tami
Voice
Posts: 13
Joined: Tue Feb 05, 2002 8:00 pm

invalid idx

Post by tami »

another one for the night

i have this tcl script..

control $idx incoming
}
proc incoming {idx args} {
if {[join $args] != "" } {
putserv "PRIVMSG #channel :$args"
}
killdcc $idx

why would i get this error? (below)
Tcl error [incoming]: invalid idx

what's an idx? why is it invalid?

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

Post by ppslim »

An IDX is the name given, to the ID number of a connection, but it a bot, user, connection to a script, IRC server.

The script have pasted seems very happy with close brackets, which seem errornouse in there own right.

You would need to paste more of the script, to understand exactly where the error is,
t
tami
Voice
Posts: 13
Joined: Tue Feb 05, 2002 8:00 pm

Post by tami »

that's the whole script besides a line that listens for connections on a specific port (see other post)

it works with a php script. i'll have to figure them out together, i guess...
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

tami wrote:that's the whole script besides a line that listens for connections on a specific port (see other post)

it works with a php script. i'll have to figure them out together, i guess...
Most likely the error is generated because the client closes the connection immediately before sending any character.
If the connection is closed by the client without sending any character, the "killdcc $idx" will fail because the idx has already been removed.

The eggdrop system sends an empty line to the tcl proc to indicate that the client did terminate the connection. Your proc should test for that.
And yes, I know it is a bit silly that eggdrop sends an empty line to indicate an end of connection. In my opinion eggdrop should send empty lines "as is" to the tcl proc. And use some special string like "***EOC***" to indicate an end of connection.
Read more on this issue:
http://forum.egghelp.org/viewtopic.php?t=1094

A sample of a listen control proc is:
http://members.fortunecity.com/eggheadt ... en.tcl.txt
If fortunecity denies direct viewing of the file, go to
http://members.fortunecity.com/eggheadtcl
and then choose demo-listen.tcl.txt
Locked