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.

"invalid command name "sumuser"" why?

Old posts that have not been replied to for several years.
Locked
M
MrAnderson
Voice
Posts: 9
Joined: Tue Aug 24, 2004 9:34 am
Location: Portugal

"invalid command name "sumuser"" why?

Post by MrAnderson »

hello

hi have a problem with this code:

Code: Select all

bind pub - !transferir pub:transferir
proc pub:transferir {nick uhost hand chan text} {
set cromo1 [lindex $text 0]
set cromo2 [lindex $text 1]
set resto [lindex $text 2]
if {![matchattr $nick o]} {
	putserv "NOTICE $nick :No access!"; return 0}
if {$resto != "" || $cromo2 == ""} {
	putserv "NOTICE $nick : make: !transferir <nick1> <nick2>"; return 0
} elseif {[matchattr $cromo2 o] || ![validuser $cromo1] || ![validuser $cromo2] } {
	putserv "NOTICE $nick : ERRO: protech user / invalid user ";return 0
	} else {
sumuser $cromo1 $cromo2
	putserv "NOTICE $nick : Done"
}
}
this is the error:
[21:43] Tcl error [pub:transferir]: invalid command name "sumuser"
and the ideia is to do this:

### sumuser <user1> <user2>
transfers all stats from user2 to user1 and deletes user2
( stats.mod )

but, if i do the sumuser in the party line, we work's fine

(09:26:27pm) (vOdKa^Dj) .sumuser xblue oriety
(09:26:27pm) (Acessivel) Transferred stats from oriety to xblue and deleted oriety

hi have a tcl similar to this one, but whit "resetuser" and works fine
i not inderstand way this "sumuser" is only reconhece in the pary line and not outside, like the " resetsuser " and other's.

ty
Bruno, vOdKa^Dj @ PTnet
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

sumuser is dcc command, not Tcl command
M
MrAnderson
Voice
Posts: 9
Joined: Tue Aug 24, 2004 9:34 am
Location: Portugal

Post by MrAnderson »

demond wrote:sumuser is dcc command, not Tcl command
ok, but this code for exemple:

Code: Select all


proc pub:reset {nick uhost hand chan text} {
set addnick [lindex $text 0]
if {![matchattr $nick o} {
	putserv "NOTICE $nick :No access"; return 0
} elseif { ![validuser $addnick]} {
	putserv "NOTICE $nick : ERROR: Invalid user ( $addnick )"; return 0
} else {
resetuser $addnick $chan
	putserv "NOTICE $nick : the stats from $addnick was reset in $chan"
}
}


works fine, and resetuser is not a tcl command ?
Bruno, vOdKa^Dj @ PTnet
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

it obviously is
M
MrAnderson
Voice
Posts: 9
Joined: Tue Aug 24, 2004 9:34 am
Location: Portugal

Post by MrAnderson »

ok, tks

but is stange, some commands, like resetuser and other, be a tcl command, and works fine, but sumuser not.
Bruno, vOdKa^Dj @ PTnet
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Show us the proc of the dcc command sumuser then we can help create the proc sumuser to be used as a Tcl command.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

.sumuser can be implemented with [getstats] and [incrstats] (however I don't see Tcl command for deleting user from stats database, at least there's no such thing in stats.mod's README)
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

if you have some C experience you might be able to copy the dcc command as tcl command.
the C <-> TCL commands are defined in tclstats.c line 174, the dcc command sumuser is in dcccmds.c on line 62.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked