| View previous topic :: View next topic |
| Author |
Message |
MrAnderson Voice
Joined: 24 Aug 2004 Posts: 9 Location: Portugal
|
Posted: Mon Aug 15, 2005 6:04 pm Post subject: "invalid command name "sumuser"" why? |
|
|
hello
hi have a problem with this code:
| Code: |
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 |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Aug 15, 2005 6:24 pm Post subject: |
|
|
| sumuser is dcc command, not Tcl command |
|
| Back to top |
|
 |
MrAnderson Voice
Joined: 24 Aug 2004 Posts: 9 Location: Portugal
|
Posted: Mon Aug 15, 2005 6:30 pm Post subject: |
|
|
| demond wrote: | | sumuser is dcc command, not Tcl command |
ok, but this code for exemple:
| Code: |
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 |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Aug 15, 2005 6:57 pm Post subject: |
|
|
| it obviously is |
|
| Back to top |
|
 |
MrAnderson Voice
Joined: 24 Aug 2004 Posts: 9 Location: Portugal
|
Posted: Mon Aug 15, 2005 7:34 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Aug 15, 2005 8:08 pm Post subject: |
|
|
Show us the proc of the dcc command sumuser then we can help create the proc sumuser to be used as a Tcl command. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Wed Aug 17, 2005 12:38 am Post subject: |
|
|
| .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) |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Aug 17, 2005 10:19 am Post subject: |
|
|
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... |
|
| Back to top |
|
 |
|