This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

check +m or +i

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
K
Kraka
Voice
Posts: 19
Joined: Thu Apr 21, 2005 9:25 pm

check +m or +i

Post by Kraka »

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
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Code: Select all

#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):
.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! :)
Post Reply