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.

[SOLVED] Tcl error : wrong # args

Help for those learning Tcl or writing their own scripts.
Post Reply
S
Seka
Voice
Posts: 18
Joined: Tue Apr 19, 2011 10:21 pm

[SOLVED] Tcl error : wrong # args

Post by Seka »

I am receiving the following error with most of my commands in this particular script. I'm not sure what the issue is. Any help is appreciated.

Code: Select all

Tcl error [pub_wine]: wrong # args: should be "pub_wine nick uhost hand channel"
Here is the actual proc:

Code: Select all

proc pub_wine {nick uhost hand channel} {
  global botnick
    putserv "PRIVMSG $channel :\001ACTION takes down an elegant glass from the rack above the bar and pours $nick a healthy amount of Vintish red.\001"
    return 0
}
bind pub - !wine pub_wine
Thanks in advance!
Last edited by Seka on Wed Apr 20, 2011 1:31 pm, edited 1 time in total.
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Re: Tcl error : wrong # args

Post by willyw »

Reference:
http://www.eggheads.org/support/egghtml ... mands.html
and see:
PUB

bind pub <flags> <command> <proc>
procname <nick> <user@host> <handle> <channel> <text>
In your script, the bind is a bind pub.
The corresponding proc needs to accept five variables passed to it.
Yours has only four:

Code: Select all

proc pub_wine {nick uhost hand channel} {
Make it:

Code: Select all

proc pub_wine {nick uhost hand channel text}  {
I hope this helps.
S
Seka
Voice
Posts: 18
Joined: Tue Apr 19, 2011 10:21 pm

Post by Seka »

That did it!

Thanks so much for your help. Looks like everything is working fine, now.
Post Reply