### mytitul
proc ::tpub::cmd_mytitul {nick chan text} { variable conf
if {$text == "?help?"} { return [usage $nick $chan mytitul "?text...?" "sets the title to be displayed in !in/!out at the entrance to the channel. If you want to delete the title, set the parameter none."] }
set hand [nick2hand $nick]
if {$hand == "" || $hand == "*"} {putnot $nick "You are not registered on the bot.."; return}
array set usr [users get $hand]
set honor ""
set ko 0
foreach item $conf(drank) {
if {$usr(score)<=$item} { set honor [lindex $conf(rank) $ko]; break}
incr ko }
if {$honor != "" || ![users isintop $hand] || ![matchattr $hand n]} {
putpvt $nick $chan "You are not in the top five players or your current rank is not equal to the maximum possible - \"$conf(dmax)\" - , therefore, you cannot set your own title."
return
}
if {[lindex $text 0]!="none"} {
set tremort [lindex $text 0]
set usr(tremort) $tremort
users set [list $hand [array get usr]]
putpvt $nick $chan "Your title is set to \"$tremort\""
} else {
unset usr(tremort)
users set [list $hand [array get usr]]
putpvt $nick $chan "Your title has been removed.."
}
}
Please help me ..... Thanks & sorry for my bad English
juggle wrote:Can you guys please help me on this.. instead of giving command to the channel with !mytutil how do i change it to !mytitle
You have not posted the complete script. I say that because there is no bind command appearing.
The bind <type> command is what creates an association between an event and the calling of a procedure.
Typically for a command like you have described, it would be a
bind pub
command. However, by the way the procedure that you did post is written, a bind pub cannot be used directly. So, without seeing the whole script, it is guess work. You might want to post the complete script. If it is too difficult to post here, then use: http://paste.tclhelp.net/
and post the link.