[19:08] * Joins: OnT (uid1420156@id-140156.ealing.irccloud.com)
[19:10] * user1 sets mode: +b *!*@id-140156.ealing.irccloud.com
[19:10] * eggdrop1 sets mode: -b+b *!*@id-140156.ealing.irccloud.com *!*@*
[19:08] * Joins: OnT (uid1420156@id-140156.ealing.irccloud.com)
[19:10] * user1 sets mode: +b *!*@id-140156.ealing.irccloud.com
[19:10] * eggdrop1 sets mode: -b+b *!*@id-140156.ealing.irccloud.com *!*@*
Code: Select all
pushmode $ch +b "*!$u@*"
Code: Select all
foreach user [chanlist $ch] {
if {[isbotnick $user]} continue
if {[isop $user $ch] || [isvoice $user $ch] || [validuser [nick2hand $user]]} continue
scan [getchanhost $user $ch] {%[^@]@%s} uid host
if {[string equal $h $host]} {
pushmode $ch +b "*!$uid@*"
}
}
the only problem with that tho is if multi users match the same host wich is in the case of users with hosts like:This way will set a ban for all idents that match that host with the exception of channel operators or voiced and known users. Give this a try and reply back.
enforceban tcl shouldnt be used in this case as it will ban any matchingLet's say you place that *!*@*.irccloud.com ban, if you got enforcebans set on a channel the bot it will kick all members matching that mask anyway, else if a user that matches the ban can't leave and rejoin the channel.
hiring other ops wont change that*!*@highgate.irccloud.com
*!*@brockwell.irccloud.com
In your example:Identifying users
Each user can be uniquely identified for the purpose of bans, etc. by their ident-verified username, in the form [u|s]id[UID] (eg: uid123 for a free user or sid456 for a paid subscriber). Users are unable to change their user IDs.
Code: Select all
[19:08] * Joins: OnT (uid1420156@id-140156.ealing.irccloud.com)
[19:10] * user1 sets mode: +b *!*@id-140156.ealing.irccloud.com
Code: Select all
if {[regexp {\d+} $u x]} {
if {[regexp {id-(\d+).(.*?).irccloud.com} $h - y]} {
if {[string equal $x $y]} {
pushmode $ch +b "*!$u@*"
}
}
}
Code: Select all
## ircCloudBan v.0.2 ##
set ircSkip {
*.irccloud.com
irccloud.com
192.184.9.108
192.184.9.110
192.184.9.112
192.184.10.118
192.184.10.9
192.184.8.73
192.184.8.10
2001:67c:2f08*
2001*67c*2f08*
}
bind mode - "#% +b" ircCloudBan
bind kick - * ircCloudKick
proc ircCloudBan {nk uh hn ch md banmask} {
if {![botisop $ch]} return
global ircSkip
set match 0
scan $banmask {%[^!]!%[^@]@%s} n u h
foreach host $ircSkip {
if {![string match -nocase $host $h]} continue
incr match
break
}
if {$match} {
pushmode $ch -b $banmask
set ::irccloudban $banmask
}
}
proc ircCloudKick {nk uh hn ch target why} {
if {![info exists ::irccloudban]} return
if {![botisop $ch]} return
set chhost [getchanhost $target $ch]
global ircSkip
set match 0
if {[scan $chhost {%[^@]@%s} u h] != 2} return
foreach host $ircSkip {
if {![string match -nocase $host $h]} continue
incr match
break
}
if {$match} {
if {[regexp {\d+} $u x]} {
if {[regexp {id-(\d+).(.*?).irccloud.com} $h - y]} {
if {[string equal $x $y]} {
pushmode $ch +b "*!$u@*"
}
}
}
}
unset ::irccloudban
}
Code: Select all
if {[regexp {\d+} $u x]} {
if {[regexp {id-(\d+).(.*?).irccloud.com} $h - y]} {
if {[string equal $x $y]} {
pushmode $ch +b "*!$u@*"
}
}
}
Code: Select all
pushmode $ch -b $banmask
Code: Select all
if {$match} {
pushmode $ch +b "*!$u@*"
}
Code: Select all
if {$match} {
if {[regexp {[su]id\d+} $u]} {
pushmode $ch +b "*!$u@*"
}
}
When the *!*@id-140156.ealing.irccloud.com ban is set the bot will check if ident has a number in it, in our case will fail because * is not a number thus will stop.[19:08] * Joins: OnT (uid1420156@id-140156.ealing.irccloud.com)
[19:10] * user1 sets mode: +b *!*@id-140156.ealing.irccloud.com
Code: Select all
## ircCloudBan v.0.3 ##
set ircSkip {
*.irccloud.com
192.184.9.108
192.184.9.110
192.184.9.112
192.184.10.118
192.184.10.9
192.184.8.73
192.184.8.10
2001:67c:2f08*
2001*67c*2f08*
}
bind mode - "#% +b" ircCloudBan
bind kick - * ircCloudKick
proc ircCloudBan {nk uh hn ch md banmask} {
if {![botisop $ch]} return
global ircSkip
set match 0
scan $banmask {%[^!]!%[^@]@%s} n u h
foreach host $ircSkip {
if {![string match -nocase $host $h]} continue
incr match
break
}
if {$match} {
pushmode $ch -b $banmask
if {[regexp {\d+} $u x]} {
if {[regexp {id-(\d+).(.*?).irccloud.com} $h - y]} {
if {[string equal $x $y]} {
pushmode $ch +b "*!$u@*"
}
}
}
set ::irccloudban $banmask
}
}
proc ircCloudKick {nk uh hn ch target why} {
if {![info exists ::irccloudban]} return
if {![botisop $ch]} return
set chhost [getchanhost $target $ch]
global ircSkip
set match 0
if {[scan $chhost {%[^@]@%s} u h] != 2} return
foreach host $ircSkip {
if {![string match -nocase $host $h]} continue
incr match
break
}
if {$match} {
if {[regexp {[su]id\d+} $u]} {
pushmode $ch +b "*!$u@*"
}
}
unset ::irccloudban
}
Code: Select all
[08:51] * cez sets mode: +b *!*@charlton.irccloud.com
[08:51] * Bot sets mode: -b *!*@charlton.irccloud.com
Code: Select all
[08:52] * cez sets mode: +b *!uid311697@charlton.irccloud.com
[08:52] * Bot sets mode: -b *!uid311697@charlton.irccloud.com
Code: Select all
[08:53] * cez sets mode: +b *!uid306017@id-306017.charlton.irccloud.com
[08:53] * Bot sets mode: -b+b *!uid306017@id-306017.charlton.irccloud.com *!uid306017@*
Code: Select all
[08:53] * cez sets mode: -b *!uid306017@*
[08:53] * cez sets mode: +b *!uid306017@id-306018.charlton.irccloud.com
[08:53] * Bot sets mode: -b *!uid306017@id-306018.charlton.irccloud.com