Channel Central v0.2

By MaSOuD on Feb 03, 2009

This is a simple addon to show Bans/Excepts/Invites list and other modes on a channel like the default mIRC Channel Central but with a better interface and more features.

You can download the full package from HERE

Image

; ******************************************************************************
; >>>>>>>> DC Channel Central v0.2
; >>>>>> Written by MaSOuD - Aug 11, 2010
; >>>> Contact: Masoud.1984@Gmail.com
; >> IRC: DALnet #DCScript - #HelpDesk - #Scripting - #Scripted
; ******************************************************************************
menu Channel {
  -
  Channel Central
  .Open:DCentral
  .About:DCen.About
  .-
  .Unload:DCen.Unload
  -
}
on *:Load:{
  clear -a
  echo 2 -at ***1 DC Channel Central was successfully Loaded!
  echo 2 -at ***1 To use it type: 3/DCentral1 or Right-click/Double-click on Channels...
  echo 2 -at ***1 You can set it as your default Channel Central by (mIRC Options > Mouse > Channel) and change it to /DCentral.
}
on *:Unload:{
  .writeini $mircini clicks channel /channel
  clear -a
  echo 2 -at ***1 DC Channel Central was successfully Unloaded!
  echo 2 -at ***1 Thank You for using it... :)
}
alias DCen.About {
  .echo -aq $input(Author: MaSOuD $+ $crlf $+ $crlf $+ Version: First version $chr(40) $+ Beta $+ $chr(41) $+ $crlf $+ $crlf $+ Released at: Feb 03 2009 $+ $crlf $+ $crlf $+ Contact: Masoud@DCScript.net $+ $crlf $+ $crlf $+ Thank you for using this Addon : $+ $chr(41),igo,About Channel Central $chr(40) $+ Beta $+ $chr(41))
}
alias DCen.Unload {
  var %Confirm = $input(Are you sure?,wyvg,Unloading...)
  if (%Confirm == $yes) { .unload -rs $qt($script) }
  else { return }
}
alias MDX { dll $+($shortfn($scriptdir),MDX.dll) $$1- }
alias Views return $+($shortfn($scriptdir),Views.mdx)
alias DCentral {
  if (!$server) { echo $color(info) -st 3DC Central: You're not connected to server! | halt }
  if ($active == Status Window) { echo $color(info) -st 3DC Central: You cannot use it on Status Window | halt }
  dialog $iif(!$dialog(DCentral),-mh,-vh) DCentral DCentral
}
alias -l DCentrals { if ($dialog(DCentral)) { dialog $iif(!$dialog(DCentrals),-mh,-vh) DCentrals DCentrals } }
alias -l DCentral.Sel {
  if ($did(DCentral,$1,0).sel > 0) {
    var %x = $did(DCentral,$1,0).sel
    while (%x) { var %y = $addtok(%y,$did(DCentral,$1,%x).sel,44) | dec %x }
    var %z = $numtok(%y,44),%w
    while (%z) { %w = $addtok(%w,$gettok($did(DCentral,$1,$gettok(%y,%z,44)),6,32),32) | dec %z }
    return %w
  }
}
alias Central.Gen {
  if ($dialog(DCentral)) && ($active !ischan) { dialog -x DCentral | return }
  else {
    did -r DCentral 2,8,9,10
    did -c DCentral 4
    did -u DCentral 5,6,16-27
    did -hb DCentral 9,10
    did -ve DCentral 8
    dialog -t DCentral Channel Central $active
    if ($chan($active).topic != $null) { did -a DCentral 2 $chan($active).topic }
    if (t isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 16 }
    if (n isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 17 }
    if (i isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 18 }
    if (c isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 19 }
    if (p isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 20 }
    if (s isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 21 }
    if (m isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 22 }
    if (M isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 23 }
    if (R isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 24 }
    if (k isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 25 | did -ra DCentral 26 $chan($active).key }
    if (l isincs $gettok($chan($active).mode,1,32)) { did -c DCentral 27 | did -ra DCentral 28 $chan($active).limit }
    var %y = 1
    while (%y <= $ibl($active,0)) { did -i DCentral 8 $calc(%y + 1) $ibl($active,%y) $chr(9) $ibl($active,%y).by $chr(9) $ibl($active,%y).date | inc %y }
    %y = 1
    while (%y <= $iel($active,0)) { did -i DCentral 9 $calc(%y + 1) $iel($active,%y) $chr(9) $iel($active,%y).by $chr(9) $iel($active,%y).date | inc %y }
    %y = 1
    while (%y <= $iil($active,0)) { did -i DCentral 10 $calc(%y + 1) $iil($active,%y) $chr(9) $iil($active,%y).by $chr(9) $iil($active,%y).date | inc %y }
    if (%_DCentral == e) { did -hb DCentral 8,10 | did -ve DCentral 9 | did -c DCentral 5 | did -u DCentral 4,6 }
    if (%_DCentral == i) { did -hb DCentral 8,9 | did -ve DCentral 10 | did -c DCentral 6 | did -u DCentral 4,5 }
    unset %_DCentral
    if ($me !isop $active) { did -b DCentral 2,11-14,16-28,31,32 }
  }
}
alias -l DCentral.Ask {
  if ($1) {
    var %Which = $+($iif($1 = b, Bans),$iif($1 == e, Excepts),$iif($1 == i, Invites))
    var %Confirm = $input(Are you sure? $+ $crlf $+ You want to remove all the %Which list?,wyvg,Clearing the %Which list...)
    if (%Confirm == $no) return
    if (%Confirm == $yes) {
      if ($1 == b) {
        var %x = $ibl($active,0)
        if (%x <= 5) { var %m1 = $ibl($active,1) $ibl($active,2) $ibl($active,3) $ibl($active,4) $ibl($active,5) }
        if (%x <= 10) && (%x > 5) { var %m2 = $ibl($active,6) $ibl($active,7) $ibl($active,8) $ibl($active,9) $ibl($active,10) }
        if (%x <= 15) && (%x > 10) { var %m3 = $ibl($active,11) $ibl($active,12) $ibl($active,13) $ibl($active,14) $ibl($active,15) }
        if (%x <= 20) && (%x > 15) { var %m4 = $ibl($active,16) $ibl($active,17) $ibl($active,18) $ibl($active,19) $ibl($active,20) }
        if (%m1) { mode $active -bbbbb %m1 }
        if (%m2) { mode $active -bbbbb %m2 }
        if (%m3) { mode $active -bbbbb %m3 }
        if (%m4) { mode $active -bbbbb %m4 }
      }
      if ($1 == e) {
        var %x = $iel($active,0)
        if (%x <= 5) { var %m1 = $iel($active,1) $iel($active,2) $iel($active,3) $iel($active,4) $iel($active,5) }
        if (%x <= 10) && (%x > 5) { var %m2 = $iel($active,6) $iel($active,7) $iel($active,8) $iel($active,9) $iel($active,10) }
        if (%x <= 15) && (%x > 10) { var %m3 = $iel($active,11) $iel($active,12) $iel($active,13) $iel($active,14) $iel($active,15) }
        if (%x <= 20) && (%x > 15) { var %m4 = $iel($active,16) $iel($active,17) $iel($active,18) $iel($active,19) $iel($active,20) }
        if (%m1) { mode $active -eeeee %m1 }
        if (%m2) { mode $active -eeeee %m2 }
        if (%m3) { mode $active -eeeee %m3 }
        if (%m4) { mode $active -eeeee %m4 }
      }
      if ($1 == i) {
        var %x = $iil($active,0)
        if (%x <= 5) { var %m1 = $iil($active,1) $iil($active,2) $iil($active,3) $iil($active,4) $iil($active,5) }
        if (%x <= 10) && (%x > 5) { var %m2 = $iil($active,6) $iil($active,7) $iil($active,8) $iil($active,9) $iil($active,10) }
        if (%x <= 15) && (%x > 10) { var %m3 = $iil($active,11) $iil($active,12) $iil($active,13) $iil($active,14) $iil($active,15) }
        if (%x <= 20) && (%x > 15) { var %m4 = $iil($active,16) $iil($active,17) $iil($active,18) $iil($active,19) $iil($active,20) }
        if (%m1) { mode $active -IIIII %m1 }
        if (%m2) { mode $active -IIIII %m2 }
        if (%m3) { mode $active -IIIII %m3 }
        if (%m4) { mode $active -IIIII %m4 }
      }
    }
    Central.Gen
  }
}

dialog DCentral {
  title "Channel Central"
  size -1 -1 237 226
  option dbu
  box "Topic:", 1, 3 1 231 24
  edit "", 2, 7 10 222 10, autohs
  box "Lists:", 3, 3 26 231 126
  radio "Bans", 4, 34 36 25 10
  radio "Excepts", 5, 70 36 32 10
  radio "Invites", 6, 108 36 30 10
  text "View:", 7, 11 37 16 8
  list 8, 8 48 192 100, size extsel
  list 9, 8 48 192 100, size extsel
  list 10, 8 48 192 100, size extsel
  button "Add", 11, 203 49 27 10
  button "Remove", 12, 203 60 27 10
  button "Modify", 13, 203 71 27 10
  button "Clear", 14, 203 138 27 10
  box "Modes:", 15, 3 153 231 57
  check "Only ops set Topic (+t)", 16, 8 162 68 10
  check "No External msgs. (+n)", 17, 8 173 69 10
  check "Invite Only (+i)", 18, 8 184 50 10
  check "No Control Codes (+c)", 19, 8 195 66 10
  check "Private (+p)", 20, 84 162 43 10
  check "Secret (+s)", 21, 84 173 42 10
  check "Moderated v1 (+m)", 22, 84 184 59 10
  check "Moderated v2 (+M)", 23, 84 195 58 10
  check "Registered may join (+R)", 24, 150 162 75 10
  check "Key (+k):", 25, 150 173 35 10
  edit "", 26, 191 173 39 10, autohs
  check "Limit to (+l):", 27, 150 184 40 10
  edit "", 28, 191 184 22 10, autohs
  text "Users", 29, 214 185 15 8, center
  button "Cancel", 30, 193 213 40 10, cancel
  button "Apply", 31, 151 213 40 10
  button "OK", 32, 109 213 40 10, default
}
on 1:dialog:DCentral:init:*:{
  MDX MarkDialog $dname
  MDX SetMircVersion $version
  MDX SetControlMDX $dname 8,9,10 ListView report grid rowselect headerdrag showsel > $Views
  did -i $dname 8,9,10 1 setcolor bkg $color($color(background))
  did -i $dname 8,9,10 1 setcolor text $color($color(normal))
  did -i $dname 8,9,10 1 HeaderDims 170 170 110
  did -i $dname 8,9,10 1 HeaderText Item $chr(9) Set by $chr(9) Date and Time
  Central.Gen
}
on 1:dialog:DCentral:sclick:4-6:{
  if ($did == 4) { did -u $dname 5,6 | did -hb $dname 9,10 | did -ve $dname 8 }
  if ($did == 5) { did -u $dname 4,6 | did -hb $dname 8,10 | did -ve $dname 9 }
  if ($did == 6) { did -u $dname 4,5 | did -hb $dname 8,9 | did -ve $dname 10 }
}

on 1:dialog:DCentral:sclick:11-14:{
  if ($did(4).state == 1) && ($did($dname,8).lines > 1) {
    if ($did == 11) { set %DCentral AB | DCentrals }
    if ($did == 12) && ($DCentral.Sel(8)) { mode $active $+(-,$str(b,$numtok($DCentral.Sel(8),32))) $DCentral.Sel(8) | Central.Gen }
    if ($did == 13) && ($DCentral.Sel(8)) { set %DCentral EB $DCentral.Sel(8) | DCentrals }
    if ($did == 14) { DCentral.Ask b }
  }
  if ($did(5).state == 1) && ($did($dname,9).lines > 1) {
    if ($did == 11) { set %DCentral AE | DCentrals }
    if ($did == 12) && ($DCentral.Sel(9)) { mode $active $+(-,$str(e,$numtok($DCentral.Sel(9),32))) $DCentral.Sel(8) | Central.Gen }
    if ($did == 13) && ($DCentral.Sel(9)) { set %DCentral AE $DCentral.Sel(9) | DCentrals }
    if ($did == 14) { DCentral.Ask e }
  }
  if ($did(6).state == 1) && ($did($dname,10).lines > 1) {
    if ($did == 11) { set %DCentral AI | DCentrals }
    if ($did == 12) && ($DCentral.Sel(10)) { mode $active $+(-,$str(I,$numtok($DCentral.Sel(10),32))) $DCentral.Sel(8) | Central.Gen }
    if ($did == 13) && ($DCentral.Sel(10)) { set %DCentral AI $DCentral.Sel(10) | DCentrals }
    if ($did == 14) { DCentral.Ask i }
  }
}

on 1:dialog:DCentral:sclick:31,32:{
  if ($active ischan) {
    if ($did == 31) { did -b $dname $did | .timer.xx 1 1 /did -e $dname $did }
    if ($chan($active).topic != $did(2)) { topic $active $did(2) }
    var %DC+Mode,%DC-Mode
    var %modes = t n i c p s m M R,%x = 1
    while (%x <= $numtok(%modes,32)) {
      var %m = $gettok(%modes,%x,32)
      if ($did($calc(15 + %x)).state == 1) && (%m !isincs $gettok($chan($active).mode,1,32)) { %DC+Mode = $+(%DC+Mode,%m) }
      if ($did($calc(15 + %x)).state == 0) && (%m isincs $gettok($chan($active).mode,1,32)) { %DC-Mode = $+(%DC-Mode,%m) }
      inc %x
    }
    if ($did(27).state == 0) && (l isincs $gettok($chan($active).mode,1,32)) { %DC-Mode = $+(%DC-Mode,l) }
    if ($did(27).state == 1) && ($did(28) isnum) && ($chan($active).limit != $did(28)) { %DC+Mode = $+(%DC+Mode,l $did(28)) }

    mode $active $+($iif($len(%DC-Mode) > 0,-),%DC-Mode,$iif($len(%DC+Mode) > 0,+),%DC+Mode)

    if ($did(25).state == 1) && ($did(26)) && ($chan($active).key !=== $did(26)) { mode $active +k $did(26) }
    if ($did(25).state == 0) && (k isincs $gettok($chan($active).mode,1,32)) { mode $active -k $chan($active).key }

    if ($did == 32) { dialog -c $dname }
  }
  else { dialog -c $dname }
}

dialog DCentrals {
  title ""
  size -1 -1 128 54
  option dbu
  box "", 1, 3 1 122 39
  text "Address:", 2, 7 11 24 8
  edit "", 3, 32 10 89 10, autohs
  check "Remove ban in:", 4, 8 24 49 10
  combo 5, 57 24 32 40, size edit drop
  text "mins.", 6, 92 25 15 8
  button "Cancel", 7, 95 42 30 10, cancel
  button "...", 8, 63 42 30 10
}

on 1:dialog:DCentrals:init:*:{
  didtok $dname 5 32 1 5 10 15 20 25 30 35 40 45 50 55 60
  if (%DCentral == AB) { did -c $dname 5 1 | did -a $dname 8 Add | dialog -t $dname Add a ban... | halt }
  elseif ($left(%DCentral,2) == EB) {
    did -a $dname 3 $remove(%DCentral,EB,$chr(32))
    set %DCentral $remove(%DCentral,EB,$chr(32))
    did -a $dname 8 Modify
    dialog -t $dname Modify a ban...
    halt
  }
  if (%DCentral == AE) { did -hb $dname 4-6 | did -a $dname 8 Add | dialog -t $dname Add an Except... | halt }
  elseif ($left(%DCentral,2) == AE) {
    did -hb $dname 4-6
    did -a $dname 3 $remove(%DCentral,AE,$chr(32))
    set %DCentral $remove(%DCentral,AE,$chr(32))
    did -a $dname 8 Modify
    dialog -t $dname Modify an Except...
    halt
  }
  if (%DCentral == AI) { did -hb $dname 4-6 | did -a $dname 8 Add | dialog -t $dname Add an Invite... | halt }
  elseif ($left(%DCentral,2) == AI) {
    did -hb $dname 4-6
    did -a $dname 3 $remove(%DCentral,AI,$chr(32))
    set %DCentral $remove(%DCentral,AI,$chr(32))
    did -a $dname 8 Modify
    dialog -t $dname Modify an Invite...
    halt
  }
}
on 1:dialog:DCentrals:close:*:{ unset %DCentral }
on 1:dialog:DCentrals:sclick:8:{
  if ($did(DCentral,4).state == 1) {
    if ($chr(32) isin $did(3)) { beep | dialog -t $dname Error: Don't use SPACE!! | did -r $dname 3 | return }
    if ($chr(33) !isin $did(3) || $chr(64) !isin $did(3)) { beep | dialog -t $dname Error: Use *!*@* format! | did -r $dname 3 | return }
    else {
      if ($did(8).text == Modify) { 
        if ($did(3) == %DCentral) goto End
        else { mode $active -b+b %DCentral $did(3) }
      }
      else { mode $active +b $did(3) }
      if ($did(4).state == 1) { ban $+(-u,$iif($did(5),$v1), 1) $active $did(3) }
    }
  }
  if ($did(DCentral,5).state == 1) {
    if ($chr(32) isin $did(3)) { beep | dialog -t $dname Error: Don't use SPACE!! | did -r $dname 3 | return }
    if ($chr(33) !isin $did(3) || $chr(64) !isin $did(3)) { beep | dialog -t $dname Error: Use *!*@* format! | did -r $dname 3 | return }
    else {
      if ($did(8).text == Modify) { 
        if ($did(3) == %DCentral) goto End
        else { mode $active -e+e %DCentral $did(3) }
      }
      else { mode $active +e $did(3) }
    }
  }
  if ($did(DCentral,6).state == 1) {
    if ($chr(32) isin $did(3)) { beep | dialog -t $dname Error: Don't use SPACE!! | did -r $dname 3 | return }
    if ($chr(33) !isin $did(3) || $chr(64) !isin $did(3)) { beep | dialog -t $dname Error: Use *!*@* format! | did -r $dname 3 | return }
    else {
      if ($did(8).text == Modify) { 
        if ($did(3) == %DCentral) goto End
        else { mode $active -I+I %DCentral $did(3) }
      }
      else { mode $active +I $did(3) }
    }
  }
  :End
  dialog -x $dname
  if ($dialog(DCentral)) { Central.Gen }
}

on *:Active:*:{ if ($dialog(DCentral)) && ($active !isin $dialog(DCentral).title) { Central.Gen } }
on *:Ban:#:{ if ($dialog(DCentral)) { Central.Gen } }
on *:Unban:#:{ if ($dialog(DCentral)) { Central.Gen } }
on *:Mode:#:{
  if ($dialog(DCentral)) {
    if (e isincs $1) { set -u3 %_DCentral e }
    if (i isincs $1) { set -u3 %_DCentral i }
    Central.Gen
  }
}

Comments

Sign in to comment.
MaSOuD   -  Aug 11, 2010

You need to download and load it in your script. After download you have 2 ways to load it:

1) Unzip the "DCentral.zip" copy it into the your mIRC directory and use this command in your mIRC: //load -rs $+($shortfn($mircdir),DCentral\DCentral.mrc)

2) Copy it to directory and on the mIRC Script press Alt+R, click on "File" Menu from its Menubar and click on "Load" find the "DCentral.mrc" and load it.

 Respond  
Tannn3r   -  Aug 10, 2010

Do I need to download and add the snippet or just one? And where do the downloaded files go? Thanks.

 Respond  
MaSOuD   -  Aug 10, 2010

Updated.
It still doesn't check $chanmodes for Excepts/Invites; I'll add it in the next version.

 Respond  
MaSOuD   -  Jul 05, 2009

Link updated...

 Respond  
Spanky   -  Jul 05, 2009

uh the links dont work,

 Respond  
Kirby   -  Feb 03, 2009

Yeah, I think that's what I meant.

 Respond  
MaSOuD   -  Feb 03, 2009

lol :P
maybe you mean $chanmodes or /version from those we can getting the info about it...

 Respond  
Kirby   -  Feb 03, 2009

Maybe I'm wrong about the MOTD; ignore what I said. ;p

 Respond  
MaSOuD   -  Feb 03, 2009

hmm, getting info from MOTD?

 Respond  
Kirby   -  Feb 03, 2009

Looks neat..but some servers don't have Excepts/Invites, so is it possible to disable those parts of the dialog per each connected server, getting the info from the MTOD?

 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.