Channel Control Dialog 2.3

Platform:  mIRC
Published  May 21, 2012
Updated  Apr 26, 2013

Screenshots

It's advisable everyone updates to this newer release.

26th April 2013 (2.4)
** Fixed Problem with Mode Selector Buttons, Some modes were being mis-taken as set when they were not
** Added Registered Channel Item, This is NOT User-Definable and is blacked out on purpose (as +r is set by Services to define Registered Channels.

7th April 2013 (2.3)
** Fixed Issue with Topic History - will now correctly save history.

11th March 2013 (2.2c)
** Added Topic History and "Clear" and "Edit" History Button (will remember Last 9 Topics across Network/Channels)
** Fixed problem with Mode Change Buttons on networks using ModeLock via Services (Script would not catch the change, so an artificial 1 second delay has been added to catch any mode reversals)
** NOTE: Channel Topc History is saved to file "ChanContTopic.ini" under headings like [<network><channel>] eg. [Abjects#mIRC]
** Channel Blacklist Entries are saved to Network specific files, eg. "ChanContBL12-<network>.txt"

-------

This is a Channel Control Dialog, intended to replace the crappy default mIRC-style one with one which has a nice set of features, which I hope you will find useful.

This Channel Control Dialog allows you to modify the following aspects of a channel:
* Channel Mode Settings.
* Channel Key Setting.
* User Limit Setting.
* Channel Topic Setting.
* Ban List Add / Delete
* Exception List Add / Delete
* Invite List Add / Delete
* Channel BlackList Feature (Automatically Bans Matching User(s) On Channel Join)

LOADING INSTRUCTIONS:

1) You are better if you paste this into a NEW empty file, Example: ChannelControl.mrc

2) Type //run explorer $mircdir (using TWO forward slashes) into mIRC, This will open your mIRC folder, Paste the ChannelControl.mrc into that folder, and Confirm / OK any dialogs which pop-up.

3) Inside mIRC, Type /load -rs $mircdir\ChannelControl.mrc This will load the script into mIRC.

4) Goto a Channel Window (It will not work on the Status/Server Tab!), then Right-Click and select the option "Channel Control", which usually appears at the Bottom of the Channel Context Menu.

5) The Channel Control Dialog will then appear where you can Change the Channel settings.

---

Many Thanks to Thelmrac for helping me grab the Server Support Numerics (http://www.hawkee.com/phpBB2/viewtopic.php?t=23787) and Ford_Lawnmower for the FullBanList setting. ; Channel Control Dialog 2.4 by Amiga600 - To Replace The Crappy In-Built One :P
; Posted on Hawkee Script Depository: http://www.hawkee.com/snippets/user/59854/

; Files Written are:
; ChanContBL12-<networkname>.txt = Blacklist File
; ChanContTopic.ini = Channel Topic Storage File

; Best to save this as a separate file (eg. "ChanControl.mrc" then:
; 1) /run explorer.exe $mircdir - Paste the file into this directory
; 2) /load -rs ChanControl.mrc - Load's the file into mIRC
; 3) Adjust Settings in CONFIG section below
; 4) Right-Click in Channel, and Select Option "Channel Control"

; End-Users may fork, change, alter, adjust this script to thier own tastes, If you edit this script
; Please point users to this Original Script Location on Hawkee, and state you have modified your
; version from the Original, I will not offer Help/Support for modified versions for obvious reasons!

alias -l chancontconfig {
; #### CONFIGURATION SECTION START ##

; USER SETTINGS:
; Enable Dialog Only When Channel Operator (1=Only Channel Operator / 0=Enable Always)
set %chancont.enableonlyifop 0

; #### CONFIGURATION SECTION END - DO _NOT_ ALTER BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ##
}

