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 

Admin script

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


Joined: 02 Nov 2007
Posts: 4

PostPosted: Fri Nov 02, 2007 6:56 pm    Post subject: Admin script Reply with quote

I simply want a script that does the following


Joins channels when in #X by typing .join #channel
Parts channels when in #X by typing .part #channel

Thanks Smile
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Fri Nov 02, 2007 10:06 pm    Post subject: Reply with quote

Code:

bind dcc n part part_chan
proc part_chan {hand idx text} {
        set text [split $text]
        if {([botonchan $text]) && ([validchan $text])} {
                channel set $text +inactive
                putcmdlog "Bot setting channel +inactive and leaving $text by $hand 's command."
        } else {
                putdcc $idx "I'm not ON channel $text"
                return
        }
}


bind dcc n join join_chan
proc join_chan {hand idx text} {
        set text [split $text]
        if {(![botonchan $text]) && ([validchan $text])} {
                channel set $text -inactive
                putcmdlog "Bot setting channel -inactive and rejoining $text by $hand 's command."
        } else {
                putdcc $idx "That's not a valid channel..."
                return
        }
}

Note that the channels have to already exist in the bot's channel file for the above to work. It wouldn't be that much harder to make the script add the channels if you want it to join new ones. Check the eggdrop docs for how to add new channels.
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