Channel Manager v1.0

By alabama on Sep 13, 2011

Screenshots

Channel Manager for mIRC.
v1.0 can:
~View bans
~ - If halfop/op ~ Remove bans, one at a time, or all at once
~View modes
~ - If halfop/op ~ Set/remove modes

Watch a video of it's current functions:
http://www.youtube.com/watch?v=8-waAKFBqaI

Paste in remotes and open by using alias /chanman or right clicking in a status/channel/query window

;Channel Manager v1.0 
;by: alabama @ hackforums.net
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

alias chanman { dialog -m chanman chanman }

;/chanman will open the dialog 'chanman'

Menu channel,nicklist,query {
Channel Manager:/dialog -m chanman chanman }

;right clicking a channel, nickname, or in a query window, you will be giving the option to click "channel manager" which will open the dialog. 

dialog chanman {
  title "Channel Manager"
  size -1 -1 226 160
  option dbu
  tab "Bans", 1, 0 -2 225 156
  list 2, 3 20 52 50, tab 1 size
  list 3, 55 20 169 50, tab 1 size
  text "Ban mask  ~  Set Date  ~  Set by", 4, 90 12 96 8, tab 1
  edit "", 5, 55 70 50 10, tab 1 read
  button "Remove selected", 55, 110 71 48 12, disable tab 1
  button "Remove all", 56, 181 71 43 12, disable tab 1
  tab "Modes", 6
  check "Block colour codes", 8, 11 46 52 10, tab 6
  box "Positive Modes [+]", 9, 7 32 108 119, tab 6
  check "Amsg ban", 10, 11 56 35 10, tab 6
  check "No CTCPs", 11, 11 66 37 10, tab 6
  check "No actions", 12, 11 77 37 10, tab 6
  check "No knocks", 13, 11 86 37 10, tab 6
  check "Moderated", 14, 11 95 38 10, tab 6
  check "No nick changes", 15, 11 104 50 10, tab 6
  check "Private channel", 16, 64 40 50 10, tab 6
  check "No kicks allowed", 17, 64 50 50 10, tab 6
  check "Registered only", 18, 64 61 50 10, tab 6
  check "Secret channel", 19, 64 71 50 10, tab 6
  check "Strip color codes", 20, 64 80 50 10, tab 6
  check "No NOTICEs", 21, 64 89 50 10, tab 6
  check "No /invite", 22, 64 97 50 10, tab 6
  check "Only SSL clients", 23, 64 105 50 10, tab 6
  check "No outside msgs", 24, 11 114 50 10, tab 6
  check "Invite only", 25, 64 114 50 10, tab 6
  edit "", 26, 41 124 71 10, tab 6 read
  combo 27, 12 135 60 50, tab 6 size drop
  button "Set", 28, 74 135 37 12, tab 6
  button "Reset", 29, 12 124 29 10, tab 6
  box "Negative Modes [-]", 30, 117 32 108 119, tab 6
  combo 50, 120 135 60 50, tab 6 size drop
  button "Set", 51, 182 135 37 12, tab 6
  edit "", 48, 149 124 71 10, tab 6 read
  button "Reset", 49, 120 124 29 10, tab 6
  check "No outside msgs", 39, 119 113 50 10, tab 6
  check "No nick changes", 41, 119 103 50 10, tab 6
  check "Moderated", 42, 119 94 38 10, tab 6
  check "No knocks", 43, 119 85 37 10, tab 6
  check "No actions", 44, 119 76 37 10, tab 6
  check "No CTCPs", 45, 119 66 37 10, tab 6
  check "Amsg ban", 46, 119 55 35 10, tab 6
  check "Block colour codes", 47, 119 45 52 10, tab 6
  check "Private channel", 33, 172 39 50 10, tab 6
  check "Registered only", 31, 172 60 50 10, tab 6
  check "No kicks allowed", 32, 172 49 50 10, tab 6
  check "Strip color codes", 35, 172 79 50 10, tab 6
  check "Only SSL clients", 38, 172 104 50 10, tab 6
  check "Invite only", 40, 172 113 50 10, tab 6
  check "No /invite", 37, 172 96 50 10, tab 6
  check "No NOTICEs", 36, 172 88 50 10, tab 6
  check "Secret channel", 34, 172 70 50 10, tab 6
  text "Current modes for ", 54, 117 14 90 8, tab 6
  edit "", 52, 116 22 106 10, tab 6 read
  button "x", 53, 208 12 17 10, disable tab 6
  combo 7, 7 15 107 61, tab 6 size drop
}

