egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A little help needed

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
juggle
Voice


Joined: 01 Sep 2018
Posts: 12

PostPosted: Sat Oct 27, 2018 6:10 am    Post subject: A little help needed Reply with quote

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
View user's profile Send private message AIM Address
willyw
Owner


Joined: 15 Jan 2009
Posts: 971

PostPosted: Sat Oct 27, 2018 9:23 am    Post subject: Re: A little help needed Reply with quote

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
View user's profile Send private message
juggle
Voice


Joined: 01 Sep 2018
Posts: 12

PostPosted: Sun Oct 28, 2018 5:38 am    Post subject: Re: A little help needed Reply with quote

Thank you for the reply... i somehow fiexed the problem.. thank you so much again...
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber