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.
Old posts that have not been replied to for several years.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Thu Aug 26, 2004 2:26 pm
guest wrote: [20:58] can't read "hand": no such variable
while executing
"matchattr $hand m|m $chan"
(file "scripts/chancmd.tcl" line 1 )
Does that look like line 1 of any script you got from this thread?
Have you ever read "The Manual"?
guest
Halfop
Posts: 52 Joined: Mon Jan 19, 2004 4:15 pm
Post
by guest » Thu Aug 26, 2004 3:01 pm
doesn't it?
i just called it like that
if {([matchattr $hand m|m $chan]) || ([matchattr $hand o|o $chan])} {
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Thu Aug 26, 2004 8:39 pm
There is nothing wrong with the script works fine with my bot. The hand variable is defined locally within the script. I think its calling it global somewhere if I am not mistaken. It says line 1 in the script, whats in line 1 of this script?
What eggdrop version are you using? Is the script possibly clashing with others? Try: Moving it to the top of the script list in the .conf file so it is the first tcl to be loaded into the bot.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Thu Aug 26, 2004 8:45 pm
Ok....grrr yes now I know it was calling $hand globally, as I had closed the procedure mistakenly with the rest of it being global. Damn I did a fumble with the curly brackets again, am so careless with syntax errors. Ok give this a go.
*me* keeps his fingers crossed!
Code: Select all
bind pub B|B ban pub:kick:ban
proc pub:kick:ban {nick uhost hand chan text} {
set person [lindex $text 0]; set reason [lrange $text 1 end]
set host [getchanhost $person]; set handle [nick2hand $person $chan]
if {($text == "")} { putserv "NOTICE $nick :Vartojimas: cya <nikas> (priezhastis)"; return 0 }
if {($host == "")} { putserv "NOTICE $nick :Ko norejai?"; return 0 }
if {([matchattr $handle mn|mn $chan]) || ([matchattr $handle b|b $chan])} {
putquick "NOTICE $nick :suka zhiurek ka darai!" -next; return 0 }
if {([matchattr $hand m|m $chan]) || ([matchattr $hand o|o $chan])} {
putquick "MODE $nick -o+b $person *!*[string trimleft [lindex [split $host "@"] 0] "~"]@[lindex [split [maskhost $host] "@"] 1]" -next
putquick "KICK $chan $person :$reason" -next; return 0
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
guest
Halfop
Posts: 52 Joined: Mon Jan 19, 2004 4:15 pm
Post
by guest » Mon Aug 30, 2004 3:59 am
now the syntax is all right but script does nothing...
while in telnet i see this error
Tcl˙error˙[pub:kick:ban]:˙wrong˙#˙args:˙no˙script˙following˙"{([matchattr˙$hand˙m"˙argument
YooHoo
Owner
Posts: 939 Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast
Post
by YooHoo » Mon Aug 30, 2004 6:17 am
Tcl has a command '
info body <proc> ' that will list the contents of a proc. '
info args <proc> ' shows what you have defined as the parameters for the proc.
Since your error is 'args' related, try to use this command in dcc to figure out what went wrong. Example:
guest
Halfop
Posts: 52 Joined: Mon Jan 19, 2004 4:15 pm
Post
by guest » Mon Aug 30, 2004 2:13 pm
when i write in chan like ban <nick>
i get this error in my telnet
[21:03]˙Tcl˙error˙[pub:kick:ban]:˙wrong˙#˙args:˙no˙script˙following˙"{([matchattr˙$hand˙m"˙argument
when i write
in telnet i get this answer
Tcl:˙nick˙uhost˙hand˙chan˙text
so what does it mean ....
guest
Halfop
Posts: 52 Joined: Mon Jan 19, 2004 4:15 pm
Post
by guest » Tue Aug 31, 2004 5:09 am
no suggestions?
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Tue Aug 31, 2004 8:13 am
Try:
In DCC with the bot, then show us the result.
The the code you are trying to work on is fairly simple and really looks allright to me.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
guest
Halfop
Posts: 52 Joined: Mon Jan 19, 2004 4:15 pm
Post
by guest » Wed Sep 01, 2004 5:21 am
after " .tcl set errorInfo " i get
Tcl:wrong # args: no script following "{([matchattr $hand m" argument
Tcl: while compiling
Tcl: "if {([matchattr $hand m|m $chan]) || matchattr $hand o|o $chan])}"
Tcl: (compiling body of proc "pub:kick:ban", line
Tcl: invoked from within
Tcl: "pub:kick:ban $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Wed Sep 01, 2004 5:38 am
What eggdrop version are you using?? and what tcl version is your machine on?!
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Sep 01, 2004 6:17 am
awyeah wrote: What eggdrop version are you using?? and what tcl version is your machine on?!
What's that got to do with the misplaced brace?
(notice: no "{" at the end of that if-line)
Have you ever read "The Manual"?
guest
Halfop
Posts: 52 Joined: Mon Jan 19, 2004 4:15 pm
Post
by guest » Wed Sep 01, 2004 6:49 am
i'm using :
OS:˙Linux˙2.4.26-gentoo-r9
running˙eggdrop˙v1.6.16+Gentoo
Tcl˙library:˙/usr/lib/tcl8.3
Tcl˙version:˙8.3.4˙(header˙version˙8.3.4)
ok i put { at the end and now it seems to work but not right
it just kicks a user not bans