| View previous topic :: View next topic |
| Author |
Message |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Fri Jun 17, 2016 10:37 pm Post subject: |
|
|
| simo wrote: | looks to be working good caesar
is it possible to have it also remove ban on all channels if a ban is removed |
You'd have to
| Code: | | bind mode - "% -b" [namespace current]::banRemoval |
and track either only the bans the bot placed, or all of the bans on each channel. It would require building another proc (named banRemoval) to do the opposite of what the enforce procedure does. _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Jun 18, 2016 4:45 pm Post subject: |
|
|
| i dont know how too i tried few things but didnt work |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue May 25, 2021 12:47 pm Post subject: |
|
|
i tested your script again ceasar when setting bans on weird chars of nicks and that gave me an error:
&ChanServ Sets Mode on #shqiperia to: +b *[*!*@*
18:44:37 (1 User) is Banned [hjsdd]
wich should have kicked [hjsdd]
but instead returned error: Tcl error [::enforceBans::enforce]: wrong # args: should be "incr varName ?increment?" |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed May 26, 2021 2:18 am Post subject: |
|
|
Ah, there's a space between - and $enforce(max), just remove it in:
| Code: |
incr len - $enforce(max)
|
like:
| Code: |
incr len -$enforce(max)
|
As for this:
| simo wrote: | looks to be working good caesar
is it possible to have it also remove ban on all channels if a ban is removed |
Add this in the namespace of the other code:
| Code: |
bind mode - "% -b" [namespace current]::banRemoval
proc banRemoval {nick uhost hand chan mc ban} {
foreach ch [channels] {
if {![botisop $ch]} continue
if {[ischanban $ban $ch]} {
pushmode $ch -b $ban
}
}
}
|
Haven't tested so let me know if works (or doesn't) as intended. _________________ 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: Wed May 26, 2021 9:58 am Post subject: |
|
|
thanks for the reply caesar i changed what u suggested but now when trying to
ban like:
15:56:09 &ChanServ Sets Mode on #shqiperia to: +b *[*!*@*
15:56:09 (1 User) is Banned [dsqw]ccno
wich should have kicked out [dsqw]ccno
but it didnt trigger and no errors |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed May 26, 2021 10:26 am Post subject: |
|
|
Right, let's give matchaddr a try then by replacing:
| Code: |
if {![string match -nocase $ban $n![getchanhost $n $c]]} continue
| with: | Code: |
if {![matchaddr $ban $n![getchanhost $n $c]]} continue
|
See if this works and reply back. _________________ 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: Wed May 26, 2021 11:41 am Post subject: |
|
|
excellent that seems to work in all conditions thanks caesar
i also tested the one for removal and that seems to work as well
much apreciated caesar |
|
| Back to top |
|
 |
|