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 

add channels

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Tue Aug 03, 2010 7:20 pm    Post subject: add channels Reply with quote

Hi im looking for a small script that will allow me to add/del channels to the bots channel list via bind msg

Ex /msg botnick addchan #channelname
/msg botnick delchan #channelname

in theory it should do as .+chan #channelname .-chan #channelname would do

many thanks
_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Wed Aug 04, 2010 2:28 pm    Post subject: Reply with quote

I set the bind to n only, I figured you only wanted owners to use this command. There really is not an exact equivalent of .+/-chan in tcl commands. Closest I could get was with using channel add/remove. This will make the channels dynamic though, meaning, your bot will automatically join them when it starts, just as it does the channels set in your config. I have not configured channel options into channel add:

Code:
bind msg n addchan addchan
proc addchan {nick host hand text} {
   set chan [join [lindex [split $text] 0]]
   if {![string length $chan]} {
      putserv "PRIVMSG $nick :You need to specify which channel to join."
      return 0
   }
   if {[validchan $chan]} {
      if {[channel get $chan "inactive"]} {
         channel set $chan -inactive
         return 0
      }
      putserv "PRIVMSG $nick :I am already on $chan."
      return 0
   }
   channel add $chan
}

bind msg n delchan delchan
proc delchan {nick host hand text} {
   set chan [join [lindex [split $text] 0]]
   if {![string length $chan]} {
      putserv "PRIVMSG $nick :You need to specify which channel to remove."
      return 0
   }
   if {![validchan $chan]} {
      putserv "PRIVMSG $nick :Unknown channel: $chan."
      return 0
   }
   channel remove $chan
}


Syntax is: /msg botnick add/delchan <channel>.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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