Max's Channel Admin Dialog v2

By MaxEvans on Apr 26, 2009

This is an idea I had to make an easier way to login to founder level access to channels. Basically, you can store two channels and channel passwords, and on each channel you can type /login and it'll identify with the channel you're in. And if you want to identify with one channel from another channel just type /login #ChannelName. It also has auto ID on join checkboxes, which basically auto identifies with the channel as soon as you join it.

V2 Update: I added channel registering to it so you can register a channel directly from the dialog.

Screenshot:

Image

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Max's Channel Admin Dialog v2 ;
;         By: Max Evans         ;
;       irc.geekshed.net        ;
;   #GeekUnderground & #Chris   ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;

dialog CAD {
  title "Max's Channel Admin Dialog v2"
  size -1 -1 196 148
  option dbu
  box Channel 1 - %cadchan1, 1, 4 51 89 84
  edit /login %cadchan1, 2, 35 68 50 10, read autohs
  edit %cadchan1, 3, 35 80 50 10, autohs
  edit %cadpass1, 4, 35 92 50 10, pass autohs
  button "Set", 5, 18 122 27 10
  button "Unset", 6, 51 122 27 10
  text "Command:", 8, 9 69 26 7, center
  text "Channel:", 9, 13 81 22 7, center
  text "Password:", 10, 9 93 26 7, center
  box Channel 2 - %cadchan2, 11, 100 51 89 84
  button "Set", 12, 114 122 27 10
  button "Unset", 13, 147 122 27 10
  edit /login %cadchan2, 15, 131 68 50 10, read autohs
  edit %cadchan2, 16, 131 80 50 10, autohs
  edit %cadpass2, 17, 131 92 50 10, pass autohs
  text "Command:", 18, 105 69 26 7, center
  text "Channel:", 19, 109 81 22 7, center
  text "Password:", 20, 105 93 26 7, center
  button "Okay", 21, 82 136 27 10, ok
  check "Auto ID On Join", 7, 23 108 52 7
  check "Auto ID On Join", 14, 119 108 52 7
  box "Register Channel", 24, 6 3 185 46
  edit "", 27, 130 19 50 10, autohs
  edit "", 26, 74 19 50 10, pass autohs
  edit "", 25, 17 19 50 10, autohs
  button "Register", 28, 83 34 31 10
  text "Channel", 29, 30 11 25 8, center
  text "Password", 30, 86 11 25 8, center
  text "Description", 31, 140 11 31 8, center
}

on *:Dialog:CAD:init:*: {
  did $iif(%cadchan1,-m,-n) $dname 3
  did $iif(%cadpass1,-m,-n) $dname 4
  did $iif(%cadchan2,-m,-n) $dname 16
  did $iif(%cadpass2,-m,-n) $dname 17
  if (%cadaid1 = ON) { did -c $dname  7 }
  if (%cadaid2 = ON) { did -c $dname 14 }
}

on *:Dialog:CAD:sclick:*: {
  if ($did == 5) { %cadchan1 = $did(CAD,3) | %cadpass1 = $did(CAD,4) | did -m CAD 3,4 }
  if ($did == 6) { unset %cadalias1 %cadchan1 %cadpass1 | did -n CAD 3,4 }
  if ($did == 12) { %cadchan2 = $did(CAD,16) | %cadpass2 = $did(CAD,17) | did -m CAD 16,17 }
  if ($did == 13) { unset %cadalias2 %cadchan2 %cadpass2 | did -n CAD 16,17 }
  if ($did == 21) {
    if ($did(CAD,7).state = 1) { %cadaid1 = on } | else { %cadaid1 = off }
    if ($did(CAD,14).state = 1) { %cadaid2 = on } | else { %cadaid2 = off }
  }
  if ($did == 28) { /chanserv register $did(CAD,25) $did(CAD,26) $did(CAD,27) }
}

alias login { 
  if ($chan == %cadchan1) { /chanserv identify %cadchan1 %cadpass1 }
  elseif ($chan == %cadchan2) { /chanserv identify %cadchan2 %cadpass2 }
  elseif ($$1 == %cadchan1) { /chanserv identify %cadchan1 %cadpass1 }
  elseif ($$1 == %cadchan2) { /chanserv identify %cadchan2 %cadpass2 }
}

on me:*:Join:%cadchan1: {
  if (%cadaid1 = on) { /login %cadchan1 }
}
on me:*:Join:%cadchan2: {
  if (%cadaid2 = on) { /login %cadchan2 }
}

menu * {
  .Max's Channel Admin Dialog: { dialog -m CAD CAD }
}

Comments

Sign in to comment.
PATX   -  Apr 29, 2009

rating: 5
reason: nice dialog ur a great at them! keep up da good work!. i also like the point + the code is pretty good.

 Respond  
Aucun50   -  Apr 27, 2009

Great dialogs max your really good at them. The script is good i like the option to have it auto id or not, also the "Command" not the standard /ns or /msg nickserv.

 Respond  
MaxEvans   -  Apr 27, 2009

The on me:*:join tells it to only work when you join the channel. I'm still learning about tokens, so once I figure out more about how to use them I'll be able to fix the variables using them.

And thanks. =]

 Respond  
Kirby   -  Apr 27, 2009

Cool Max.

The only thing I might recommend is to use perhaps only a single variable for each %cadchan(N) and %cadpass(N).
Since channel names and passwords can't have the 'comma' character (character #44) in them, you can perhaps use a few $gettok's to save yourself a few variables, though it may be more work than it is.
So never mind that. =/

The one thing that I'm confused about is:

on me:*:Join:%cadchan1: {

On 'me'? Never heard of that before. :O

Script looks good though.

 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.