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 

check +m or +i

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


Joined: 21 Apr 2005
Posts: 19

PostPosted: Sun Sep 21, 2008 7:10 pm    Post subject: check +m or +i Reply with quote

i was looking for a script that i can set up to see if a list of chans that i set are +i or +m are set at intervals of about 5 mins that it will take away those chanmodes
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Oct 12, 2008 4:10 pm    Post subject: Reply with quote

Code:
#tested with 'windrop v1.6.19' sorry!

bind mode - "*" check:mode
bind time - "15 * * * *" checkmode:time

proc check:mode {nick host handle channel mode {target ""}} {
global botnick
 if {($target != "")} {append mode " $target"}
  if {([channel get $channel "checkmode"])} {
   if {([regexp -all -- {(m|i)} "$mode"] > 0)} {
    if {([botisop $channel])} {
     putquick "MODE $channel -im"
     return
    }
   }
  }
}

proc checkmode:time {minute hour day month year} {
 foreach chan [channels] {
  if {([channel get $chan "checkmode"])} {
   if {([regexp -all -- {(m|i)} "[lindex [split [getchanmode $chan] "+"] 1]"] > 0)} {
    if {([botisop $chan])} {
     putquick "MODE $chan -im"
    }
   }
  }
 }; return
}

setudef flag checkmode

putlog "loaded checkmode.tcl version 1.0 by TCL_no_TK"
return
The timer is set to check all channels set 'checkmode' for channel modes '+i' and '+m' as long as the bot is op'd on the channel where the modes are set it will unset them. It also checks modes being sets and if +i or +m are being set it will also remove them if it is op'd. To set a channel with the option 'checkmode' use (in DCC/CHAT):
Quote:
.chanset <#channel-name> +checkmode
use '*' as <#channel-name> for it to work on all channels eggdrop is on, if you wish. And feel free to reply if you have any errors! Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
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