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.

wrong # args - confused

Help for those learning Tcl or writing their own scripts.
Post Reply
i
iNFERiON
Voice
Posts: 7
Joined: Sat Nov 13, 2004 4:23 pm

wrong # args - confused

Post by iNFERiON »

Hello all,

I am writing a TCL script for my WoW guild channel that would enable users to add their WoW characters to a database. I have this as script to add characters:

Code: Select all

proc cu_addchar {nick host handle chan text} {
	set charname [lindex $text 0]
	set race [lindex $text 1]
	set class [lindex $text 2]
	set level [lindex $text 3]
	putmsg $nick "Adding \002$charname\002 (Level $level $race $class) to the database."
	set wowdb [open wowchars.db a+]
	puts $wowdb $charname $race $class $level
	close $wowdb
	putmsg $cuchan "$nick has added a new character, $charname (Level $level $race $class) to the database."
}
when I use the bind to trigger this process, the bot's console spits out this message:

Code: Select all

[02:16] Tcl error [cu_addchar]: wrong # args: should be "cu_addchar nick host handle chan text"
Which I do not understand, I have all those args in the proc header already :?

Code: Select all

proc cu_addchar {nick host handle chan text} {
It's all there right ? What am I doing wrong here ?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

.set errorInfo tells you exactly where the error occurs. I assume that the proc is being called with not enough attributes.
Post Reply