; Oper Tools for TheArkNet
; by Raccoon 2019

; This script assumes that opers are not subject to excess flood disconnect.
; You can access this tool from menu by right-clicking the channel chat area.
; Actions are logged to operclosechan.log
; Example: /operclosechan #badchan You guys are misbehaving!

; /OperCloseChan <#channel_name> <reason_required>
ALIAS OperCloseChan {
  var %chan = $1, %reason = $2-
  if (!%chan) { echo -atic notice * Usage: /OperCloseChan #channel_name This channel is closed due to violation. | return }
  if (!%reason) { echo 4 -ati * OperCloseChan: You MUST specify a reason for closing the channel! | return }
  if ($left(%chan,1) !isin $chantypes) { echo 4 -ati * OperCloseChan: %chan is an invalid channel name! | return }
  if ($me !ison %chan) {
    set -eu10 %_operclosechan. $+ %chan %reason
    !JOIN %chan
  ; -----
  MSG %chan This channel has been determined to be in violation of the terms of service for this network and is being closed. $&
    If you have any questions please join #Help and speak to an IRCop.  (Reason: %reason $+ )
 var %x 1,%maxk 1,%kn
  while ($nick(%chan,%x)) {
    %kn = $addtok(%kn,$v1,44)
     if ($numtok(%kn,44) == %maxk) { 
       kick %chan %kn
       %kn =
    inc %x
  if (%kn) kick %chan %kn[/b]
  CS DROP %chan %chan
  MODE %chan +muski $regsubex(randomstring,$str(x,10),/x/g,$r(a,z))
  PART %chan
  echo -stic info * OperCloseChan: Closed channel %chan for %reason
  write operclosechan.log $asctime %chan %reason
} ; by Raccoon 2019

; End of /NAMES (you joined a channel)
RAW 366:*: {
  var %chan = $2
  if ($($+(%,_operclosechan.,%chan),2)) {
    unset $+(%,_operclosechan.,%chan)
    OperCloseChan %chan $v1
  ; ...
} ; by Raccoon 2019

MENU Channel {
  Oper Tools
  .Close Channel: {
    OperCloseChan $&
      $$input(Enter channel to permanently close.,ews,$active,Oper Tools: Close Channel,$active) $&
      $$input(Enter reason for closing the channel.,ews,$active,Oper Tools: Close Channel)
; by Raccoon 2019

; eof

I added a bit to kick everyone from the channel, if the user doing it is oper, i don't see anything preventing him from kicking so removing -qao seems not necessary?

Looking for a good help channel about mIRC? Check #mircscripting @