dialog chancontrol {
title "Channel Control"
size -1 -1 375 200
option dbu
tab "General Settings", 1, 2 4 369 172
edit "", 2, 10 55 145 65, tab 1 multi autovs limit 500
text "Channel Topic:", 3, 13 46 39 8, tab 1
text "Channel Creation Date:", 4, 13 21 130 8, tab 1
edit "-", 5, 11 30 189 10, tab 1 read autohs center
text "Channel Key:", 8, 262 21 48 8, tab 1
edit "", 9, 261 30 55 10, tab 1 limit 30 center
edit "", 10, 327 30 29 10, tab 1 limit 3 center
text "User Limit:", 11, 328 21 27 8, tab 1
text "Channel Modes:", 13, 209 21 41 8, tab 1
text "Topic Length:", 31, 118 148 34 8, tab 1
button "Update Channel Topic", 39, 10 124 143 12, tab 1
edit "", 12, 208 30 43 10, tab 1 limit 20 center
edit "-", 14, 154 147 45 10, tab 1 read center
button "Set Mode(s)", 15, 209 41 42 10, tab 1
button "Set", 16, 262 41 27 10, tab 1
button "Set Limit", 23, 328 41 27 10, tab 1
button "Un-Set", 24, 292 41 24 10, tab 1
text "Common Channel Modes:", 49, 209 61 65 8, tab 1
check "Protected Topic (t)", 50, 210 75 65 10, tab 1
check "No External Msgs (n)", 51, 210 86 67 10, tab 1
check "Moderated (m)", 52, 210 97 47 10, tab 1
check "Secret (s)", 53, 210 108 50 10, tab 1
check "Private (p)", 54, 210 119 50 10, tab 1
check "Invite Only (i)", 55, 210 130 50 10, tab 1
edit "", 90, 205 153 162 18, tab 1 read multi autovs center
text "Set By:", 67, 10 149 19 8, tab 1
text "Date:", 68, 10 161 18 8, tab 1
edit "-", 69, 33 147 82 10, tab 1 read center
edit "-", 70, 33 160 166 10, tab 1 read center
text "IRCd Version Information:", 21, 207 144 85 8, tab 1
check "No Nickname Change (N)", 66, 287 75 75 10, tab 1
check "Only Reg'd Nick Speak (M)", 71, 287 86 75 10, tab 1
text "UnrealIRCd Specific Modes:", 72, 288 61 71 8, tab 1
check "Only Reg'd Can Join (R)", 73, 287 97 76 10, tab 1
check "Strip All Colors (S)", 74, 287 108 76 10, tab 1
check "G-Rated / Badword Block (G)", 75, 287 119 80 10, tab 1
list 76, 157 55 43 66, tab 1 size
text "Topic History:", 77, 162 46 38 8, tab 1
button "Clear", 78, 159 124 19 12, tab 1
button "Edit", 79, 179 124 21 12, tab 1
check "Registered Channel", 80, 89 44 62 10, disable tab 1
tab "Ban / Exception / Invite List's", 17
list 18, 6 32 117 107, disable tab 17 sort size extsel
list 19, 128 32 117 108, disable tab 17 sort size extsel
list 22, 248 32 117 109, disable tab 17 sort size extsel
text "Channel Ban List:", 26, 8 23 43 8, tab 17
text "Channel Exception List:", 27, 130 22 59 8, tab 17
text "Channel Invite List:", 28, 250 22 51 8, tab 17
edit "", 29, 52 144 220 10, tab 17 center
text "Edit Entry:", 33, 9 146 39 8, tab 17
button "Delete", 35, 322 160 44 12, disable tab 17
button "Add", 36, 321 143 44 12, disable tab 17
edit "", 37, 52 160 220 10, tab 17 read autohs center
text "Set By / Date:", 38, 9 161 39 8, tab 17
radio "Exception", 40, 280 152 37 10, disable tab 17
radio "Invite", 41, 280 162 32 10, disable tab 17
radio "Ban", 34, 280 142 26 10, disable tab 17
button "Re-Populate", 60, 62 21 39 9, tab 17
edit "-", 59, 107 20 15 10, tab 17 read center
edit "-", 61, 229 20 15 10, tab 17 read center
edit "-", 62, 349 20 15 10, tab 17 read center
tab "BlackListed Users", 6
text "BlackList On Join:", 7, 7 21 44 8, tab 6
list 25, 6 31 184 119, tab 6 size hsbar
text "Black List Ban's must always follow the USER!IDENT@HOST Format. Channel names must be separated by Spaces, and you can use #* to mean ALL Channels you are on.", 42, 197 129 169 22, tab 6
button "Add BlackList Ban", 43, 195 95 105 12, tab 6
button "Delete Selected BlackList Ban", 44, 100 153 89 12, disable tab 6
text "BlackList Ban: ( NICKNAME *OR* USER ! IDENT @ HOST )", 46, 195 28 166 8, tab 6
text "Channels To Ban This User From: (Eg. #Chat #Help or #* for ALL)", 47, 195 49 167 8, tab 6
edit "", 30, 194 37 170 10, tab 6 autohs center
edit "", 32, 194 58 170 10, tab 6 autohs center
check "Enable Delete Button", 48, 11 154 71 10, tab 6
edit "", 45, 194 80 170 10, tab 6 autohs limit 400 center
text "Blacklist Reason: (Shown when the user is Kicked Out)", 57, 195 71 164 8, tab 6
text "NOTE: You *MUST* be a Channel Operator or IRCop in order for this BlackList to work on your chosen Channels.", 56, 198 155 169 16, tab 6
check "Default Reason", 58, 309 94 50 10, tab 6
edit "-", 63, 174 19 15 10, tab 6 read center
button "Re-Populate", 64, 132 20 39 9, tab 6
text "NOTE: You can now get USER!IDENT@HOST of user by entering thier Nickname in 'BlackList Ban' and pressing 'Add BlackList Ban'", 65, 196 110 169 16, tab 6
button "Close Dialog", 20, 4 182 58 12, ok
edit "", 99, 66 182 302 12, read autohs center
}

menu channel {
-
Channel Control 2.4:/chancont
}

#chancontroldialog off
; Server-Support Numeric Handling
raw $5:/^[^ ]+ (.*)are supported by this server/i:{ tokenize 32 $regml(1) | num5-add $* | haltdef }
alias -l num5-add { hadd -m num5 $+($cid,_,$regsubex($1,/^(.*?)(=(.*))?$/,\1 $iif(\3,\3,$true))) }
alias num5 { return $iif($hget(num5,$+($iif($2,$2,$cid),_,$1)),$v1,$false) }
on *:DISCONNECT:{ if ($hget(num5)) { hdel -w num5 $+($cid,_*) } }
alias ircversion {
if ($hget(num5)) { hdel -w num5 $+($cid,_*) }
!version
}
; Other Raw Numeric Handling
raw *:*: {
if ($dialog(chancontrol).active = f) { halt }
if ($numeric == 352) {
; /Who - This attempts to get U!I@H for BlackList Dialog
did -o chancontrol 30 1 $6 $+ ! $+ $3 $+ @ $+ $4
haltdef
}
if ($numeric == 351) {
; IRCd Server Version (90=JunkBox)
did -o chancontrol 90 1 $2-
haltdef
}
if ($numeric == 332) {
; Channel Topic
did -r chancontrol 2 1
did -o chancontrol 2 1 $3-
did -o chancontrol 14 1 $len($3-)
haltdef
}
if ($numeric == 333) {
; Topic Set By / Date
did -o chancontrol 69 1 $3
did -o chancontrol 70 1 $asctime($4) ( $+ $duration($calc($ctime - $4)) ago)
haltdef
}
if ($numeric == 324) {
; Channel Modes
did -o chancontrol 12 1 $3-
if (t isincs $3) did -c chancontrol 50 1 ;Channel Topic
elseif (t !isincs $3) did -u chancontrol 50 1
if (n isincs $3) did -c chancontrol 51 1 ;No External Messages
elseif (n !isincs $3) did -u chancontrol 51 1
if (m isincs $3) did -c chancontrol 52 1 ;Moderated
elseif (m !isincs $3) did -u chancontrol 52 1
if (s isincs $3) did -c chancontrol 53 1 ;Secret
elseif (s !isincs $3) did -u chancontrol 53 1
if (p isincs $3) did -c chancontrol 54 1 ;Private
elseif (p !isincs $3) did -u chancontrol 54 1
if (i isincs $3) did -c chancontrol 55 1 ;Invite
elseif (i !isincs $3) did -u chancontrol 55 1

if (r isincs $3) did -c chancontrol 80 1 ;Registered Channel
elseif (r !isincs $3) did -u chancontrol 80 1 ;Not User Modifyable

if (N isincs $3) did -c chancontrol 66 1 ;No Nickname Change
elseif (N !isincs $3) did -u chancontrol 66 1
if (M isincs $3) did -c chancontrol 71 1 ;Only Regd Nick Speak
elseif (M !isincs $3) did -u chancontrol 71 1
if (R isincs $3) did -c chancontrol 73 1 ;Only Regd Nick Join
elseif (R !isincs $3) did -u chancontrol 73 1
if (S isincs $3) did -c chancontrol 74 1 ;Strip Colors
elseif (S !isincs $3) did -u chancontrol 74 1
if (G isincs $3) did -c chancontrol 75 1 ;G-Rated (Strip Badwords)
elseif (G !isincs $3) did -u chancontrol 75 1

haltdef
}
if ($numeric == 329) {
; Channel Creation Date
did -o chancontrol 5 1 $asctime($3) ( $+ $duration($calc($ctime - $3)) ago)
haltdef
}
if ($numeric == 367) {
; Channel Ban List
inc %chban 1
did -o chancontrol 18 %chban $3 ( $+ $4 $+ ) $asctime($5) [b]
haltdef
}
if ($numeric == 348) {
; Channel Exception List
inc %chexc 1
did -o chancontrol 19 %chexc $3 ( $+ $4 $+ ) $asctime($5)
haltdef
}
if ($numeric == 346) {
; Channel Invite List
inc %chinv 1
did -o chancontrol 22 %chinv $3 ( $+ $4 $+ ) $asctime($5)
haltdef
}
if ($numeric == 368) {
; End Of Channel Ban List
did -o chancontrol 59 1 %chban
haltdef
}
if ($numeric == 349) {
; End Of Channel Except List
did -o chancontrol 61 1 %chexc
haltdef
}
if ($numeric == 347) {
; End Of Channel Invite List
did -o chancontrol 62 1 %chinv
haltdef
}
if ($numeric == 472) || ($numeric == 482) {
; Unknown Mode Character
did -o chancontrol 99 1 Error: $2-
haltdef
}
}

