Snippets Project Page
Author: entropy
Added: 5y
Updated: 5y
mIRC: 7.52+
Hits: 1,422
Downloads: 15
Review: entropy
Size: 831B
1 0
Login to vote.
Unban The Oldest Ban
v1.1
This snippet like the title says, unbans the oldest bans when ban list is full.
Download
JSON
▲ Review
▲ Log
▼ Source
; Unban The Oldest Ban, when ban list is full.. v1.0 - by entropy 2018 raw 5:*:{ var %z = $wildtok($1-,*MAXLIST=b:*,1,32), %x = $wildtok($1-,*MAXLIST=bqeI:*,1,32), %y = $wildtok($1-,*MAXLIST=beI:*,1,32) if (*MAXLIST=b:* iswm $1-) { set -e $+(%,$network,.,maxbans) $remove($gettok($gettok(%z,2,61),1,44),b:) } elseif (*MAXBANS=* iswm $11) { set -e $+(%,$network,.,maxbans) $gettok($11,2,61) } elseif (*MAXLIST=bqeI:* iswm $1-) { set -e $+(%,$network,.,maxbans) $remove($gettok($gettok(%x,2,61),1,44),bqeI:) } elseif (*MAXLIST=beI:* iswm $1-) { set -e $+(%,$network,.,maxbans) $remove($gettok($gettok(%y,2,61),1,44),beI:) } } on *:disconnect:{ unset $+(%,$network,.,maxbans) } on @*:ban:#:{ if ($eval($+(%,$network,.,maxbans),2) == $ibl(#,0)) { mode # -b $ibl(#,$ibl(#,0)) } }
Changelog:
v1.1 (11-13-18)
- Aded "-e" to the /set lines and removed the "on *:exit:{}".
v1.1 (11-13-18)
- Aded "-e" to the /set lines and removed the "on *:exit:{}".
Comments (1)
Nov 12th, 2018 - By: Ouims
Moderator
You can use set -e and get rid of the on exit event.
But what's the point in unbanning the last ban when the banlist is full? because any other next ban will trigger this and it's just an infinite cycle.
Also you may improve the if/elseif army to get the max ban value by using a simple regular expression.
But what's the point in unbanning the last ban when the banlist is full? because any other next ban will trigger this and it's just an infinite cycle.
Also you may improve the if/elseif army to get the max ban value by using a simple regular expression.
Reply: