View previous topic :: View next topic |
Author |
Message |
juggle Voice
Joined: 01 Sep 2018 Posts: 15
|
Posted: Sat Oct 27, 2018 6:10 am Post subject: A little help needed |
|
|
Can you guys please help me on this.. instead of giving command to the channel with !mytutil how do i change it to !mytitle
Code: |
### 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 |
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1046
|
Posted: Sat Oct 27, 2018 9:23 am Post subject: Re: A little help needed |
|
|
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.
You might also like to read :
http://suninet.the-demon.de/041.htm
and use:
http://docs.eggheads.org/mainDocs/tcl-commands.html
for reference. You can find all the binds described here. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
Back to top |
|
 |
juggle Voice
Joined: 01 Sep 2018 Posts: 15
|
Posted: Sun Oct 28, 2018 5:38 am Post subject: Re: A little help needed |
|
|
Thank you for the reply... i somehow fiexed the problem.. thank you so much again... |
|
Back to top |
|
 |
|