on 1:dialog:chancontrol:*:*: {
; Debug Line
; if ($devent != mouse) echo -a DNAME: $dname - DEVENT: $devent - DID: $did - $did(chancontrol,18,0).seltext

if ($devent = sclick) {
if ($did = 34) {
; Ban Checkmark
set %listmode b
did -eo chancontrol 36 1 Add Ban
did -eo chancontrol 35 1 Del Ban
}
if ($did = 40) {
; Exception Checkmark
set %listmode e
did -eo chancontrol 36 1 Add Exception
did -eo chancontrol 35 1 Del Exception
}
if ($did = 41) {
; Invite Checkmark
set %listmode I
did -eo chancontrol 36 1 Add Invite
did -eo chancontrol 35 1 Del Invite
}
if ($did = 79) {
; Topic History Edit
/run Notepad.exe "ChanContTopic.ini"
}
}

if ($devent = edit) {
if ($did = 2) {
var %toplen $did(chancontrol,2,1).len
inc %toplen $did(chancontrol,2,2).len
inc %toplen $did(chancontrol,2,3).len
inc %toplen $did(chancontrol,2,4).len
inc %toplen $did(chancontrol,2,5).len
inc %toplen $did(chancontrol,2,6).len
inc %toplen $did(chancontrol,2,7).len
inc %toplen $did(chancontrol,2,8).len
inc %toplen $did(chancontrol,2,9).len
var %toplendisp %toplen of $num5(TOPICLEN)
if ($num5(TOPICLEN) = $false) var %toplendisp %toplen
did -o chancontrol 14 1 %toplendisp
}
}
if ($devent = close) {
.disable #chancontroldialog
.timercccopy off
if ($hget(num5)) { hdel -w num5 $+($cid,_*) } ;Server-Numeric Handling
}
if ($devent = sclick) {

if ($did = 20) {
.disable #chancontroldialog
.timercccopy off
if ($hget(num5)) { hdel -w num5 $+($cid,_*) } ;Server-Numeric Handling
}
if ($did = 39) {
; Update Channel Topic
var %chtopic $did(chancontrol,2,1) $+ $did(chancontrol,2,2) $+ $did(chancontrol,2,3) $+ $did(chancontrol,2,4) $+ $did(chancontrol,2,5) $+ $did(chancontrol,2,6) $+ $did(chancontrol,2,7)
if (%chtopic != $null) { /topic %chname %chtopic | did -o chancontrol 99 1 Channel %chname Topic Updated. | /topic %chname }
/chancontlasttopic update %chtopic
}
if ($did = 15) {
; Update Channel Modes
/mode %chname $did(chancontrol,12,1) | /mode %chname | did -o chancontrol 99 1 Channel %chname Modes Updated.
}
if ($did = 16) {
; Update Channel Key
/mode %chname +k $did(chancontrol,9,1) | /mode %chname | did -o chancontrol 99 1 Channel %chname Key Updated.
}
if ($did = 24) {
; Unset Channel Key
/mode %chname -k $did(chancontrol,9,1) | /mode %chname | did -o chancontrol 99 1 Channel %chname Key/Password Removed.
}
if ($did = 23) {
var %chset 0
if ($did(chancontrol,10,1) > 0) && ($did(chancontrol,10,1) < 999) { var %chset 1 }
if (%chset = 0) { /mode %chname -l | did -o chancontrol 99 1 Channel %chname Limit Removed. }
if (%chset = 1) { /mode %chname +l $did(chancontrol,10,1) | did -o chancontrol 99 1 Channel %chname Limit Set To %chlim Users. }
}
if ($did = 18) {
; Handle Ban List
set %listmode b
did -o chancontrol 29 1 $gettok($did(chancontrol,18).seltext,1,32)
did -o chancontrol 37 1 $gettok($did(chancontrol,18).seltext,2,32) on $gettok($did(chancontrol,18).seltext,3-,32)
did -c chancontrol 34 1
did -u chancontrol 40 1
did -u chancontrol 41 1
did -eo chancontrol 36 1 Add Ban
did -eo chancontrol 35 1 Del Ban
}
if ($did = 19) {
; Exception List
set %listmode e
did -o chancontrol 29 1 $gettok($did(chancontrol,19).seltext,1,32)
did -o chancontrol 37 1 $gettok($did(chancontrol,19).seltext,2,32) on $gettok($did(chancontrol,19).seltext,3-,32)
did -u chancontrol 34 1
did -c chancontrol 40 1
did -u chancontrol 41 1
did -eo chancontrol 36 1 Add Exception
did -eo chancontrol 35 1 Del Exception
}
if ($did = 22) {
; Invite List
set %listmode I
did -o chancontrol 29 1 $gettok($did(chancontrol,22).seltext,1,32)
did -o chancontrol 37 1 $gettok($did(chancontrol,22).seltext,2,32) on $gettok($did(chancontrol,22).seltext,3-,32)
did -u chancontrol 34 1
did -u chancontrol 40 1
did -c chancontrol 41 1
did -eo chancontrol 36 1 Add Invite
did -eo chancontrol 35 1 Del Invite
}

; Ban List Multiple Selection Handler
if ($did(chancontrol,18,0).sel > 1) && (%listmode = b) {
var %npop $null
var %npopcnt 0
:banpopulate
inc %npopcnt 1
var %npop %npop $+ $chr(32) $+ $gettok($did(chancontrol,18,$did(chancontrol,18,%npopcnt).sel),1,32)
if (%npopcnt < $did(chancontrol,18,0).sel) goto banpopulate
did -o chancontrol 29 1 %npop
did -o chancontrol 37 1 Click On One Ban To Return *OR* To Remove Multiple Selections, Click DEL -->
}
; Exception List Multiple Selection Handler
if ($did(chancontrol,19,0).sel > 1) && (%listmode = e) {
var %npop $null
var %npopcnt 0
:excpopulate
inc %npopcnt 1
var %npop %npop $+ $chr(32) $+ $gettok($did(chancontrol,19,$did(chancontrol,19,%npopcnt).sel),1,32)
if (%npopcnt < $did(chancontrol,19,0).sel) goto excpopulate
did -o chancontrol 29 1 %npop
did -o chancontrol 37 1 Click On One Exception To Return *OR* To Remove Multiple Selections, Click DEL -->
}
; Invite List Multiple Selection Handler
if ($did(chancontrol,22,0).sel > 1) && (%listmode = I) {
var %npop $null
var %npopcnt 0
:invpopulate
inc %npopcnt 1
var %npop %npop $+ $chr(32) $+ $gettok($did(chancontrol,22,$did(chancontrol,22,%npopcnt).sel),1,32)
if (%npopcnt < $did(chancontrol,22,0).sel) goto invpopulate
did -o chancontrol 29 1 %npop
did -o chancontrol 37 1 Click On One Invite To Return *OR* To Remove Multiple Selections, Click DEL -->
}

if ($did = 36) {
; Add Button
if (%listmode = b) {
set %chban 0
did -r chancontrol 18 1
.mode %chname + $+ $str(b,$numtok($did(chancontrol,29).text,32)) $did(chancontrol,29).text
.mode %chname +b
did -o chancontrol 99 1 Ban(s) Added: %nset
}
if (%listmode = e) {
set %chexc 0
did -r chancontrol 19 1
.mode %chname + $+ $str(e,$numtok($did(chancontrol,29).text,32)) $did(chancontrol,29).text
.mode %chname +e
did -o chancontrol 99 1 Exception(s) Added: %nset
}
if (%listmode = I) {
set %chinv 0
did -r chancontrol 22 1
.mode %chname + $+ $str(I,$numtok($did(chancontrol,29).text,32)) $did(chancontrol,29).text
.mode %chname +I
did -o chancontrol 99 1 Invite(s) Added: %nset
}
}
if ($did = 35) {
; Delete Button
if (%listmode = b) {
set %chban 0
did -r chancontrol 18 1
.mode %chname - $+ $str(b,$numtok($did(chancontrol,29).text,32)) $did(chancontrol,29).text
.mode %chname +b
did -o chancontrol 99 1 Channel %chname Ban %nset Deleted.
did -eo chancontrol 36 1 Add Ban
did -eo chancontrol 35 1 Del Ban
}
if (%listmode = e) {
set %chexc 0
did -r chancontrol 19 1
.mode %chname - $+ $str(e,$numtok($did(chancontrol,29).text,32)) $did(chancontrol,29).text
.mode %chname +e
did -o chancontrol 99 1 Channel %chname Exception %nset Deleted.
did -eo chancontrol 36 1 Add Exception
did -eo chancontrol 35 1 Del Exception
}
if (%listmode = I) {
set %chinv 0
did -r chancontrol 22 1
.mode %chname - $+ $str(I,$numtok($did(chancontrol,29).text,32)) $did(chancontrol,29).text
.mode %chname +I
did -o chancontrol 99 1 Channel %chname Invite %nset Deleted.
did -eo chancontrol 36 1 Add Invite
did -eo chancontrol 35 1 Del Invite
}
; Reset MultiBan
did -o chancontrol 29 1 $null
did -o chancontrol 37 1 $null
}

if ($did = 76) {
did -o chancontrol 2 1 $gettok($did(chancontrol,76).text,2-,32)
did -o chancontrol 14 1 $len($gettok($did(chancontrol,76).text,2-,32))
}
if ($did = 78) { /chancontlasttopic clear }

if ($did = 43) {
; Add To BlackList Button
var %ntype $did(chancontrol,30)
var %chans $did(chancontrol,32)
var %reason $did(chancontrol,45)
if ($len(%ntype) < 3) { did -o chancontrol 99 1 ERROR: Specify a Nickname on the Form First, If its not in U!I@H I will attempt to gain it.. | halt }
if (*!*@* !iswm %ntype) { did -o chancontrol 99 1 ERROR: Must be USER!IDENT@HOST format, Trying to Obtain U!I@H for user.. | .who %ntype | halt }
if ($chr(35) !isin %chans) { did -o chancontrol 99 1 ERROR: Must be Proper Channels, eg. #Lobby #Fred | halt }
if (%reason = $null) { did -o chancontrol 99 1 ERROR: You must either use the Default Reason or specify one! | halt }

did -o chancontrol 99 1 Checking BlackList..
var %tmp 0
did -r chancontrol 25 1
:ccread
inc %tmp 1
var %blk $read(ChanContBL12- $+ $network $+ .txt,%tmp)
var %frd $gettok(%blk,1,32)
did -o chancontrol 25 %tmp %blk
if (%frd = %ntype) { write -d ChanContBL12- $+ $network $+ .txt $did(25).seltext }
if (%frd != $null) goto ccread
write ChanContBL12- $+ $network $+ .txt $lower(%ntype) $str($chr(124),2) $lower(%chans) $str($chr(124),2) $fulldate $str($chr(124),2) %reason
did -o chancontrol 99 1 Added/Updated BlackList Entry Successfully.
/chancontupdateblacklist
}
if ($did = 44) {
; Delete BlackList Entry
if ($exists(ChanContBL12- $+ $network $+ .txt)) {
write -dl $+ $did(25).sel ChanContBL12- $+ $network $+ .txt
did -b chancontrol 44
did -u chancontrol 48
did -o chancontrol 99 1 BlackList Entry Successfully Deleted.
/chancontupdateblacklist
}
}
if ($did = 64) {
; Re-Populate BlackList
if ($exists(ChanContBL12- $+ $network $+ .txt)) {
did -o chancontrol 99 1 BlackList Re-Populated.
/chancontupdateblacklist
}
}
if ($did = 25) {
; BlackList Selection
did -o chancontrol 30 1 $gettok($did(chancontrol,25).seltext,1,124)
did -o chancontrol 32 1 $gettok($did(chancontrol,25).seltext,2,124)
did -o chancontrol 45 1 $gettok($did(chancontrol,25).seltext,4,124)
did -b chancontrol 44
did -u chancontrol 48
did -n chancontrol 45 1
did -u chancontrol 58
did -o chancontrol 99 1 ĂŚcopy
if ($gettok($did(chancontrol,25).seltext,1,124) != $null) { did -o chancontrol 99 1 BlackList Entry $gettok($did(chancontrol,25).seltext,1,124) was Added on $gettok($did(chancontrol,25).seltext,3,124) }
}
if ($did = 48) {
; Enable BlackList Delete Button
if ($did(chancontrol,25).seltext = $null) { did -o chancontrol 99 1 Select A BlackList Entry Before Enabling Delete! | did -u chancontrol 48 | halt }
if ($did(chancontrol,48).state = 1) { did -e chancontrol 44 }
if ($did(chancontrol,48).state = 0) { did -b chancontrol 44 }
}
if ($did = 58) {
; Default Blacklist Button
if ($did(chancontrol,58).state = 1) { did -m chancontrol 45 1 | did -o chancontrol 45 1 You Have Been BlackListed From This Channel - Good Day! }
if ($did(chancontrol,58).state = 0) { did -n chancontrol 45 1 | did -o chancontrol 45 1 }
}
if ($did = 50) {
; Topic CheckBox
if ($did(chancontrol,50).state = 1) { .mode %chname +t | did -o chancontrol 99 1 Channel %chname Protected Topic Lock Enabled. }
if ($did(chancontrol,50).state = 0) { .mode %chname -t | did -o chancontrol 99 1 Channel %chname Protected Topic Lock Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 51) {
; No External Messages CheckBox
if ($did(chancontrol,51).state = 1) { .mode %chname +n | did -o chancontrol 99 1 Channel %chname No External Messages Enabled. }
if ($did(chancontrol,51).state = 0) { .mode %chname -n | did -o chancontrol 99 1 Channel %chname No External Messages Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 52) {
; Moderated CheckBox
if ($did(chancontrol,52).state = 1) { .mode %chname +m | did -o chancontrol 99 1 Channel %chname Moderated Mode Enabled. }
if ($did(chancontrol,52).state = 0) { .mode %chname -m | did -o chancontrol 99 1 Channel %chname Moderated Mode Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 53) {
; Secret CheckBox
if ($did(chancontrol,53).state = 1) { .mode %chname +s | did -o chancontrol 99 1 Channel %chname Secret Mode Enabled. }
if ($did(chancontrol,53).state = 0) { .mode %chname -s | did -o chancontrol 99 1 Channel %chname Secret Mode Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 54) {
; Private CheckBox
if ($did(chancontrol,54).state = 1) { .mode %chname +p | did -o chancontrol 99 1 Channel %chname Private Mode Enabled. }
if ($did(chancontrol,54).state = 0) { .mode %chname -p | did -o chancontrol 99 1 Channel %chname Private Mode Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 55) {
; Invite CheckBox
if ($did(chancontrol,55).state = 1) { .mode %chname +i | did -o chancontrol 99 1 Channel %chname Invite Mode Enabled. }
if ($did(chancontrol,55).state = 0) { .mode %chname -i | did -o chancontrol 99 1 Channel %chname Invite Mode Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 66) {
; No Nickname Change
if ($did(chancontrol,66).state = 1) { .mode %chname +N | did -o chancontrol 99 1 Channel %chname No Nickname Change Enabled. }
if ($did(chancontrol,66).state = 0) { .mode %chname -N | did -o chancontrol 99 1 Channel %chname No Nickname Change Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 71) {
; Only Registered Nicknames Can Speak
if ($did(chancontrol,71).state = 1) { .mode %chname +M | did -o chancontrol 99 1 Channel %chname Only Reg Nicks Can Speak Enabled. }
if ($did(chancontrol,71).state = 0) { .mode %chname -M | did -o chancontrol 99 1 Channel %chname Only Reg Nicks Can Speak Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 73) {
; Only Registered Nicknames Can Join
if ($did(chancontrol,73).state = 1) { .mode %chname +R | did -o chancontrol 99 1 Channel %chname Only Reg Nicks Can Speak Enabled. }
if ($did(chancontrol,73).state = 0) { .mode %chname -R | did -o chancontrol 99 1 Channel %chname Only Reg Nicks Can Speak Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 74) {
; Strip Colors
if ($did(chancontrol,74).state = 1) { .mode %chname +S | did -o chancontrol 99 1 Channel %chname Strip Colors Enabled. }
if ($did(chancontrol,74).state = 0) { .mode %chname -S | did -o chancontrol 99 1 Channel %chname Strip Colors Disabled. }
.timer 1 1 .mode %chname
}
if ($did = 75) {
; G-Rated / Strip Badwords
if ($did(chancontrol,75).state = 1) { .mode %chname +G | did -o chancontrol 99 1 Channel %chname G-Rated / Strip Badwords Enabled. }
if ($did(chancontrol,75).state = 0) { .mode %chname -G | did -o chancontrol 99 1 Channel %chname G-Rated / Strip Badwords Disabled. }
.timer 1 1 .mode %chname
}

if ($did = 60) {
; Re-Populate Lists Button
did -o chancontrol 99 1 Re-Populated Channel Lists For %chname
if (b isincs $gettok($chanmodes,1,44)) { set %chban 0 | .mode %chname +b }
if (e isincs $gettok($chanmodes,1,44)) { set %chexc 0 | .mode %chname +e }
if (I isincs $gettok($chanmodes,1,44)) { set %chinv 0 | .mode %chname +I }
}
}
}

alias -l chancontlasttopic {
if ($1 !isin list update clear) { echo -a Topic History was called Wrong: $1 | halt }
if ($1 = clear) { /remini ChanContTopic.ini $network $+ %chname }
var %ur9 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,9)
var %ur8 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,8)
var %ur7 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,7)
var %ur6 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,6)
var %ur5 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,5)
var %ur4 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,4)
var %ur3 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,3)
var %ur2 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,2)
var %ur1 $readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,1)

if ($1 = update) {
if (%ur8 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 9 %ur8 }
if (%ur7 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 8 %ur7 }
if (%ur6 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 7 %ur6 }
if (%ur5 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 6 %ur5 }
if (%ur4 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 5 %ur4 }
if (%ur3 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 4 %ur3 }
if (%ur2 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 3 %ur2 }
if (%ur1 != $null) { writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 2 %ur1 }
writeini -n ChanContTopic.ini $remove($network,$chr(32)) $+ %chname 1 $2-
}

did -r chancontrol 76 1
did -i chancontrol 76 1 9: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,9),$v1,-)
did -i chancontrol 76 1 8: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,8),$v1,-)
did -i chancontrol 76 1 7: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,7),$v1,-)
did -i chancontrol 76 1 6: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,6),$v1,-)
did -i chancontrol 76 1 5: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,5),$v1,-)
did -i chancontrol 76 1 4: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,4),$v1,-)
did -i chancontrol 76 1 3: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,3),$v1,-)
did -i chancontrol 76 1 2: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,2),$v1,-)
did -i chancontrol 76 1 1: $iif($readini(ChanContTopic.ini,$remove($network,$chr(32)) $+ %chname,1),$v1,-)
did -i chancontrol 76 1 RestoreOrigTopic %chtopic
}

