OUTsider

OUTsider

Joined
Jan 18, 2009
Location
Netherlands
Website

Activity Stream

OUTsider commented on a Page, Delay voice with modes +Dm on Undernet .TCL  -  Jan 18, 2009

Made a little update to it. Here's something for ya folks:

# Its Made To Work With The Channel Modes +Dm
# Its To Prevent Join/Part Flood From Botnets and Lame Script Kiddow

# Inital coder: xplorer@live.ca - irc.undernet.org - #mircscripting
# Updated 2009/01/19 by: OUTsider <outsider@scarynet.org>
#                        Made it multichannel operating. Just be carefull not
#                        to excess flood on unet depending on the amount and
#                        sizes of your total usercount.

# Say hello to user defined channel flags.
# Simply turn on/off per chan using .chanset <chan> [+|-]modeD
# change the mode to use (o|v) using .chanset <chan> modeD_mode <mode>
setudef flag modeD
setudef str  modeD_mode

# Make sure all channels have a default mode set on startup.
foreach chan [channels] {
        if {[channel get $chan modeD_mode] == ""} {
                channel set $chan modeD_mode "v"
        }
}

# Binds
bind time - "* * * * *" modeD:time
bind raw - 353 modeD:raw353
bind raw - 352 modeD:raw352

proc modeD:raw352 {from raw arg} {
        set arg [split $arg]
        set user [lindex $arg 2]
        set host [lindex $arg 3]
        set nick [lindex $arg 5]
        foreach chan [channels] {
                if {[channel get $chan modeD]} {
                        # Now you probably ask why I split all this and not combine it
                        # into one major if statement. Very simple, this *IS* faster.
                        # because you first check if it's needed to even check this chan.
                        # THEN you check if the user is either voiced or opped
                        # THEN you check if you still got a reason for the user not to
                        # get voiced...
                        if {[isop $nick $chan] || [isvoice $nick $chan]} {
                                return
                        }
                        if {[isban "$nick!$user@$host" $chan] || [isban [maskhost "$nick!$user@$host"] $chan] ||
                             [isban "$nick!$user@$host"]|| [isban [maskhost "$nick!$user@$host"]]} {
                                return
                        }
                        # and here you could for example think of other reasons why you
                        # would not like a certain user to get voiced...
                        # otherwise, give the nick a voice. (I prefer pushmode since it ends up in
                        # the modequeue that way. The function is there, so I use it :P
                        pushmode $chan +[channel get $chan modeD_mode] $nick
                }
        }
}

proc modeD:time {min hour day month year} {
        foreach chan [channels] {
                if {[validchan $chan] && [channel get $chan modeD] && [regexp {D|d} [lindex [getchanmode $chan] 0]]} {
                        putserv "NAMES $chan"
                }
        }
}

proc modeD:raw353 {from raw arg} {
        set channel [lindex [split $arg] 2]
        if {[channel get $channel modeD] } {
                foreach user [lindex [split $arg :] 1] {
                        if {$user != "" && ![regexp {\@|\+} $user]} {
                                putserv "WHO $user"
                        }
                }
        }
}

#########
putlog "Delay Voice +Dm XploreR@Live.Ca - Updated 2009/01/19 OUTsider"
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.