;The above code is for the UI. There are 3 different styles of dialogs for mIRC. (notheme, dbu, pixels)
;A label's code would look similar to this: text "text", id, x y w h[, style] (style options-right, center, nowrap).
;An edit box's code would look like: edit "text", id, x y w h[, style](style options-right, center, multi, pass, read only, return, hsbar, vsbar, autohs,autovs).
;A button's code follows this format: button "text", id, x y w h[, style](style options-default, ok, cancel, flat, multi)
;A checkboxes code would look like this: check "text", id, x y w h[, style](style options-left, push, 3state)
;A combobox would follow this: combo id, x y w h[, style](style options-sort, edit, drop, size, vsbar, hsbar)
;Those are the main ones used, there are a few other controls available for dialogs. A full list below:
;Menu, Tab, Link, Icon, List, Combo, Scroll, Box, Radio, Check, Button, Edit, Text

on *:dialog:chanman:init:0:{ didtok $dname 2 32 $regsubex($str(-,$chan(0)),/(.)/g,$+($chan(\n),$chr(32))) 
  didtok $dname 7 32 $regsubex($str(-,$chan(0)),/(.)/g,$+($chan(\n),$chr(32))) 
  //var %temp $chan(0) | while (%temp) { if ($nick($chan(%temp),$me,oh)) did -a $dname 27 $chan(%temp) | dec %temp }
  //var %temp $chan(0) | while (%temp) { if ($nick($chan(%temp),$me,oh)) did -a $dname 50 $chan(%temp) | dec %temp }
  did -c $dname 27 1 | did -c $dname 50 1
  if ($ssl == $false) { did -b $dname 23 | did -b $dname 38 } 
  else { did -e $dname 23 | did -e $dname 38 }
} 

