| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Jul 24, 2018 3:33 am Post subject: |
|
|
tested again it seems to work for
SlMO Sets Mode on #Test to: +b *!*uid306017@id-306017.charlton.irccloud.com
@Cappuccino Sets Mode on #Test to: -b+b *!*uid306017@id-306017.charlton.irccloud.com *!*uid306017@*
but not for
SlMO Sets Mode on #Test to: +b *!*@id-306017.charlton.irccloud.com
@Cappuccino Sets Mode on #Test to: -b *!*@id-306017.charlton.irccloud.com
since last one has ident in host as well wich is the same as having it set with ident as well in other words if possible it would help if it would set ident as well when +b *!*@id-306017.charlton.irccloud.com is set to trigger as well since it has unique id of user in it as well
other than that it seems fine
thank you caesar
Last edited by simo on Tue Jul 24, 2018 3:46 am; edited 1 time in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Jul 24, 2018 3:42 am Post subject: |
|
|
Nothing happens on:
| Code: |
SlMO Sets Mode on #Test to: +b *!*@id-306017.charlton.irccloud.com
@Cappuccino Sets Mode on #Test to: -b *!*@id-306017.charlton.irccloud.com
|
for two reasons:
#1. If you look at this example you gave earlier (1-2 pages back):
| Code: |
[19:08] * Joins: OnT (uid1420156@id-140156.ealing.irccloud.com)
[19:10] * user1 sets mode: +b *!*@id-140156.ealing.irccloud.com
|
you will notice that the number in uid1420156 is not equal with the number taken from id-140156.ealing.irccloud.com, meaning 1420156 is not equal with 140156.
Is this a copy/paste mistake or something?
#2. From the snippet I posted about Identifying users the user can start with uid (for example uid123456) for regular members and sid (for example sid123456) for paid users, so what should you ban in this case?
When placing a ban on *!*@id-306017.charlton.irccloud.com we can lookup what members match this address but what if it matches multiple members? You didn't want that.
I guess we can lookup what members have uid306017 or sid306017 in their user, but what if it also matches more than one member?
To make it trigger on bans like: *!*@id-306017.charlton.irccloud.com or *!*uid306017@id-306017.charlton.irccloud.com try it with replacing:
| Code: |
if {[regexp {\d+} $u x]} {
if {[regexp {id-(\d+).(.*?).irccloud.com} $h - y]} {
if {[string equal $x $y]} {
pushmode $ch +b "*!$u@*"
}
}
}
|
with:
| Code: |
if {[regexp {id-(\d+).(.*?).irccloud.com} $h - x]} {
foreach n [chanlist $ch] {
if {[isbotnick $n]} continue
if {[isop $n $ch] || [isvoice $n $ch] || [validuser [nick2hand $n]]} continue
scan [getchanhost $n $ch] {%[^@]@%s} user host
if {[regexp {\d+} $user y]} {
if {[string equal $x $y]} {
pushmode $ch +b "*!$user@*"
}
}
}
}
|
Or even better can add another regexp that will first check if the user part in the ban matches the sid/uid pattern and set a ban on whatever is there, basically triggering on *!*uid306017@id-306017.charlton.irccloud.com or *!uid306017@1.2.3.4 and setting a ban on *!*uid306017@* or *!uid306017@* respectively instead. So, the code becomes:
| Code: |
if {[regexp {[su]id\d+} $u]} {
pushmode $ch +b "*!$u@*"
} elseif {[regexp {id-(\d+).(.*?).irccloud.com} $h - x]} {
foreach n [chanlist $ch] {
if {[isbotnick $n]} continue
if {[isop $n $ch] || [isvoice $n $ch] || [validuser [nick2hand $n]]} continue
scan [getchanhost $n $ch] {%[^@]@%s} user host
if {[regexp {\d+} $user y]} {
if {[string equal $x $y]} {
pushmode $ch +b "*!$user@*"
}
}
}
}
|
Haven't tested anything so let me know the results. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Jul 24, 2018 7:34 am Post subject: |
|
|
tested it seems to work as intented
tnx caesar much apreciated |
|
| Back to top |
|
 |
gamble27 Halfop
Joined: 05 Aug 2008 Posts: 71
|
Posted: Wed Jun 03, 2020 1:48 pm Post subject: Final version |
|
|
| Hey simo, can I have the final version of this tcl? Much appreciated. Anyone using final version of this please share. Thank you. [/quote] |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|