mIRC Homepage
Posted By: TheArkNet Channel Closure Script - 20/06/19 09:48 PM
I'm working on creating a script for my IRCops/Net Admins and I'm having issues with a channel closure script.

I had this script years ago but have been unable to find it what I'm wanting it to do:

When the IRCop needs to close a channel they activate a menu option to enable the script
It asks them for the channel they need to close

Once they input the chan name the script should join them to the channel send a message -oaqvvh everyone on the channel send a message that the channel is in violation of the TOS for the network change the topic set modes msuk on the channel drop the channel from chanserv registration and then kick everyone from the channel with the reason $chan has been closed due to violation of TOS.

I had something close to working but it kept crashing out on me when I ran it.

For anyone who was around back in the MSN chat days think of when the Sysops would come in and close rooms that's similar to what I'm looking for.

Thanks.
Posted By: Raccoon Re: Channel Closure Script - 21/06/19 04:07 AM
Please type up an example list of every command the script will issue, in sequence, as if you had to type it out by hand.
Posted By: TheArkNet Re: Channel Closure Script - 22/06/19 01:43 AM
/join <Channel Input>
/mode <channel input> -oaq every nick that's opped on the channel
/msg <channel input> 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.
/mode <channel input> +musk Random Key
/cs drop <channel input> <channel input>
/kick <channel> every user on channel
/part <channel input>

Thanks
Posted By: Raccoon Re: Channel Closure Script - 22/06/19 03:02 AM
Does your ChanServ services have a CLEAR USERS and CLEAR BANS feature?
Posted By: Raccoon Re: Channel Closure Script - 22/06/19 03:41 AM
Code
; 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
    return
  }
  ; -----
  
  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 $+ )
  CS CLEAR %chan USERS
  CS CLEAR %chan BANS
  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
Posted By: TheArkNet Re: Channel Closure Script - 23/06/19 03:37 PM
Hi Racoon,

Thanks for the help! I did some testing and this is what I got back:

<~Admin_Luka> 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: Violation of TheArkNet TOS)
>>> [mode/#Blah] Admin_Luka(+smiuk xhzxxqfeez)
>>> [mode/#Blah] ChanServ(-r)
>>> [part/#Blah] Admin_Luka(NetAdmin@TheArkNet.xyz)

It didn't remove any of the other users modes or kick them.

I don't have the commands you asked about in the last post. I'm using Anope with standard modules. I do have the suspend option in the cs.

Thanks.
Posted By: Wims Re: Channel Closure Script - 23/06/19 04:03 PM

Code
; 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
    return
  }
  ; -----
  
  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 CLEAR %chan USERS
  CS CLEAR %chan BANS
  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?
Posted By: Raccoon Re: Channel Closure Script - 24/06/19 08:50 PM
Anope does support the CLEAR command, as well as others intended for closing channels, like SERVERADMIN SUSPEND and SERVERADMIN FORBID.
See the help documentation @ https://www.anope.org/docgen/1.8/en_us/ChanServ.html
© mIRC Discussion Forums