alias -l chancontupdateblacklist {
var %tmp 0
did -r chancontrol 25 1
/chancontsortbl ChanContBL12- $+ $network $+ .txt
:ccblackupd
inc %tmp 1
if ($exists(ChanContBL12- $+ $network $+ .txt)) {
var %blk $read(ChanContBL12- $+ $network $+ .txt,%tmp)
var %frd $gettok(%blk,1,124)
did -o chancontrol 25 %tmp %blk
if (%frd != $null) goto ccblackupd
}
var %cnt $calc(%tmp - 1)
did -o chancontrol 63 1 %cnt
}
alias chancontsortbl $iif($isfile($+(",$$1-,")),filter -affc $str($+(",$1-,",$chr(32)),2))

#chancontroldialog end

alias chancont {
if ($chan = $null) { echo -a ERROR: You must be on a Channel to call up the Channel Control Dialog!! | halt }
.enable #chancontroldialog
dialog $iif($dialog(chancontrol), -va, -m) chancontrol chancontrol
set %chban 0
set %chexc 0
set %chinv 0
set %chname $chan
set %chtopic $chan($chan).topic
.topic $chan
.mode $chan
/chancontconfig
set %chancontcopy Channel Control for Ch. %chname - (C)2012-13 Amiga600 @ http://www.hawkee.com/snippets/user/59854/
did -o chancontrol 99 1 %chancontcopy
.timercccopy 0 30 did -o chancontrol 99 1 %chancontcopy
; Disable UnSupported Channel List Modes
if (b isincs $gettok($chanmodes,1,44)) { .mode $chan +b | did -e chancontrol 18 | did -e chancontrol 34 1 | did -eo chancontrol 36 1 Add Ban | did -eo chancontrol 35 1 Del Ban | did -c chancontrol 34 1 }
elseif (b !isincs $gettok($chanmodes,1,44)) { did -o chancontrol 18 1 Un-Supported By The IRCd. }
if (e isincs $gettok($chanmodes,1,44)) { .mode $chan +e | did -e chancontrol 19 | did -e chancontrol 40 }
elseif (e !isincs $gettok($chanmodes,1,44)) { did -o chancontrol 19 1 Un-Supported By The IRCd. }
if (I isincs $gettok($chanmodes,1,44)) { .mode $chan +I | did -e chancontrol 22 | did -e chancontrol 41 }
elseif (I !isincs $gettok($chanmodes,1,44)) { did -o chancontrol 22 1 Un-Supported By The IRCd. }
; Disable UnSupported Channel Modes
if (t !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 50 1 } ; Channel Topic
if (n !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 51 1 } ; No External Msgs
if (t !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 52 1 } ; Moderated
if (s !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 53 1 } ; Secret
if (p !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 54 1 } ; Private
if (i !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 55 1 } ; Invite Only
if (N !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 66 1 } ; No Nick Changes
if (M !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 71 1 } ; Only Reg Speak
if (R !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 73 1 } ; Only Reg Join
if (S !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 74 1 } ; Strip Colors
if (G !isincs $gettok($chanmodes,4,44)) { did -b chancontrol 75 1 } ; G-Rated
if (k !isincs $gettok($chanmodes,2,44)) { did -b chancontrol 9,16,24 1 } ; Channel Key
if (l !isincs $gettok($chanmodes,3,44)) { did -b chancontrol 10,23 1 } ; User Limit

set %listmode b
did -eo chancontrol 36 1 Add Ban
did -eo chancontrol 35 1 Del Ban
did -c chancontrol 34 1

if (%chancont.enableonlyifop = 1) {
if (!$nick(#,$me,~&@%)) {
did -b chancontrol 1-99
did -e chancontrol 20
}
}
/ircversion
/chancontupdateblacklist
/chancontlasttopic list
}
on *:JOIN:#: {
/chancontconfig
if ($exists(ChanContBL12- $+ $network $+ .txt)) {
var %tmp 0
:cccheckbl
inc %tmp 1
var %blk $read(ChanContBL12- $+ $network $+ .txt,%tmp)
var %blentry $gettok(%blk,1,124)
var %blchans $lower($gettok(%blk,2,124))
var %blmsg $gettok(%blk,4,124)
if ($nick $+ !*@* = %blentry) { var %n 1 }
if (%blentry iswm $address($nick,0)) { var %n 1 }
if (%blentry iswm $address($nick,1)) { var %n 1 }
if (%blentry iswm $address($nick,2)) { var %n 1 }
if ($chan isin %blchans) || (#* isin %blchans) {
if (%n = 1) { echo $chan [BlackList] $nick on %blentry (Actual: $address($nick,5) $+ ) | .mode # +b %blentry | .kick # $nick BlackListed: %blmsg | set %chban 0 | .mode # +b | halt }
}
if (%blk != $null) goto cccheckbl
}
}

Comments

Sign in to comment.
Amiga600   -  May 23, 2012
Thanks Dany for telling me about the issues too, if it wasnt for feedback, I would not have known about the problems, so I am grateful to you for pointing them out.
Truk  -  Feb 04, 2013
Why do I get this error: * /did: invalid parameters
Any Ideas? Thanks!
Amiga600  -  Feb 04, 2013
it shouldnt be causing that error, Did you make sure you are loading it into a new remote, eg. "ChanControl.mrc" and loading it as a separate file?
Truk  -  Feb 04, 2013
Its all by its lonsome and named it ChannelControl.mrc - I also loaded it and unloaded it a few times. Ty for your reply. I will also try it on another bot I have to see if it is something with this particular mirc
Truk  -  Feb 04, 2013
its this instance of mirc and works great on my bot which is where I want to use it :00 thanks for the awesome script!!
Amiga600  -  Feb 04, 2013
Glad it's sorted :) - It's possible it might be conflicting with another script which you have loaded possibly, If you want to do some digging and find out how and where it conflicts, I maybe able to make adjustments to prevent it conflicting.
Sign in to comment

Dany   -  May 23, 2012
now it works fine . thx dude
10/10 very nice , like it
 Respond  
hxck   -  May 22, 2012
Works great, thanks! :) 9/10 +like
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.