;The above code does certain commands upon loading the dialog. Let's start with the first line. 
;didtok $dname 2 32 $regsubex($str(-,$chan(0)),/(.)/g,$+($chan(\n),$chr(32))) - This will load every channel into $did(2) (list) the user using the script is in. 
;The second line is similar, but it loads into a combobox($did(7)
; //var %temp $chan(0) | while (%temp) { if ($nick($chan(%temp),$me,oh)) did -a $dname 27 $chan(%temp) | dec %temp }
;^The above^ will add all of the channels you're @oped or %halfoped in, in a combobox. The next line does the same thing for a different combo.
;Combobox 27 and 50 are these: http://gyazo.com/deb804b24cd4d90cb398a434f515a7be
;The reason for it only displaying channels you're opped/hopped in is because if you have lesser access, then you won't be able to set modes anyway.
;did -c $dname 27 1 (and) 50 1 - will automatically select the first channel in the comboboxes 27 and 50
; if ($ssl == $false) { did -b $dname 23 | did -b $dname 38 } --- Explanation below
; id 23 and 38 are http://gyazo.com/369a69f5498a3869a10a8e03a7dd586f
; if you are not connecting via SSL, those checkboxes will be disabled. /did -b == disable
; else { did -e $dname 23 | did -e $dname 38 }
; If you are connecting via SSL, it will enable those two checkboxes.

on *:dialog:chanman:sclick:*:{
  var %a did -a $dname
  var %b did -b $dname
  var %e did -e $dname
  var %r did -r $dname
  var %u did -u $dname

;on *:dialog:chanman:sclick:*:{  ==  Whenever the mouse left button is pushed down
;sets variables for easier use. instead of typing did -u $dname (id) everyline, you would only have to type %u (id)

  if ($did == 2) && ($chr(35) isin $did(2).seltext) { banstart | var %r did -r $dname | var %e did -e $dname | %r 3 | banlist | totalbans | %e 55 | %e 56 }
;did 2 refers to the listbox http://gyazo.com/37d64e94b8db81274181a1bd99101cf9
;whenever a channel in the list is clicked, it will execute the aliases: banstart, banlist, and totalbans. As well, it will enable button's 55 and 56. 
;It will clear listbox 3 before executing banlist and totalbans. The result will look like: http://gyazo.com/0a3769a9889ac6fe09820d441d1f568d
;Variables %r, %e, are set for easier use.

if ($did == 8) { %a 26 c | %b 8 }
;did == 8 refers to one of the checkboxes on tab 2. It will write (did -a $dname 26) the letter "c" into the edit box 26. The text on the checkbox
corresponds to the mode "c". It will then disable (did -b $dname 8) that checkbox. 
;I'm not going to comment on some of the lines below as they are basically the same thing but for different modes.

  if ($did == 10) { %a 26 B | %b 10 }
  if ($did == 11) { %a 26 C | %b 11 }
  if ($did == 12) { %a 26 E | %b 12 }
  if ($did == 13) { %a 26 K | %b 13 }
  if ($did == 14) { %a 26 M | %a 26 m | %b 14 }
  if ($did == 15) { %a 26 N | %b 15 }
  if ($did == 16) { %a 26 p | %b 16 }
  if ($did == 17) { %a 26 Q | %b 17 }
  if ($did == 18) { %a 26 R | %b 18 }
  if ($did == 19) { %a 26 s | %b 19 }
  if ($did == 20) { %a 26 S | %b 20 }
  if ($did == 21) { %a 26 T | %b 21 }
  if ($did == 22) { %a 26 V | %b 22 }
  if ($did == 23) { %a 26 z | %b 23 }
  if ($did == 24) { %a 26 n | %b 24 }
  if ($did == 25) { %a 26 i | %b 25 }
  if ($did == 28) { .mode $did(27).seltext + $+ $did(26).text }
;did == 28 refers to a button. The button is titled "Set." It will set apply all of the [+] modes in editbox 26 to the selected channel in the combobox 27.

  if ($did == 29) { %e 8-22 | %e 24-25 | %r 26 | %u 8-25 }
;did == 29 refers to the button with the text "Reset". /did -e = enables a control. It will enable all of the above codes. 
;Notice- We skip 23 because that is the 'SSL only' mode. 

  if ($did == 47) { %a 48 c | %b 47 }
  if ($did == 46) { %a 48 B | %b 46 }
  if ($did == 45) { %a 48 C | %b 45 }
  if ($did == 44) { %a 48 E | %b 44 }
  if ($did == 43) { %a 48 K | %b 43 }
  if ($did == 42) { %a 48 M | %a 48 m | %b 42 }
  if ($did == 41) { %a 48 N | %b 41 }
  if ($did == 40) { %a 48 i | %b 40 }
  if ($did == 39) { %a 48 n | %b 39 }
  if ($did == 38) { %a 48 z | %b 38 }
  if ($did == 37) { %a 48 V | %b 37 }
  if ($did == 36) { %a 48 T | %b 36 }
  if ($did == 35) { %a 48 S | %b 35 }
  if ($did == 34) { %a 48 s | %b 34 }
  if ($did == 33) { %a 48 p | %b 33 }
  if ($did == 32) { %a 48 Q | %b 32 }
  if ($did == 31) { %a 48 R | %b 31 }
  if ($did == 51) { .mode $did(50).seltext - $+ $did(48).text }
;did == 51 refers to a button. The button is titled "Set." It will set apply all of the [-] modes in editbox 48 to the selected channel in the combobox 50.

  if ($did == 53) { .mode $did(7).seltext - $+ $did(52).text | %r 52 | chanmodes }
;did == 53 refers to the button titled 'x' -- http://gyazo.com/0c0ac0162cc64fda3b0c752857590cd9
;it will delete all of the current set modes in the channel selected in combobox 7

  if ($did == 49) { %e 31-37 | %e 39-47 | %r 48 | %u 31-47 }
;did == 49 refers to the button with the text "Reset". /did -e = enables a control. It will enable all of the above codes. 
;Notice- We skip 38 because that is the 'SSL only' mode. 

  if ($did == 7) { %e 53 | %r 52 | chanmodes | %a 54 Current modes for $did(7).seltext }
;did == 7 refers to the combobox containing the channels in the upper-left hand corner of tab 2. http://gyazo.com/ead2d8b3379c1ee5876a25bb4a436837
;clicking it will enable button 53, clear edit box 52, perform the alias /chanmodes and set the text of editbox 54 to "current modes for selected chan"

  if ($did == 55) && ($me isop $did(2).seltext) { mode $did(2).seltext -b $did(3).seltext | did -d $dname 3 $did(3, 1).sel | %r 5 | minus }
;The above code will work if you're an operator in the channel selected in combobox 2. If that returns true, it will unban the selected hostmask,
;delete the selected line from the list, clear listbox 5 and execute the alias /minus

  if ($did == 56) && ($me isop $did(2).seltext) { unbanall | %r 3 | %r 5 | did -a $dname 5 0 total bans }
;The above will work if button 56 "remove all" is selected AND you're an op in the channel. 
;It will perform the alias /unbanall, clear listbox 3 and 5, and reset the editbox 5 to say "0 total bans"

}

raw 367:*:haltdef 
raw 368:*:haltdef 
;Raw 367(368):*:haltdef - will stop bans from showing up in your status window.

alias banstart { /mode $did(2).seltext +b }
; the above alias will do mode (channel selected) +b to get the banlist. This is performed on dialog load up.

alias unbanall {
  var %chan- $did(2).seltext | var %u = $ibl(%chan-,0)
  while (%u > 0) {
    ;dec %u
    inc %t
    var %ban = %ban $ibl(%chan-,%u)
    if (%t == $modespl) {
      mode %chan- - $+ $str(b,$modespl) %ban
      unset %t %ban
      dec %u
    }
  }
10  mode %chan- - $+ $str(b,$modespl) %ban
}
;line 1: set %chan- to the channel name from the dialog, set %u to the number of bans set in that channel
;line 2: if %u (the number of bans) is greater than 0 it'll continue
;line 5: set %ban to the Nth ban in the ban list
;line 6,7,8,9) fs %t reached the maximum number of modes that can be set at once in one command, execute the /mode remove the bans in %ban, unset %t an %chan
;line 10: Finally, it executes /mode %chan- -bbbbbbb ($modespl times) follow by %ban which is the list of bans

alias minus { var %minus $calc($ibl($did(2).seltext,N) - 1) 
did -a $dname 5 %minus total bans }
;alias minus will var %minus as $ibl($did(2).seltext,N) subtracted by one
;it will then set edit box 5 to say the current number of bans

alias chanmodes { var %a did -a $dname | var %chan7 $did(7).seltext | %a 52 $remove($chan(%chan7).mode,+) }
;alias /chanmodes will var %a as 'did -a $dname', %chan7 as '$did(7).seltext'.
;It will then add the modes set for the channel selected in the combo 7 to the edit box 52

alias totalbans { did -r $dname 5 | did -a $dname 5 $ibl($did(2).seltext,N) total bans }
;alias /totalbans will erase (-r) everything in edit box 5, and write in edit box 5 the number of total bans for the selected channel in combo 2.

alias banlist { var %chan = $did(2).seltext, %i = 1 
while ($ibl(%chan, %i) != $null) { did -a chanman 3 $ibl(%chan ,%i) ~ $ibl(%chan, %i).date ~ $ibl(%chan, %i).by | inc %i } }
;alias /banlist will set %chan as '$did(2).seltext) and set %i to '1'
;the second line is a while loop that writes every ban, ban date, and who set the ban in list view 3.
;it will continuously loop until there are no more bans to be displayed. 
;the format would be " banmask@ban.mask ~ 1/1/1 ~ Banner "

;Thanks for reading through this, it sure took me a little while. If there's anything I didn't explain well enough, let me know :).

