Code: Select all
bind sign - "*" store:hosts
proc store:hosts {nick host hand chan text} {
# store $nick $host here for short period
}
bind pub -|- !kb gethost:kickban
proc gethost:kickban {nick host hand chan text} {
# get the host that goes with the stored nick that quit IRC
putserv "mode $chan +b $storedhost"
}
Code: Select all
bind part - * store:hosts
bind sign - * store:hosts
proc store:hosts {nk uh hn ch msg} {
set aname [string tolower $nk@$ch]
set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}
bind time - * expire:hosts
proc expire:hosts {mn hr da mo yr} {
global storehosts
set ut [unixtime]
foreach {aname avalue} [array get storehosts] {
if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
}
}
bind pub o|o !kb pub:kickban
proc pub:kickban {nk uh hn ch tx} {
global storehosts
set target [lindex [split [string tolower $tx]] 0]
set aname [string tolower $target@$ch]
if {[onchan $target $ch]} {
#kick and/or ban the person using info from the channel#
} elseif {[info exists storehosts($aname)]} {
set host [lindex [split [lindex $storehosts($aname) 0] @] 1]
putquick "MODE $ch +b *!*@$host"
}
}
Code: Select all
proc pub:kickban {nick host hand chan text} {
global storehosts
set target [lindex [split [string tolower $text]] 0]
set aname [string tolower $target@$chan]
set users [list]
set umasks [list]
set reason [join [lrange [split $text "."] 1 end] "."]
set text [lindex [split $text "."] 0]
if {$reason eq ""} { set reason "Please change your behaviour thank you." }
foreach user [split [string trim $text]] {
if {![onchan $user $chan] && ![info exists storehosts($aname)]} {
putserv "NOTICE $nick $user :is not on channel $chan"
} elseif {![onchan $user $chan] && [info exists storehosts($aname)]} {
lappend umasks [lindex [split [lindex $storehosts($aname) 0] @] 1]
} else {
set chost [getchanhost $user $chan]
lappend umasks [maskhost "$user!$chost" 2]
if {![isatleasthalfop2017ewa $user $chan]} { lappend users $user }
}
}
if {[info exists umasks]} { stackBans3z $chan $umasks }
if {[info exists users]} { stackKicks $chan $users $reason }
}
Code: Select all
proc pub:kbanx1kxZ777 {nick host hand chan text} {
if {![isatleasthalfop2017ewa $nick $chan]} { return 0 }
set users [list]
set umasks [list]
set reason [join [lrange [split $text "."] 1 end] "."]
set text [lindex [split $text "."] 0]
if {$reason eq ""} { set reason "Please change your behaviour thank you." }
foreach user [split [string trim $text]] {
if {![onchan $user $chan]} {
putserv "NOTICE $nick $user is not on channel $chan"
} else {
set chost [getchanhost $user $chan]
if {![isatleasthalfop2017ewa $user $chan]} { lappend umasks [maskhost "$user!$chost" 2] ; lappend users $user }
}
}
if {[info exists umasks]} { stackBans3z $chan $umasks }
if {[info exists users]} { stackKicks $chan $users $reason }
}
Code: Select all
# max number of bans to stack in one mode command (1 or more) #
set pkb(maxban) 6
# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 3
##############
bind pub -|- !k pub:kick
proc pub:kick {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx k }
bind pub -|- !b pub:ban
proc pub:ban {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx b }
bind pub -|- !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
global pkb storehosts
if {![isop $nk $ch] && ![ishalfop $nk $ch]} { return 0 }
set reason [join [lrange [split $tx "."] 1 end] "."]
if {$reason eq ""} { set reason "Please change your behaviour thank you." }
set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
set chan [string tolower $ch]
foreach nick $nickls {
set aname "$nick@$chan"
if {[onchan $nick $ch]} {
if {[string match *b* $do]} {
set chost [getchanhost $nick $ch]
lappend bmasks [maskhost "$nick!$chost" 2]
}
if {[string match *k* $do]} {
lappend knicks $nick
}
} elseif {[info exists storehosts($aname)]} {
if {[string match *b* $do]} {
set chost [lindex [split [lindex $storehosts($aname) 0] @] 1]
lappend bmasks [maskhost "$nick!$chost" 2]
}
} else {
putserv "NOTICE $nk: $nick :is not on channel $ch"
}
}
if {[info exists bmasks]} {
while {[set len [llength $bmasks]] > 0} {
if {$len > $pkb(maxban)} {
set mode [string repeat "b" $pkb(maxban)]
set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
set bmasks [lrange $bmasks $pkb(maxban) end]
} else {
set mode [string repeat "b" $len]
set masks [join $bmasks]
set bmasks ""
}
putquick "MODE $ch +$mode $masks"
}
}
if {[info exists knicks]} {
while {[set len [llength $knicks]] > 0} {
if {$len > $pkb(maxkick)} {
set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
set knicks [lrange $knicks $pkb(maxkick) end]
} else {
set nicks [join $knicks ","]
set knicks ""
}
putserv "KICK $ch $nicks :$reason"
}
}
}
####
bind part - * store:hosts
bind sign - * store:hosts
proc store:hosts {nk uh hn ch msg} {
set aname [string tolower $nk@$ch]
set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}
bind time - * expire:hosts
proc expire:hosts {mn hr da mo yr} {
global storehosts
set ut [unixtime]
foreach {aname avalue} [array get storehosts] {
if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
}
}
*!*@allard!All4Masti-v89.77r.138.369.IP *!*@applegate!All4Masti-29b.e9z.478.285.IP *!*@asher!All4Masti-o68.c4a.967.882.IP *!*@duarte!All4Masti-140.wso.660.492.IP *!*@gant!All4Masti-6f6.c0z.650.472.IP *!*@hollingsworth!All4Masti-f8q.t2j.564.470.IP *!*@huskey!All4Masti-3x4.6zk.328.421.IP *!*@kohn!All4Masti-bx2.t0y.861.064.IP *!*@laughlin!All4Masti-4eg.8f1.962.486.IP *!*@leslie!All4Masti-v6p.8d0.174.673.IP
Code: Select all
# max number of bans to stack in one mode command (1 or more) #
set pkb(maxban) 6
# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 3
##############
bind pub o|o !k pub:kick
proc pub:kick {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx k }
bind pub o|o !b pub:ban
proc pub:ban {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx b }
bind pub o|o !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
global pkb storehosts
if {![isop $nk $ch] && ![ishalfop $nk $ch]} { return 0 }
set reason [join [lrange [split $tx "."] 1 end] "."]
if {$reason eq ""} { set reason "Please change your behaviour thank you." }
set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
set chan [string tolower $ch]
foreach nick $nickls {
set aname "$nick@$chan"
if {[onchan $nick $ch]} {
if {[string match *b* $do]} {
set chost [getchanhost $nick $ch]
lappend bmasks [maskhost "$nick!$chost" 2]
}
if {[string match *k* $do]} {
lappend knicks $nick
}
} elseif {[info exists storehosts($aname)]} {
if {[string match *b* $do]} {
set chost [lindex $storehosts($aname) 0]
lappend bmasks [maskhost "$nick!$chost" 2]
}
} else {
putserv "NOTICE $nk :$nick :is not on channel $ch"
}
}
if {[info exists bmasks]} {
while {[set len [llength $bmasks]] > 0} {
if {$len > $pkb(maxban)} {
set mode [string repeat "b" $pkb(maxban)]
set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
set bmasks [lrange $bmasks $pkb(maxban) end]
} else {
set mode [string repeat "b" $len]
set masks [join $bmasks]
set bmasks ""
}
putquick "MODE $ch +$mode $masks"
}
}
if {[info exists knicks]} {
while {[set len [llength $knicks]] > 0} {
if {$len > $pkb(maxkick)} {
set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
set knicks [lrange $knicks $pkb(maxkick) end]
} else {
set nicks [join $knicks ","]
set knicks ""
}
putserv "KICK $ch $nicks :$reason"
}
}
}
####
bind part - * store:hosts
bind sign - * store:hosts
proc store:hosts {nk uh hn ch msg} {
set aname [string tolower $nk@$ch]
set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}
bind time - * expire:hosts
proc expire:hosts {mn hr da mo yr} {
global storehosts
set ut [unixtime]
foreach {aname avalue} [array get storehosts] {
if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
}
}
Code: Select all
# max number of bans to stack in one mode command (1 or more) #
set pkb(maxban) 6
# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 4
##############
bind pub -|- !k pub:kick
proc pub:kick {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx k }
bind pub -|- !b pub:ban
proc pub:ban {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx b }
bind pub -|- !m pub:muteban
proc pub:muteban {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx m }
bind pub -|- !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
global pkb storehosts
if {![isop $nk $ch] && ![ishalfop $nk $ch] && ![matchattr [nick2hand $nk] o|o $ch]} { return 0 }
set reason [join [lrange [split $tx "."] 1 end] "."]
if {$reason eq ""} { set reason "Please change your behaviour thank you." }
set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
set chan [string tolower $ch]
foreach nick $nickls {
set aname "$nick@$chan"
if {[onchan $nick $ch]} {
if {[string match *b* $do]} {
if {![isop $nick $ch] && ![ishalfop $nick $ch] && [isvoice $nick $ch] && ![matchattr [nick2hand $nick] o|o $ch]} { lappend users $nick }
set chost [getchanhost $nick $ch]
if {![isop $nick $ch] && ![ishalfop $nick $ch] && ![matchattr [nick2hand $nick] o|o $ch]} { lappend bmasks [maskhost "$nick!$chost" 2] }
}
if {[string match *m* $do]} {
if {![isop $nick $ch] && ![ishalfop $nick $ch] && [isvoice $nick $ch] && ![matchattr [nick2hand $nick] o|o $ch]} { lappend users $nick }
set chost [getchanhost $nick $ch]
if {![isop $nick $ch] && ![ishalfop $nick $ch] && ![matchattr [nick2hand $nick] o|o $ch]} { lappend bmasks ~q:[maskhost "$nick!$chost" 2] }
}
if {[string match *k* $do]} {
lappend knicks $nick
}
} elseif {[info exists storehosts($aname)]} {
if {[string match *b* $do]} {
set chost [lindex $storehosts($aname) 0]
lappend bmasks [maskhost "$nick!$chost" 2]
}
} else {
putserv "NOTICE $nk $nick :is not on channel $ch"
}
}
if {[info exists users]} { stackdevoice $chan $users }
if {[info exists bmasks]} {
while {[set len [llength $bmasks]] > 0} {
if {$len > $pkb(maxban)} {
set mode [string repeat "b" $pkb(maxban)]
set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
set bmasks [lrange $bmasks $pkb(maxban) end]
} else {
set mode [string repeat "b" $len]
set masks [join $bmasks]
set bmasks ""
}
putquick "MODE $ch +$mode $masks"
}
}
if {[info exists knicks]} {
while {[set len [llength $knicks]] > 0} {
if {$len > $pkb(maxkick)} {
set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
set knicks [lrange $knicks $pkb(maxkick) end]
} else {
set nicks [join $knicks ","]
set knicks ""
}
putserv "KICK $ch $nicks :$reason"
}
}
}
proc stackdevoice {chan banlist {max 6}} {
set count [llength $banlist]
while {$count > 0} {
if {$count> $max} {
set mode [string repeat "v" $max]
set masks [join [lrange $banlist 0 [expr {$max - 1}]]]
set banlist [lrange $banlist $max end]
incr count -$max
incr total $max
} else {
set mode [string repeat "v" $count]
set masks [join $banlist]
incr total $count
set count 0
}
putquick "MODE $chan -$mode $masks"
}
}
####
bind part - * store:hosts
bind sign - * store:hosts
proc store:hosts {nk uh hn ch msg} {
set aname [string tolower $nk@$ch]
set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}
bind time - * expire:hosts
proc expire:hosts {mn hr da mo yr} {
global storehosts
set ut [unixtime]
foreach {aname avalue} [array get storehosts] {
if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
}
}
Code: Select all
# max number of bans/devoice to stack in one mode command (1 or more) #
set pkb(maxban) 6
# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 3
##############
bind pub -|- !k pub:kick
proc pub:kick {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx k }
bind pub -|- !b pub:ban
proc pub:ban {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx b }
bind pub -|- !m pub:muteban
proc pub:muteban {nk uh hn ch tx} { pub:kickban $nk $uh $hn $ch $tx m }
bind pub -|- !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
global pkb storehosts
if {![isop $nk $ch] && ![ishalfop $nk $ch] && ![matchattr $hn o|o $ch]} {
return 0
}
set reason [join [lrange [split $tx "."] 1 end] "."]
if {$reason eq ""} { set reason "Please change your behaviour thank you." }
set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
set chan [string tolower $ch]
foreach nick $nickls {
set aname "$nick@$chan"
if {[onchan $nick $ch]} {
if {[isop $nick $ch] || [ishalfop $nick $ch]} { continue }
if {[matchattr [nick2hand $nick] o|o $ch]} { continue }
if {[string match *b* $do]} {
set chost [getchanhost $nick $ch]
lappend bmasks [maskhost "$nick!$chost" 2]
if {[isvoice $nick $ch] && ![string match *k* $do]} {
lappend dvnicks $nick
}
}
if {[string match *m* $do]} {
set chost [getchanhost $nick $ch]
lappend bmasks ~q:[maskhost "$nick!$chost" 2]
if {[isvoice $nick $ch]} { lappend dvnicks $nick }
}
if {[string match *k* $do]} {
lappend knicks $nick
}
} elseif {[info exists storehosts($aname)]} {
if {[matchattr [lindex $storehosts($aname) 2] o|o $ch]} { continue }
if {[string match *b* $do]} {
set chost [lindex $storehosts($aname) 0]
lappend bmasks [maskhost "$nick!$chost" 2]
}
if {[string match *m* $do]} {
set chost [lindex $storehosts($aname) 0]
lappend bmasks ~q:[maskhost "$nick!$chost" 2]
}
} else {
putserv "NOTICE $nk :$nick :is not on channel $ch"
}
}
if {[info exists dvnicks]} {
while {[set len [llength $dvnicks]] > 0} {
if {$len > $pkb(maxban)} {
set mode [string repeat "v" $pkb(maxban)]
set nicks [join [lrange $dvnicks 0 [expr {$pkb(maxban) - 1}]]]
set dvnicks [lrange $dvnicks $pkb(maxban) end]
} else {
set mode [string repeat "v" $len]
set nicks [join $dvnicks]
set dvnicks ""
}
putquick "MODE $ch -$mode $nicks"
}
}
if {[info exists bmasks]} {
while {[set len [llength $bmasks]] > 0} {
if {$len > $pkb(maxban)} {
set mode [string repeat "b" $pkb(maxban)]
set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
set bmasks [lrange $bmasks $pkb(maxban) end]
} else {
set mode [string repeat "b" $len]
set masks [join $bmasks]
set bmasks ""
}
putquick "MODE $ch +$mode $masks"
}
}
if {[info exists knicks]} {
while {[set len [llength $knicks]] > 0} {
if {$len > $pkb(maxkick)} {
set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
set knicks [lrange $knicks $pkb(maxkick) end]
} else {
set nicks [join $knicks ","]
set knicks ""
}
putserv "KICK $ch $nicks :$reason"
}
}
}
####
bind part - * store:hosts
bind sign - * store:hosts
proc store:hosts {nk uh hn ch msg} {
set aname [string tolower $nk@$ch]
set ::storehosts($aname) [list $uh [expr {[unixtime]+120}] $hn]
}
bind time - * expire:hosts
proc expire:hosts {mn hr da mo yr} {
global storehosts
set ut [unixtime]
foreach {aname avalue} [array get storehosts] {
if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
}
}