mIRC Home    About    Download    Register    News    Help

Print Thread
A
AntP
AntP
A
I would like to have a script which will remove the bans of the banlist which remain there for 30 minutes.
In other words, I would like the script to remove every ban that have reach a time of 30 minutes remaining in the ban list.
Could anyone please help?

Attention!!! I do not mean a PERSONAL REMOVAL script. I mean every ban that is set in the ban list !

Last edited by AntP; 30/06/13 04:10 PM.
Joined: Nov 2009
Posts: 295
P
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
Give this a shot. You should just have to change #chan to the channel you want it to work in and then rejoin the chan. It'll check the ban list every 5 minutes and remove bans older than 30 minutes automatically. It'll only work in one channel as is but could be edited to work in multiple chans.

P.S. you can add nicks/hosts to an exception list if you don't want their ban removed by this script.

Code:
;Example exception list, full host as used when banned separated by spaces
;%ban_except Guest*!*@* nick_here!*@* *!*@Teh.Word

on *:quit:{
  ;turn off 24 hour unban timer
  if ($nick == $me) && ($timer(bans. $+ $scid($cid).network)) .timerbans. $+ $scid($cid).network off
}

;turn off 24 unban timer
on *:part:#chan:if ($nick == $me) && ($timer(bans. $+ $scid($cid).network)) .timerbans. $+ $scid($cid).network off

on *:join:#chan:{
  ;turns on 24 hour unban timer
  if ($nick == $me) .timerbans. $+ $scid($cid).network 0 300 check_bans $chan
}

;reads the ban list
RAW 367:*:{
  if (%chkbans) && ($calc( $ctime - $5 ) > 1800 ) && (!$istok(%ban_except,$3,32)) {
    if (!%bcount) { set %bcount 0 | .timerblist 1 15 btimer $2 }
    if (%bcount <= $calc( $modespl - 1 )) { set %blist $3 %blist | inc %bcount }
    if (%bcount > $calc( $modespl - 1 )) { .timerblist off | mode $2 $+(-,$str(b,%bcount)) $($+(%,blist),2) | unset %bcount | unset %blist }
    halt
  }
  elseif (%chkbans) halt
}

RAW 368:*: if (%chkbans) halt
;ban checking alias, set on timer
alias check_bans { set -u15 %chkbans 1 | mode $1 b }
;unban alias, set on timer
alias btimer { mode $1 $+(-,$str(b,%bcount)) $($+(%,blist),2) | unset %bcount | unset %blist }


A
AntP
AntP
A
WoW!
Thank you very much pball!!
I will try it !

Joined: Nov 2009
Posts: 295
P
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
no problem. I made this some time ago for running on a channel bot I run. If anything is off let me know, this was part of a larger script and was made specifically for one thing. So it might need tweaking for other use.

A
AntP
AntP
A
It works, thank you very much!
Nevertheless, I would like something that will unban any ban that reach 30 minutes remaining in the ban list exact on 30 minutes.
I had thought of a script which would somehow save the set bans in variables and then by countdowning remove them!

Last edited by AntP; 01/07/13 09:13 PM.
Joined: Nov 2009
Posts: 295
P
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
Well you would still need some sort of timer that checks the variable every so often.

On the other hand you could change the time between checks with my script.

if ($nick == $me) .timerbans. $+ $scid($cid).network 0 300 check_bans $chan

Just change the 300 there to how many seconds between checks you'd like. The less time between checks the more this script could cause things to lag. I'd suggest setting it to 15 or 30 seconds and call that good enough.

A
AntP
AntP
A
Yes, I have already changed it ! :-)

U
Unity
Unity
U
Hello!

This script remove all the list on the banlist, in one time.

I wanna have to remove the banlist after 1hour of the bantime, one by one.

Ex:
nick1!*@* banned at 15:16:21
nick2!*@* banned at 16:21:14

=> nick1!*@* unbanned at 16:16:21
nick2!*@* unbanned at 17:21:14

Not nick1!*@* and nick2!*@* unbanned at 16:16:21.

Wish your help.

Thanks.


Link Copied to Clipboard