Comments

Sign in to comment.
alabama   -  Sep 17, 2011

thanks

 Respond  
jaytea   -  Sep 17, 2011

good on you for the comments.

 Respond  
alabama   -  Sep 16, 2011

I'll consider those changes, thanks

 Respond  
yelow79   -  Sep 15, 2011

I like this, it could use a little work but overall very nice. I suggest making the first tab fill the dialog, for those of us who sit in a ton of channels it would be very nice to have the view space. Could also add the (f) mode for unrealircd. Thanks for a great script tho.

 Respond  
yelow79   -  Sep 15, 2011

I like this, it could use a little work but overall very nice. I suggest making the first tab fill the dialog, for those of us who sit in a ton of channels it would be very nice to have the view space. Could also add the (f) mode for unrealircd. Thanks for a great script tho.

 Respond  
alabama   -  Sep 14, 2011

lol

 Respond  
Frenetic   -  Sep 14, 2011

8 9 10

 Respond  
Frenetic   -  Sep 14, 2011

I'm shanker on HF.

 Respond  
alabama   -  Sep 14, 2011

Yeah, I'm from hf. What's your name?

 Respond  
Frenetic   -  Sep 14, 2011

Yeah, I've seen his youtube channel on threads.

 Respond  
Jordyk19   -  Sep 14, 2011

Lol HackForums.

 Respond  
Frenetic   -  Sep 14, 2011

You're Alabama on HF?

 Respond  
alabama   -  Sep 13, 2011

Thanks for the suggestions, I'll add those in the next release.

 Respond  
Frenetic   -  Sep 13, 2011

Aha2y and filter (+g) on InspIRCd and such IRCd daemons.

 Respond  
Jordyk19   -  Sep 13, 2011

Its nice, Could you add a tab for Excepts and Invites? Then the script will be awesome!

 Respond  
alabama   -  Sep 13, 2011

I tried to comment on every line I could. Feedback would be nice.

 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.