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.

Ban type problems! + Probs with tcl

Old posts that have not been replied to for several years.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

RTFEM

Post by user »

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"?
g
guest
Halfop
Posts: 52
Joined: Mon Jan 19, 2004 4:15 pm

Post by guest »

doesn't it?
i just called it like that
if {([matchattr $hand m|m $chan]) || ([matchattr $hand o|o $chan])} {
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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.
==================================
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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.
==================================
g
guest
Halfop
Posts: 52
Joined: Mon Jan 19, 2004 4:15 pm

Post by guest »

:roll: now the syntax is all right but script does nothing... :cry:

while in telnet i see this error
Tcl˙error˙[pub:kick:ban]:˙wrong˙#˙args:˙no˙script˙following˙"{([matchattr˙$hand˙m"˙argument
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

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:

Code: Select all

.tcl info args pub:kick:ban
g
guest
Halfop
Posts: 52
Joined: Mon Jan 19, 2004 4:15 pm

Post by guest »

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

Code: Select all

 .tcl info args pub:kick:ban 
in telnet i get this answer
Tcl:˙nick˙uhost˙hand˙chan˙text
so what does it mean .... :roll:
g
guest
Halfop
Posts: 52
Joined: Mon Jan 19, 2004 4:15 pm

Post by guest »

no suggestions? :cry:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Try:

Code: Select all

.tcl set errorInfo
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.
==================================
g
guest
Halfop
Posts: 52
Joined: Mon Jan 19, 2004 4:15 pm

Post by guest »

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 8)
Tcl: invoked from within
Tcl: "pub:kick:ban $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

What eggdrop version are you using?? and what tcl version is your machine on?! :roll:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

awyeah wrote:What eggdrop version are you using?? and what tcl version is your machine on?! :roll:
What's that got to do with the misplaced brace? :roll: (notice: no "{" at the end of that if-line)
Have you ever read "The Manual"?
g
guest
Halfop
Posts: 52
Joined: Mon Jan 19, 2004 4:15 pm

Post by guest »

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
Locked