rendered paste bodymenu channel {
Channel Controls:/ccol
}
on *:OP:#:{
if ($opnick == $me) {
if ($dialog(ccol) != $null) {
did -a ccol 1 $chan
}
}
}
on *:deop:#:{
if ($opnick == $me) {
if ($dialog(ccol) != $null) {
did -d ccol 1 $didwm(ccol,1,$chan)
}
}
}
on *:help:#:{
if ($hnick == $me) {
if ($dialog(ccol) != $null) {
did -a ccol 1 $chan
}
}
}
on *:dehelp:#:{
if ($hnick == $me) {
if ($dialog(ccol) != $null) {
did -d ccol 1 $didwm(ccol,1,$chan)
}
}
}
on *:NICK:{
if ($dialog(ccol) != $null) && ($chan == $did(ccol,1).seltext) {
did -d ccol $didwm(ccol,2,$nick)
did -a ccol $newnick
}
}
on *:JOIN:#:{
if ($dialog(ccol) != $null) && ($chan == $did(ccol,1).seltext) {
did -a ccol 2 $nick
}
}
on *:part:#:{
if ($dialog(ccol) != $null) && ($chan == $did(ccol,1).seltext) {
did -d $didwm(ccol,1,$nick)
}
}
on *:QUIT:{
if ($dialog(ccol) != $null) && ($chan == $did(ccol,1).seltext) {
did -d $didwm(ccol,1,$nick)
}
}
alias ccol {
if ($dialog(ccol) == $null) {
dialog -ma ccol ccol
}
else {
dialog -v ccol ccol
}
}
dialog ccol {
title "Channel Controls"
size -1 -1 155 90
option dbu
list 1, 3 4 50 65, size
list 2, 59 14 50 55, size
button "Op", 4, 114 5 37 12
button "Half-Op", 5, 114 18 37 12
button "Voice", 6, 114 31 37 12
button "Kick", 7, 114 44 37 12
button "Kick Ban", 8, 114 57 37 12
button "Topic", 9, 14 73 37 12
button "Modes", 10, 60 73 37 12
button "Close", 11, 105 73 37 12, flat cancel
text "", 3, 59 5 50 8
}
on *:DIALOG:ccol:sclick:9:{
/topic $did($dname,1).seltext $$?="New Topic?"
}
on *:DIALOG:ccol:sclick:4:{
if ($remove($did($dname,2).seltext,@%+) isop $did($dname,1).seltext) {
/mode $did($dname,1).seltext -o $remove($did($dname,2).seltext,@%+)
}
else {
/mode $did($dname,1).seltext +o $remove($did($dname,2).seltext,@%+)
}
}
on *:DIALOG:ccol:sclick:7:{
/kick $did($dname,1).seltext $remove($did($dname,2).seltext
}
on *:DIALOG:ccol:sclick:8:{
/ban -k $did($dname,1).seltext $did($dname,2).seltext 3
}
on *:DIALOG:ccol:sclick:5:{
if ($remove($did($dname,2).seltext,@%+) ishop $did($dname,1).seltext) {
/mode $did($dname,1).seltext -h $remove($did($dname,2).seltext,@%+)
}
else {
/mode $did($dname,1).seltext +h $remove($did($dname,2).seltext,@%+)
}
}
on *:DIALOG:ccol:sclick:6:{
if ($remove($did($dname,2).seltext,@%+) isvoice $did($dname,1).seltext) {
/mode $did($dname,1).seltext -v $remove($did($dname,2).seltext,@%+)
}
else {
/mode $did($dname,1).seltext +v $remove($did($dname,2).seltext,@%+)
}
}
on *:DIALOG:ccol:sclick:10:{
set %chan $did($dname,1).seltext
cmod
}
on *:DIALOG:ccol:init:*:{
var %i = 0
while (%i < $chan(0)) {
inc %i 1
if ($me isop $chan(%i)) || ($me ishop $chan(%i)) {
did -a $dname 1 $chan(%i)
}
}
did -b $dname 4-10
}
on *:DIALOG:ccol:sclick:1:{
var %i = 0
did -r $dname 2
while (%i < $nick($did($dname,1).seltext,0)) {
inc %i 1
if ($nick($did($dname,1).seltext,%i) != $me) {
did -a $dname 2 $nick($did($dname,1).seltext,%i)
}
did -r $dname 3
did -a $dname 3 $did($dname,1).seltext
}
if ($me ishop $did($dname,1).seltext) || ($me isop $did($dname,1).seltext) {
did -e $dname 9,10
did -b $dname 4-8
}
}
on *:DIALOG:ccol:sclick:2:{
if ($me !isop $did($dname,1).seltext) {
did -b $dname 4
}
if ($me isop $did($dname,1).seltext) {
did -e $dname 4
}
did -e $dname 5-9
}
;-----------
;---MODES---
;-----------
alias cmod {
if ($dialog(cmod) == $null) {
dialog -ma cmod cmod
}
else {
dialog -v cmod cmod
}
}
dialog cmod {
title "Channel Modes"
size -1 -1 139 107
option dbu
button "Block Colors", 1, 6 8 37 12
button "Strip Colors", 2, 6 24 37 12
button "Invite Only", 3, 55 8 37 12
button "Password", 4, 56 62 37 12
button "Limit Users", 5, 95 77 37 12
button "Registered Nicks Only", 6, 62 91 63 12
button "Swear Filter", 7, 95 62 37 12
button "Topic Gaurd", 8, 55 24 37 12
button "Moderate", 9, 56 77 37 12
button "Secret Chan", 10, 94 8 37 12
button "Private Chan", 11, 94 24 37 12
box "Color Controls", 12, 2 1 45 37
button "No External Messages", 13, 62 39 63 12
box "Misc. Controls", 14, 51 1 87 53
box "Limiting Controls", 15, 51 55 87 51
button "Close", 16, 6 92 37 12, cancel
list 17, 2 40 45 50, size
}
on *:DIALOG:cmod:init:*:{
if (n isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [n] No External Messages
}
if (c isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [c] Block Colors
}
if (S isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [S] Strip Colors
}
if (R isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [R] Registered Nicks Only
}
if (G isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [G] Swear Filter
}
if (t isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [t] Topic Gaurd
}
if (s isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [s] Secret Channel
}
if (p isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [p] Private Channel
}
if (m isincs $gettok($chan(%chan).mode,1,32)) {
did -a $dname 17 [m] Moderated
}
if (k isincs $gettok($chan(%chan).mode,1,32)) {
if ( $gettok($chan(%chan).mode,3,32)) == $null) {
did -a $dname 17 [k] Password $gettok($chan(%chan).mode,2,32))
}
else { did -a $dname 17 [k] Password $gettok($chan(%chan).mode,3,32)
}
}
if ($me !isop %chan) {
did -b $dname 1,2,5,6,7,10,11
}
}
on *:DIALOG:cmod:close:*:{
unset %chan
}
on *:DIALOG:cmod:sclick:1:{
if (c isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -c
}
else {
mode %chan +c
}
}
on *:DIALOG:cmod:sclick:2:{
if (S isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -S
}
else {
mode %chan +S
}
}
on *:DIALOG:cmod:sclick:3:{
if (i isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -i
}
else {
mode %chan +i
}
}
on *:DIALOG:cmod:sclick:4:{
if (k isincs $gettok($chan(%chan).mode,1,32)) {
/echo -a 4Password is already set!
}
else {
mode %chan +k $$?="New Password"
}
}
on *:DIALOG:cmod:sclick:5:{
if (l isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -l
}
else {
mode %chan +l $$?="How many users will you allow in the channel?"
}
}
on *:DIALOG:cmod:sclick:6:{
if (R isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -R
}
else {
mode %chan +R
}
}
on *:DIALOG:cmod:sclick:7:{
if (G isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -G
}
else {
mode %chan +G
}
}
on *:DIALOG:cmod:sclick:8:{
if (t isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -t
}
else {
mode %chan +t
}
}
on *:DIALOG:cmod:sclick:9:{
if (m isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -m
}
else {
mode %chan +m
}
}
on *:DIALOG:cmod:sclick:10:{
if (s isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -s
}
else {
mode %chan +s
}
}
on *:DIALOG:cmod:sclick:11:{
if (p isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -p
}
else {
mode %chan +p
}
}
on *:DIALOG:cmod:sclick:13:{
if (n isincs $gettok($chan(%chan).mode,1,32)) {
mode %chan -n
}
else {
mode %chan +n
}
}