mIRC Home    About    Download    Register    News    Help

Print Thread
Channel Closure Script #265623 20/06/19 09:48 PM
Joined: Jun 2019
Posts: 6
T
TheArkNet Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2019
Posts: 6
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.

Re: Channel Closure Script [Re: TheArkNet] #265624 21/06/19 04:07 AM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
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.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Channel Closure Script [Re: Raccoon] #265628 22/06/19 01:43 AM
Joined: Jun 2019
Posts: 6
T
TheArkNet Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2019
Posts: 6
/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

Last edited by TheArkNet; 22/06/19 01:43 AM.
Re: Channel Closure Script [Re: TheArkNet] #265629 22/06/19 03:02 AM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
Does your ChanServ services have a CLEAR USERS and CLEAR BANS feature?


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Channel Closure Script [Re: TheArkNet] #265630 22/06/19 03:41 AM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Channel Closure Script [Re: Raccoon] #265637 23/06/19 03:37 PM
Joined: Jun 2019
Posts: 6
T
TheArkNet Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2019
Posts: 6
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.

Last edited by TheArkNet; 23/06/19 03:49 PM.
Re: Channel Closure Script [Re: TheArkNet] #265638 23/06/19 04:03 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559

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?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Channel Closure Script [Re: TheArkNet] #265642 24/06/19 08:50 PM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!