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.

What's Wrong ?

Old posts that have not been replied to for several years.
Locked
l
laidas
Voice
Posts: 18
Joined: Thu Jul 25, 2002 10:07 am

What's Wrong ?

Post by laidas »

tcl:

Code: Select all

bind pub - hello pub:op
proc pub:op {nick uhost hand args} {
    set chan [string tolower $chan]
    putserv "PRIVMSG chanserv :op $chan $nick"
}
when I Type In Channel "hello" (without "" :wink: ) In telnet it responds:
Tcl error [pub:op]: can't read "chan": no such variable
What's wrong ?
l
laidas
Voice
Posts: 18
Joined: Thu Jul 25, 2002 10:07 am

:))

Post by laidas »

oh sorry I saw where's a problem.... :D:

Code: Select all

proc pub:op {nick uhost hand args [u]chan[/u]} {
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You will find this also fails.

There are two specific reasons for this.

First. Eggdrop sends information to a PUB class bind, using "nick uhost hand chan arg". It is not based on the order you place the names in this list, these are only the names you wish to refer to them as in your script, and eggdrop will allways send the data in the same order regardless.

Second. the variable name "args" has a special meaning in Tcl, and is used in a way, that you can take unlimited arguments to a proc, without error, so you can use variable length argument lists.
Locked