Channel Modes Dialog

By Burrito on Aug 18, 2010

I made this Channel Modes Dialog to practice making dialogs. It is very similar to the default one, except for tabs and a few other things. When you comment please don't tell me how to shorten it, because I won't even read it. I know it can be shortened, but it works, so I don't care. This is my 2nd dialog.

/*
Channel Mode dialog created by Zeta of IRC.SwiftIRC.Net
It has lots of extra code that can be shortened, but please don't comment about that
*/
menu Channel {
  Channel Modes:/dialog -m modes modes | mode $active b | mode $active e | mode $active I
}
dialog modes {
  title "Channel Central"
  size -1 -1 250 211
  option dbu
  tab "Bans", 1, 0 -4 250 140
  list 4, 6 26 238 105, tab 1 size hsbar vsbar
  text "Bans List", 5, 9 15 27 10, tab 1
  edit "", 14, 31 140 207 10, tab 1 autohs
  button "Remove", 25, 197 12 37 12, tab 1
  button "Edit", 26, 156 12 37 12, tab 1
  button "Add", 34, 115 12 37 12, tab 1
  tab "Excepts", 2
  text "Excepts List", 6, 9 15 31 10, tab 2
  list 8, 6 26 238 105, tab 2 size hsbar vsbar
  button "Edit", 27, 156 12 37 12, tab 2
  button "Remove", 28, 197 12 37 12, tab 2
  button "Add", 35, 115 12 37 12, tab 2
  edit "", 32, 31 140 207 10, tab 2 autohs
  tab "Invites", 3
  text "Invites List", 7, 9 15 27 10, tab 3
  list 9, 6 26 238 105, tab 3 size hsbar vsbar
  button "Remove", 29, 197 12 37 12, tab 3
  button "Edit", 30, 156 12 37 12, tab 3
  edit "", 33, 31 140 207 10, tab 3 autohs
  button "Add", 36, 115 12 37 12, tab 3
  check "Only Ops Set Topic", 10, 18 153 58 15
  check "No External Messages", 11, 18 164 65 15
  check "Invite Only", 12, 18 175 58 15
  check "Moderated", 13, 18 186 58 15
  text "Topic", 15, 11 141 18 8
  check "Key:", 16, 94 153 23 15
  check "Limit to:", 17, 94 164 30 15
  edit "", 18, 126 167 21 10
  text "Users", 19, 149 168 25 8
  check "Private", 20, 94 175 58 15
  check "Secret", 21, 94 186 58 15
  button "OK", 22, 194 161 37 12, ok
  button "Cancel", 23, 194 175 37 12, cancel
  button "Help", 24, 194 189 37 12
  edit "", 31, 118 156 50 10
}
on *:DIALOG:Modes:INIT:0:{
  var %X 1
  var %B $ibl($active,0)
  while (%X <= %B) {
    did -i Modes 4 %X $ibl($active,%X) ---- $ibl($active,%X).by ---- $ibl($active,%X).date
    inc %X
  }
  var %c 1
  var %d $iel($active,0)
  while (%c <= %d) {
    did -i Modes 8 %c $iel($active,%c) ---- $iel($active,%c).by ---- $iel($active,%c).date
    inc %c
  }
  var %e 1
  var %f $iil($active,0)
  while (%e <= %f) {
    did -i Modes 9 %e $iil($active,%e) ---- $iil($active,%e).by ---- $iil($active,%e).date
    inc %e
  }
  tokenize 32 $chan($active).mode
  did -a Modes 14 $chan($active).topic
  did -a Modes 32 $chan($active).topic
  did -a Modes 33 $chan($active).topic
  if (p isincs $1) {
    did -c Modes 20
  }
  if (s isincs $1) {
    did -c Modes 21
  }
  if (t isincs $1) {
    did -c Modes 10
  }
  if (n isincs $1) {
    did -c Modes 11
  }
  if (k isincs $1) {
    did -c Modes 16
    did -a Modes 31 $chan($active).key
  }
  if (l isincs $1) {
    did -c Modes 17
    did -a Modes 18 $chan($active).limit
  }
  if (i isincs $1) {
    did -c Modes 12
  }
  if (m isincs $1) {
    did -c Modes 13
  }
  did -b Modes 25
  did -b Modes 26
  did -b Modes 27
  did -b Modes 28
  did -b Modes 29
  did -b Modes 30
  if ($me !isop $active) && ($me !ishop $active) {
    did -b Modes 34
    did -b Modes 35
    did -b Modes 36
    did -b Modes 10
    did -b Modes 11
    did -b Modes 12
    did -b Modes 13
    did -b Modes 16
    did -b Modes 17
    did -b Modes 20
    did -b Modes 21
    did -b Modes 31
    did -b Modes 18
  }
}
on *:DIALOG:Modes:SCLICK:24:{
  //help
}
on *:DIALOG:Modes:SCLICK:22:{
  if ($me !isop $active) && ($me !ishop $active) {
    close
    halt
  }
  if ($did(Modes, 14).text == $null) {
    topic $chan($active) $chr(160)
  }
  elseif ($did(Modes, 14).text != $chan($active).topic) {
    topic $chan($active) $did(Modes, 14).text
  }
  if ($did(Modes, 11).state == 0) {
    mode $chan($active) -n 
  }
  if ($did(Modes, 11).state == 1) {
    mode $chan($active) +n
  }
  if ($did(Modes, 21).state == 0) {
    mode $chan($active) -s
  }
  if ($did(Modes, 21).state == 1) {
    mode $chan($active) +s
  }
  if ($did(Modes, 20).state == 0) {
    mode $chan($active) -p
  }
  if ($did(Modes, 20).state == 1) {
    mode $chan($active) +p
  }
  if ($did(Modes, 12).state == 0) {
    mode $chan($active) -i
  }
  if ($did(Modes, 12).state == 1) {
    mode $chan($active) +i
  }
  if ($did(Modes, 13).state == 0) {
    mode $chan($active) -m
  }
  if ($did(Modes, 13).state == 1) {
    mode $chan($active) +m
  }
  if ($did(Modes, 16).state == 0) {
    mode $chan($active) -k $chan($active).key
  }
  if ($did(Modes, 16).state == 1) {
    mode $chan($active) +k $did(Modes, 31).text
  }
  if ($did(Modes, 17).state == 0) {
    mode $chan($active) -l
  }
  if ($did(Modes, 17).state == 1) {
    mode $chan($active) +l $did(Modes, 18).text
  }
}
on *:DIALOG:Modes:SCLICK:4:{
  if ($me !isop $active) && ($me !ishop $active) {
    halt
  }
  did -e Modes 25
  did -e Modes 26
}
on *:DIALOG:Modes:SCLICK:8:{
  if ($me !isop $active) && ($me !ishop $active) {
    halt
  }
  did -e Modes 27
  did -e Modes 28
}
on *:DIALOG:Modes:SCLICK:9:{
  if ($me !isop $active) && ($me !ishop $active) {
    halt
  }
  did -e Modes 29
  did -e Modes 30
}
on *:DIALOG:Modes:SCLICK:26:{
  $input(Please input the new address,e)
  if ($!) {
    mode $active -b+b $gettok($did(Modes, 4).seltext, 1, 32) $!
    did -d Modes 4 $did(Modes, 4).sel
    did -i Modes 4 1 $! ---- $me ---- $asctime(mmm ddoo h:mm)
  }
}
on *:DIALOG:Modes:SCLICK:25:{
  $input(Are you sure?,y)
  if ($! == $true) {
    mode $active -b $gettok($did(Modes, 4).seltext, 1, 32)
    did -d Modes 4 $did(Modes, 4).sel
  }
}
on *:DIALOG:Modes:SCLICK:27:{
  $input(Please input the new address,e)
  if ($!) {
    mode $active -e+e $gettok($did(Modes, 8).seltext, 1, 32) $!
    did -d Modes 8 $did(Modes, 8).sel
    did -i Modes 8 1 $! ---- $me ---- $asctime(mmm ddoo h:mm)
  }
}
on *:DIALOG:Modes:SCLICK:28:{
  $input(Are you sure?,y)
  if ($! == $true) {
    mode $active -e $gettok($did(Modes, 8).seltext, 1, 32)
    did -d Modes 8 $did(Modes, 8).sel
  }
}
on *:DIALOG:Modes:SCLICK:30:{
  $input(Please input the new address,e)
  if ($!) {
    mode $active -I+I $gettok($did(Modes, 9).seltext, 1, 32) $!
    did -d Modes 9 $did(Modes, 9).sel
    did -i Modes 9 1 $! ---- $me ---- $asctime(mmm ddoo h:mm)
  }
}
on *:DIALOG:Modes:SCLICK:29:{
  $input(Are you sure?,y)
  if ($! == $true) {
    mode $active -I $gettok($did(Modes, 9).seltext, 1, 32)
    did -d Modes 9 $did(Modes, 9).sel
  }
}
on *:DIALOG:Modes:SCLICK:34:{
  $input(Please input the new address to add,e)
  if ($!) {
    mode $active +b $!
    did -i Modes 4 1 $! ---- $me ---- $asctime(mmm ddoo h:mm)
  }
}
on *:DIALOG:Modes:SCLICK:35:{
  $input(Please input the new address to add,e)
  if ($!) {
    mode $active +e $!
    did -i Modes 8 1 $! ---- $me ---- $asctime(mmm ddoo h:mm)
  }
}
on *:DIALOG:Modes:SCLICK:36:{
  $input(Please input the new address to add,e)
  if ($!) {
    mode $active +I $!
    did -i Modes 9 1 $! ---- $me ---- $asctime(mmm ddoo h:mm)
  }
}

Comments

Sign in to comment.
WorldDMT   -  Aug 19, 2010

u can do many thing easly like

did -a Modes 14,32,33 $chan($active).topic
or
did -b Modes 25,26,27,28,29,30 this can be also
did -b Modes 25-30
and many thing more

 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.