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.

Help me with error in tcl

Old posts that have not been replied to for several years.
j
jones
Voice
Posts: 33
Joined: Fri Jun 25, 2004 12:36 am

Help me with error in tcl

Post by jones »

I need help with this error in my tcl:

[14:42] Tcl error [dcc_chinfo]: invalid command name "setxtra"

*** I run compat.tcl in my eggdrop:
# $Id: compat.tcl,v 1.10 2003/02/04 10:21:03 wcc Exp $

in compat.tcl i found this: # setxtra is no longer relevant

somebody can help what i put in my compat.tcl about 'setxtra' to compatible with my tcl ?

Thanks
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

This should work:

Code: Select all

proc setxtra { handle type data } {
  setuser $handle XTRA $type $data
} ;# setxtra
Que?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Correct me if I'm wrong, but didnt good old 'setxtra' just wipe all the xtra info and then write the new one, like 'setxtra handle xtra'.
j
jones
Voice
Posts: 33
Joined: Fri Jun 25, 2004 12:36 am

Post by jones »

I put this code:
i have this error now:

[18:39] Tcl error [dcc_chinfo]: wrong # args: should be "setxtra handle type data"
KrzychuG wrote:This should work:

Code: Select all

proc setxtra { handle type data } {
  setuser $handle XTRA $type $data
} ;# setxtra
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Could you paste that scipt or give a link to it?
Que?
j
jones
Voice
Posts: 33
Joined: Fri Jun 25, 2004 12:36 am

Post by jones »

yes proc dcc_chinfo:

proc dcc_chinfo {handle idx rest} {
global modify imed time
set rest [filtstr $rest]
set tipos "nome nick origem entrada fotourl email"
if {[llength $rest]<=2} {
putdcc $idx "2Erro de sintaxe. Formato:12 .chinfo <handle> <type> <arg>"
putdcc $idx "2Os tipos disponíveis são: [c_virgula_e [virgula_e $tipos] 12 2]2."
return
}
set user [lindex $rest 0]
if {[isinvalid $user $idx]} {return}
set type [string tolower [lindex $rest 1]]
set arg [newlrange $rest 2 end]
set found 0
foreach campo [string tolower $tipos] {
if {$campo==$type} {set found 1; break}
}
if {$found==0} {
putdcc $idx "2Campo inválido. Sao campos válidos: [c_virgula_e [virgula_e $tipos] 12 2]"
return
}
if {$type=="origem"} {
set arg [lindex [filtstr $arg] 0]
}
user-set $user $type $arg
if {$imed(makememberspage)} {
set construcao "Atualizando modificação na página ..."
} else {
set construcao "Página sendo atualizada em12 $time(makevotepages) 2minutos!"
}
putdcc $idx "2Informado setada. $construcao"
putcmdlog "#$handle# chinfo $user $type ..."
set modify(members) 1
if {$imed(makememberspage)} {checar_paginas}
}

Thanks!
KrzychuG wrote:Could you paste that scipt or give a link to it?
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

I don't see setxtra in that code :(
user-set $user $type $arg looks like old compat command ;)
Que?
j
jones
Voice
Posts: 33
Joined: Fri Jun 25, 2004 12:36 am

Post by jones »

sorry!
i´m error to copy here the code of setxtra!

The code with problem is:
This code stay in toolkit.tcl

proc user-set {handle key data} {
set xtra [getxtra $handle]
# is key already there?
for {set i 0} {$i < [llength $xtra]} {incr i} {
set this [lindex $xtra $i]
if {[string compare [lindex $this 0] $key] == 0} {
set this [list $key $data]
setxtra $handle [lreplace $xtra $i $i $this]
return
}
}
lappend xtra [list $key $data]
setxtra $handle $xtra
}

Thanks
KrzychuG wrote:I don't see setxtra in that code :(
user-set $user $type $arg looks like old compat command ;)
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

proc user-set {hand type arg} {
  setuser $hand XTRA $type $arg
}
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Code: Select all

proc setxtra { handle data } {
  set type [lindex $data 0]
  set data [lrange $data 1 end]
  setuser $handle XTRA $type $data 
} ;# setxtra
Que?
j
jones
Voice
Posts: 33
Joined: Fri Jun 25, 2004 12:36 am

Post by jones »

This code is ok! i don´t have more error in my tcl!

but the command that i use with this code not have effect!
I think to see the tcl in geral, but is a little complex because this tcl run with more some tcl and make html file.
*and i realy need show you the html file make online for tcl and the command on bot in the same time and show the problem!
for you understand me.
you can help-me go to the my server and see the eggdrop run? and i send the tcls for you?
give-me your UIN icq or MSN or email
to i go contact you to combine the time!
my email is: jr@viasky.com.br

I am despaired with this!!!
Thanks!
KrzychuG wrote:

Code: Select all

proc setxtra { handle data } {
  set type [lindex $data 0]
  set data [lrange $data 1 end]
  setuser $handle XTRA $type $data 
} ;# setxtra
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

That setxtra proc wont work, replace your user-set code with the one I posted.
j
jones
Voice
Posts: 33
Joined: Fri Jun 25, 2004 12:36 am

Post by jones »

but my user-set alredy just it:

proc user-set {n c t} {
setuser $n xtra $c $t
}
gb wrote:That setxtra proc wont work, replace your user-set code with the one I posted.
j
jones
Voice
Posts: 33
Joined: Fri Jun 25, 2004 12:36 am

Post by jones »

but my user-set just alredy it:

proc user-set {n c t} {
setuser $n xtra $c $t
}

gb wrote:

Code: Select all

proc user-set {hand type arg} {
  setuser $hand XTRA $type $arg
}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

there is one argument to much in that one...
actually in all of the ones listed in this thread :wink:
try this one:

Code: Select all

proc user-set {hand type arg} { 
  setuser $hand $type $arg 
}
Elen sila lúmenn' omentielvo
Locked