Code: Select all
bind cron - {* * * * *} chanops:abuse:cron
setudef flag chanopsabuse
proc chanops:abuse:cron {min hour day month weekday} {
global ChanOpsList
foreach chan [channels] {
if {![channel get $chan chanopsabuse]} continue
foreach member [chanlist $chan] {
if {[isop $member $chan] || [ishalfop $member $chan] || [matchattr [nick2hand $member] o|o $chan]} {
lappend ChanOpsList($chan) $member
}
}
}
}
Code: Select all
bind cron - {* * * * *} chanops:abuse:cron
setudef flag chanopsabuse
proc chanops:abuse:cron {min hour day month weekday} {
global ChanOpsList
foreach chan [channels] {
if {![channel get $chan chanopsabuse]} continue
foreach member [chanlist $chan] {
if {[isop $member $chan] || [ishalfop $member $chan] || [matchattr [nick2hand $member] o|o $chan]} {
if {[info exists ChanOpsList($chan)]} { array unset ChanOpsList($chan) }
lappend ChanOpsList($chan) $member
}
}
}
}
Code: Select all
if {[info exists ChanOpsList]} { unset ChanOpsList }
Code: Select all
bind nick - * Chanops-Nick-Abuse
proc Chanops-Nick-Abuse {nick uhost hand chan newnick} {
Chanops-Join-Abuse $newnick $uhost $hand $chan
}
bind join - * Chanops-Join-Abuse
proc Chanops-Join-Abuse {nick uhost hand chan} {
global ChanOpsList
if {[isbotnick $nick]} return
if {[info exists ChanOpsList($chan)]} {
foreach choplist [lsort -unique -dictionary $ChanOpsList($chan)] {
if {[onchan choplis $chan]} {
set length [string length $choplist]
set bdnickpart [wildcard $choplist]
regsub -all {\*{1,}} $bdnickpart "*" bdnickpart
if {[string match -nocase "$bdnickpart" $nick] && $length > 5} {
pushmode $chan +b *$choplist?*!*@*
pushmode $chan +b *?$choplist*!*@*
regsub -all -- ~ $uhost "" uhost
if {[string match -nocase "*@*irccloud*" [maskhost $nick!$uhost 2]]} {
set ident "[lindex [split $uhost @] 0]"
set xbmaskx "[string map {sid id uid id} $ident]"
set bmask "*[string tolower $xbmaskx ]@*"
pushmode $chan +b $bmask
} else {
set bmask "[maskhost $nick!$uhost 2]"
pushmode $chan +b $bmask
}
putquick "kick $chan $nick � -- Please Dont Impersonate/Abuse Chanop Nicks Thank You.... -- �"
}
}
}
}
flushmode $chan
}
proc wildcard {text} {
set sep {*}
set reg $sep
for {set i 0} {$i<=[string length $text]} {incr i} {
append reg [string index $text $i]$sep
}
return $reg
}
bind cron - {* * * * *} chanops:abuse:cron
setudef flag chanopsabuse
proc chanops:abuse:cron {min hour day month weekday} {
global ChanOpsList
foreach chan [channels] {
if {![channel get $chan chanopsabuse]} continue
foreach member [chanlist $chan] {
if {[isop $member $chan] || [ishalfop $member $chan] || [matchattr [nick2hand $member] o|o $chan]} {
lappend ChanOpsList($chan) $member
}
}
if {[info exists ChanOpsList]} { unset ChanOpsList }
}
}
Code: Select all
bind nick - * Chanops-Nick-Abuse
proc Chanops-Nick-Abuse {nick uhost hand chan newnick} {
if {[isbotnick $newnick]} return
Chanops-Join-Abuse $newnick $uhost $hand $chan
}
bind join - * Chanops-Join-Abuse
proc Chanops-Join-Abuse {nick uhost hand chan} {
global ChanOpsList
if {[isbotnick $nick]} return
if {[info exists ChanOpsList($chan)]} {
foreach choplist [lsort -unique -dictionary $ChanOpsList($chan)] {
if {[onchan $choplist $chan]} {
set length [string length $choplist]
set bdnickpart [wildcard $choplist]
regsub -all {\*{1,}} $bdnickpart "*" bdnickpart
if {[string match -nocase "$bdnickpart" $nick] && $length > 5} {
pushmode $chan +b *$choplist?*!*@*
pushmode $chan +b *?$choplist*!*@*
regsub -all -- ~ $uhost "" uhost
if {[string match -nocase "*@*irccloud*" [maskhost $nick!$uhost 2]]} {
set ident "[lindex [split $uhost @] 0]"
set xbmaskx "[string map {sid id uid id} $ident]"
set bmask "*!*[string tolower $xbmaskx ]@*"
pushmode $chan +b $bmask
} else {
set bmask "[maskhost $nick!$uhost 2]"
pushmode $chan +b $bmask
}
putquick "kick $chan $nick :Please Dont Impersonate/Abuse Chanop Nicks,... Thank You"
}
}
}
}
flushmode $chan
}
proc wildcard {text} {
set sep {*}
set reg $sep
for {set i 0} {$i<=[string length $text]} {incr i} {
append reg [string index $text $i]$sep
}
return $reg
}
# Syntax !chanops on / off
bind PUB -|- !chanops ChanOpsAbuse:control
proc ChanOpsAbuse:control {nick uhost hand chan arg} {
if {![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr $hand o|o $chan]} { return 0 }
switch -nocase -- [lindex [split $arg] 0] {
on {
if {[channel get $chan chanopsabuse]} {
putserv "NOTICE $nick :chanopsabuse checker is already enabled on $chan."
} else {
channel set $chan +chanopsabuse
putserv "NOTICE $nick :chanopsabuse checker is now enabled."
}
}
off {
if {![channel get $chan chanopsabuse]} {
putserv "NOTICE $nick :chanopsabuse checker is already disabled on $chan."
} else {
channel set $chan -chanopsabuse
putserv "NOTICE $nick :chanopsabuse checker is now disabled."
}
}
}
}
setudef flag chanopsabuse
bind cron - {* * * * *} chanops:abuse:cron
proc chanops:abuse:cron {min hour day month weekday} {
global ChanOpsList
if {[info exists ChanOpsList]} { unset ChanOpsList }
foreach chan [channels] {
if {![channel get $chan chanopsabuse] || ![botisop $chan]} continue
foreach member [chanlist $chan] {
if {[isop $member $chan] || [ishalfop $member $chan] || [matchattr [nick2hand $member] o|o $chan]} {
lappend ChanOpsList($chan) $member
}
}
}
}
Code: Select all
bind nick - * Chanops-Nick-Abuse
proc Chanops-Nick-Abuse {nick uhost hand chan newnick} {
if {[isbotnick $newnick]} return
Chanops-Join-Abuse $newnick $uhost $hand $chan
}
bind join - * Chanops-Join-Abuse
proc Chanops-Join-Abuse {nick uhost hand chan} {
global ChanOpsList
if {[isbotnick $nick]} return
if {[info exists ChanOpsList($chan)]} {
foreach choplist [lsort -unique -dictionary $ChanOpsList($chan)] {
if {[onchan $choplist $chan]} {
set length [string length $choplist]
set bdnickpart [wildcard $choplist]
regsub -all {\*{1,}} $bdnickpart "*" bdnickpart
if {[string match -nocase "$bdnickpart" $nick] && $length > 5} {
pushmode $chan +b *$choplist?*!*@*
pushmode $chan +b *?$choplist*!*@*
regsub -all -- ~ $uhost "" uhost
if {[string match -nocase "*@*irccloud*" [maskhost $nick!$uhost 2]]} {
set ident "[lindex [split $uhost @] 0]"
set xbmaskx "[string map {sid id uid id} $ident]"
set bmask "*!*[string tolower $xbmaskx ]@*"
pushmode $chan +b $bmask
} else {
regsub -all -- {([a-zA-Z\?]*\?{1,}[a-zA-Z\?]*)(-|\.|$)} [maskhost $uhost 14] {*\2} target14
regsub -all -- {\?+} [maskhost $uhost 14] {*} target27
set domain "[join [lrange [split $uhost .] end-0 end] .]"
set XllenX [llength [split [lindex [split $uhost "@"] 1] "-"]]
set llen [llength [split [lindex [split $uhost "@"] 1] "."]]
if {$llen == 2} { set bmask "$target27"
} elseif {[string match "ip" $domain]} {
set bmask "*!*@*.[join [lrange [split $uhost .] end-2 end] .]"
} elseif {[regexp {^\d+\.\d+\.\d+\.\d+$} $uhost]} { set bmask "$target14"
} elseif {$XllenX == 5 && $llen == 4} { set bmask "*!*@*.[join [lrange [split $uhost .] end-2 end] .]"
} elseif {$XllenX == 5 && $llen == 3} { set bmask "*!*@*.[join [lrange [split $uhost .] 1 end] .]"
} else { set bmask $target14 }
if {![ischanban $bmask $chan]} { pushmode $chan +b $bmask }
}
qkick $chan $nick "«--Please Dont Impersonate/Abuse Chanop Nicks Thank You--»"
}
}
}
}
}
proc wildcard {text} {
set sep {*}
set reg $sep
for {set i 0} {$i<=[string length $text]} {incr i} {
append reg [string index $text $i]$sep
}
return $reg
}
bind PUB -|- !chanops ChanOpsAbuse:control
proc ChanOpsAbuse:control {nick uhost hand chan arg} {
if {![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr $hand o|o $chan]} { return 0 }
switch -nocase -- [lindex [split $arg] 0] {
on {
if {[channel get $chan chanopsabuse]} {
putserv "NOTICE $nick :chanopsabuse checker is already enabled on $chan."
} else {
channel set $chan +chanopsabuse
putserv "NOTICE $nick :chanopsabuse checker is now enabled."
}
}
off {
if {![channel get $chan chanopsabuse]} {
putserv "NOTICE $nick :chanopsabuse checker is already disabled on $chan."
} else {
channel set $chan -chanopsabuse
putserv "NOTICE $nick :chanopsabuse checker is now disabled."
}
}
}
}
setudef flag chanopsabuse
bind cron - {* * * * *} chanops:abuse:cron
proc chanops:abuse:cron {min hour day month weekday} {
global ChanOpsList
if {[info exists ChanOpsList]} { unset ChanOpsList }
foreach chan [channels] {
if {![channel get $chan chanopsabuse] || ![botisop $chan]} continue
foreach member [chanlist $chan] {
if {[isop $member $chan] || [ishalfop $member $chan] || [matchattr [nick2hand $member] o|o $chan]} {
if {![regexp -nocase {^darkness$} $member]} { lappend ChanOpsList($chan) $member }
}
}
}
}
putlog "ChanOps-Abuse.tcl loaded"
Code: Select all
bind sign - * ChanOpsList:Quit-checker
proc ChanOpsList:Quit-checker {nick uhost hand chan reason} {
global ChanOpsList
if {[info exists ChanOpsList($chan)]} { do stuff }
}
bind part - * ChanOpsList:Part-checker
proc ChanOpsList:Part-checker {nick uhost hand chan text} {
global ChanOpsList
if {[info exists ChanOpsList($chan)]} { do stuff }
}
Code: Select all
set ChanOpsList($chan) [lreplace $ChanOpsList($chan) [lsearch $ChanOpsList($chan) $nick] [lsearch $ChanOpsList($chan) $nick]]
Code: Select all
set pos [lsearch -nocase $ChanOpsList($chan) $nick]
if {$pos > -1} {
set ChanOpsList($chan) [lreplace $ChanOpsList($chan) $pos $pos]
}