BanList Sweep — File Browser

BanListSweepv1.0 / BanListSweepv1.0 / bansweep.mrc

bansweep.mrc — 8.27 KB — Download this file

on 1:LOAD: {
  .timer 1 10 .enable #start
  if ($version < 5.4) { echo -a 11,1*Banlist1,11Sweep*4,15 Sorry, but you have mIRC version $version $+ , and will have to upgrade to at least version 5.4 or higher for this script to function. }
  if ($version < 5.4) { echo -a 11,1*Banlist1,11Sweep*2,15 Script Disabled | .disable #banlistfull | goto step2 }
  if ($exists($mircdirbnswpreadme.txt) = $false) { echo -a 11,1*Banlist1,11Sweep*10,15 Thank you for choosing BanList Sweep. In order to enable the "Help" function please move the file titled 2"bnswpreadme.txt"10 into your base mirc folder. It will provide important instructions on the use of this script, as well as explain its purpose, and all of its functions. | goto step }
  if ($exists($mircdirbnswpreadme.txt) = $false) { echo -a 11,1*Banlist1,11Sweep*10,15 Although it is possible for mIRC to automatically move the file into the proper folder, I frown upon making a script that automatically makes such changes to your hard drive. Be wary of such scripts, as there are those with malicious intent who would do harm to your computer. | goto step }
  run $mircdirbnswpreadme.txt
  :step
  .enable #banlistfull
  .enable #banlistsweepversion
  set %serverbans Yes
  set %chanservbans Yes
  set %bansremove 10
  goto end
  :step2
  .disable #banlistsweepversion
  set %serverbans Yes
  set %chanservbans Yes
  set %bansremove 10
  :end
}
#start off
on 1:START: {
  if ($version >= 5.4) { 
    .enable #banlistfull
    .enable #banlistsweepversion
    echo -a 11,1*Banlist1,11Sweep*4,15 mIRC Version $version detected.
    echo -a 11,1*Banlist1,11Sweep*2,15 Script Enabled
  }
  if ($version < 5.4) { 
    .disable #banlistfull
    .disable #banlistsweepversion
    echo -a 11,1*Banlist1,11Sweep*4,15 Script is loaded, but will not function on you current version of $version $+ . It is recommended that you upgrade to at least mirc version 5.4
    echo -a 11,1*Banlist1,11Sweep*2,15 Script Disabled
  }
}
#start end
#banlistfull on
raw 478:*: {
  if ($me !isop $2) { halt }
  .enable #cleanbanlist | set %bannumber 0 | /mode $2 +b | set %reban $3
  if (%chanservbans = Yes) && (%serverbans = Yes) { /msg $2 11,1*Banlist1,11Sweep*1,994 Banlist is full, performing maintenance. 1All Server and ChanServ bans will be removed, along with the %bansremove oldest bans. | /echo @PervScan_Violations 1,4Banlist Sweep $fulldate } 
  if (%chanservbans = Yes) && (%serverbans = No) { /msg $2 11,1*Banlist1,11Sweep*1,994 Banlist is full, performing maintenance. 1All ChanServ bans will be removed, along with the %bansremove oldest bans. | /echo @PervScan_Violations 1,4Banlist Sweep $fulldate }
  if (%chanservbans = No) && (%serverbans = Yes) { /msg $2 11,1*Banlist1,11Sweep*1,994 Banlist is full, performing maintenance. 1All Server bans will be removed, along with the %bansremove oldest bans. | /echo @PervScan_Violations 1,4Banlist Sweep $fulldate }
  if (%chanservbans = No) && (%serverbans = No) { /msg $2 11,1*Banlist1,11Sweep*1,994 Banlist is full, performing maintenance. 1The %bansremove oldest bans will be removed. | /echo @PervScan_Violations 1,4Banlist Sweep $fulldate }
  .disable #banlistfull
}
#banlistfull end
raw 368:*:/clearbans | .disable #cleanbanlist
#cleanbanlist off
raw 367:*: {
  inc %bannumber
  set %banchan $2
  goto banholdcheck
  :return
  if ($4 = ChanServ) && (%chanservbans = Yes) { /mode $2 -b $3 | goto end }
  if (.net isin $4) || (.com isin $4) || (.org isin $4) && (%serverbans = Yes) { /mode $2 -b $3 | goto end }
  set % [ $+ [ unban [ $+ [ %bannumber ] ] ] ] $3
  goto end
  :banholdcheck
  set  %unbann 1
  :loop
  if ($3 = $gettok(%nounban,%unbann,32)) { /echo -a 11,1*Banlist1,11Sweep*1,992 $gettok(%nounban,%unbann,32) 10 is a protected ban, and will not be removed. | dec %bannumber | goto end }
  if ($gettok(%nounban,%unbann,32) = $null) { goto return }
  inc %unbann
  goto loop
  :end
  halt
}
#cleanbanlist end
#banevent off
on 1:UNBAN:#: if ($knick = %tempunban) { msg %banchan 11,1*Banlist1,11Sweep*2,15(By Thinline)1,99:4 Maintenence Sweep Complete. | if (%reban != $null) { /mode %banchan +b %reban } | unset %unban* %reban %banchan %tempunban %bannumber %bancounter | .disable #banevent | .enable #banlistfull }
#banevent end
;--------------------------Aliases------------------------
alias -l clearbans {  
  set %bancounter 1
  :loop
  if (%bannumber < 1) { goto end }
  if (%bancounter > %bansremove) { goto end }
  if (% [ $+ [ unban [ $+ [ %bannumber ] ] ] ] = $null) { goto step }
  /mode %banchan -b % [ $+ [ unban [ $+ [ %bannumber ] ] ] ]
  set %tempunban % [ $+ [ unban [ $+ [ %bannumber ] ] ] ]
  :step
  dec %bannumber
  inc %bancounter
  goto loop
  :end
  .enable #banevent
}
alias -l nounban {
  set %unban 1
  aline -l @BanList_Sweep 10 These are bans which the script will *not* remove
  aline -l @BanList_Sweep 2 Double click 10on a ban to remove it from the list
  aline -l @BanList_Sweep 99 ------------------
  if ($gettok(%nounban,%unban,32) = $null) { aline -l @BanList_Sweep 4You currently have no bans in the protection list. | goto end }
  :loop
  aline -l @BanList_Sweep 4 $gettok(%nounban,%unban,32)
  inc %unban
  if ($gettok(%nounban,%unban,32) = $null) { goto end }
  goto loop
  :end
}
;---------------------------Popups----------------------------
#banlistsweepversion on
Menu Channel {
  $iif($me isop $chan,BanList Sweep)
  .Manual BanList Sweep %bnswpdisable2: {
    if ($version < 5.4) { halt }
    if (%chanservbans = Yes) && (%serverbans = Yes) { /msg $chan 11,1*Banlist1,11Sweep*1,994 Performing maintenance. 1All Server and ChanServ bans will be removed, along with the %bansremove oldest bans. } 
    if (%chanservbans = Yes) && (%serverbans = No) { /msg $chan 11,1*Banlist1,11Sweep*1,994 Performing maintenance. 1All ChanServ bans will be removed, along with the %bansremove oldest bans. }
    if (%chanservbans = No) && (%serverbans = Yes) { /msg $chan 11,1*Banlist1,11Sweep*1,994 Performing maintenance. 1All Server bans will be removed, along with the %bansremove oldest bans. }
    if (%chanservbans = No) && (%serverbans = No) { /msg $chan 11,1*Banlist1,11Sweep*1,994 Performing maintenance. 1The %bansremove oldest bans will be removed. }
    .enable #cleanbanlist | set %bannumber 0 | /mode $chan +b
  }
  .Options
  ..Protected Bans
  ...Add to List: {
    set %banhold.add $?="Enter ban you wish to protect"
    set %addtest 1
    :loop
    if ($gettok(%nounban,%addtest,32) = $null) { set %nounban %nounban %banhold.add | goto end }
    if (%banhold.add = $gettok(%nounban,%addtest,32)) { goto end }
    inc %addtest
    goto loop
    :end
  }
  ...View List: if ($version >= 5.4) { window -l @BanList_Sweep | /nounban }
  ..Remove All Server Bans? (Currently: %serverbans $+ )
  ...Yes: if ($version >= 5.4) { set %serverbans Yes }
  ...No: if ($version >= 5.4) { set %serverbans No }
  ..Remove All ChanServ Bans? (Currently: %chanservbans $+ )
  ...Yes:set %chanservbans
  ...No:set %chanservbans No
  ..Number of bans to remove (Currently %bansremove $+ ):set %bansremove $?="Enter number of bans to remove with sweep"
  .Help: {
    if ($exists($mircdirbnswpreadme.txt) = $false) { echo -a 11,1*Banlist1,11Sweep*10,99 The help file 2bnswpreadme.txt10 that was included with this script, is not in the base mIRC folder. Please place the file in your base mIRC folder to enable the help function. }
    if ($exists($mircdirbnswpreadme.txt) = $true) { run $mircdirbnswpreadme.txt }
  }
}
#banlistsweepversion end
menu @BanList_Sweep {
  dclick {
    if ($strip($line(@BanList_Sweep,$1)) = These are bans which the script will *not* remove) { goto end }
    if ($strip($line(@BanList_Sweep,$1)) = Double click on a ban to remove it from the list) { goto end }
    if ($strip($line(@BanList_Sweep,$1)) = ------------------) { goto end }
    if ($strip($line(@BanList_Sweep,$1)) = You currently have no bans in the protection list.) { goto end }
    set %banlist.hold $strip($line(@BanList_Sweep,$1))
    set %yousure $?!="Are you sure you want to remove this ban from the Protected Ban List?"
    if (%yousure = $true) { %nounban = $remove(%nounban,%banlist.hold) | unset %banlist.hold %yousure | clear @BanList_Sweep | nounban }
    :end
  }
}