alias bigyn if (tolower($0) == [on]) {@ function_return = [\[1\;37mY\[0m|n]}{@ function_return = [y|\[1\;37mN\[0m]}
alias onoff if (([$0] && isnum($0)) || (tolower($0) == [on])) {@ function_return = [on]}{@ function_return = [off]}
alias configure.1 {
	clear;echo ${hwht}Function Keys${hblk}:${cl}
	for (@ num = [2], num <= 8, @ num++) {echo   ${cy}FKey ${hblk}[${hgrn}$num${hblk}]: ${cl}$funct[$num]${cl}}
	input "Enter \[1\;37mF2 \[0mbind: " if ([$0]) {@ funct.2 = [$0-]}
	input "Enter \[1\;37mF3 \[0mbind: " if ([$0]) {@ funct.3 = [$0-]}
	input "Enter \[1\;37mF4 \[0mbind: " if ([$0]) {@ funct.4 = [$0-]}
	input "Enter \[1\;37mF5 \[0mbind: " if ([$0]) {@ funct.5 = [$0-]}
	input "Enter \[1\;37mF6 \[0mbind: " if ([$0]) {@ funct.6 = [$0-]}
	input "Enter \[1\;37mF7 \[0mbind: " if ([$0]) {@ funct.7 = [$0-]}
	input "Enter \[1\;37mF8 \[0mbind: " if ([$0]) {@ funct.8 = [$0-]}
}
alias configure.2 {
	clear;echo ${hwht}Flood Protection${hblk}:${cl}
	echo   ${cy}Delay between ctcps      ${hblk}: ${hwht}$[-2]{ctcp_delay}s${cl}
	echo   ${cy}Max kicks allowed per 30s${hblk}: ${hwht}$[-2]kick_on_kickflood${cl}
	echo   ${cy}Max nicks allowed per 30s${hblk}: ${hwht}$[-2]kick_on_nickflood${cl}
	echo   ${cy}Max deops allowed per 30s${hblk}: ${hwht}$[-2]deop_on_deopflood${cl}
	echo   ${cy}Max joins allowed per 30s${hblk}: ${hwht}$[-2]kick_on_joinflood${cl}
	echo   ${cy}Max lines allowed per 10s${hblk}: ${hwht}$[-2]kick_on_pubflood${cl}
	input "\(Current: \[1\;37m$[-2]{ctcp_delay}\[0m\) Delay between ctcps: " if ([$isnum($0)]) {^set ctcp_delay $0}
	input "\(Current: \[1\;37m$[-2]{kick_on_kickflood}\[0m\) Max kicks allowed per 30s: " if ([$isnum($0)]) {^set kick_on_kickflood $0}
	input "\(Current: \[1\;37m$[-2]{kick_on_nickflood}\[0m\) Max nicks allowed per 30s: " if ([$isnum($0)]) {^set kick_on_nickflood $0}
	input "\(Current: \[1\;37m$[-2]{deop_on_deopflood}\[0m\) Max deops allowed per 30s: " if ([$isnum($0)]) {^set deop_on_deopflood $0}
	input "\(Current: \[1\;37m$[-2]{kick_on_joinflood}\[0m\) Max joins allowed per 30s: " if ([$isnum($0)]) {^set kick_on_joinflood $0}
	input "\(Current: \[1\;37m$[-2]{kick_on_pubflood}\[0m\) Max lines allowed per 10s: " if ([$isnum($0)]) {^set kick_on_pubflood $0}
}
alias configure.3 {
	clear;echo ${hwht}DCC Options${hblk}:${cl}
	echo   ${cy}Dcc Autoget   ${hblk}: ${hwht}$[-4]onoff($dcc_autoget)${cl}
	echo   ${cy}Dcc Fast Send ${hblk}: ${hwht}$[-4]onoff($dcc_fast)${cl}
	echo   ${cy}Dcc Get Limit ${hblk}: ${hwht}$[-4]dcc_get_limit${cl}
	echo   ${cy}Dcc Send Limit${hblk}: ${hwht}$[-4]dcc_send_limit${cl}
	echo   ${cy}Dcc Send Queue${hblk}: ${hwht}$[-4]dcc_queue_limit${cl}
	echo   ${cy}Dcc Block Size${hblk}: ${hwht}$[-4]dcc_block_size${cl}
	echo   ${cy}Dcc Autorename${hblk}: ${hwht}$[-4]onoff($dcc_autorename)${cl}
	input_char "\(Current: \[1\;37m$[-4]{dcc_autoget}\[0m\) Dcc Autoget [$bigyn($onoff($dcc_autoget))]: " if ([$0] == [y]) {^set dcc_autoget on}{^set dcc_autoget off}
	input_char "\(Current: \[1\;37m$[-4]{dcc_fast}\[0m\) Dcc Fast Send [$bigyn($onoff($dcc_fast))]: " if ([$0] == [y]) {^set dcc_fast on}{^set dcc_fast off}
	input "\(Current: \[1\;37m$[-4]{dcc_get_limit}\[0m\) Dcc Get Limit: " if ([$isnum($0)]) {^set dcc_get_limit $0}
	input "\(Current: \[1\;37m$[-4]{dcc_send_limit}\[0m\) Dcc Send Limit: " if ([$isnum($0)]) {^set dcc_send_limit $0}
	input "\(Current: \[1\;37m$[-4]{dcc_queue_limit}\[0m\) Dcc Send Queue: " if ([$isnum($0)]) {^set dcc_queue_limit $0}
	input "\(Current: \[1\;37m$[-4]{dcc_block_size}\[0m\) Dcc Block Size: " if ([$isnum($0)]) {^set dcc_block_size $0}
	input_char "\(Current: \[1\;37m$[-4]{dcc_autorename}\[0m\) Dcc Autorename [$bigyn($onoff($dcc_autorename))]: " if ([$0] == [y]) {^set dcc_autorename on}{^set dcc_autorename off}
}
alias configure.4 {
	clear;^local type;echo ${hwht}Prompt Chars${hblk}:${cl}
	for (@ num = [0], num <= 9, @ num++) {echo   ${cy}Char ${hblk}[${hgrn}$num${hblk}]: $prompt[$num]${cl}$prompt[$num]${hwht}$prompt[$num]${cl}}
	for (@ num = [0], num <= 9, @ num++) {if ([$prompt.x] == [$prompt[$num]]) {@ type = [$num]}}
	input_char "\(Current: \[1\;37m${type}\[0m\) Select prompt character: " if ([$isnum($0)] && ([$0] >= 0) && ([$0] <= 9)) {@ prompt.x = [$prompt[$0]];refresh.p}
}
alias configure.5 {
	clear;echo ${hwht}AltNick List${hblk}:${cl}
	for (@ num = [0], num <= 9, @ num++) {echo   ${cy}Nick ${hblk}[${hgrn}$num${hblk}]: ${cl}$nick.alt[$num]${cl}}
	input "\(Current: \[1\;37m$[-9]{nick.alt.0}\[0m\) Enter 0th nickname: " if ([$0]) {@ nick.alt.0 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.1}\[0m\) Enter 1st nickname: " if ([$0]) {@ nick.alt.1 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.2}\[0m\) Enter 2nd nickname: " if ([$0]) {@ nick.alt.2 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.3}\[0m\) Enter 3rd nickname: " if ([$0]) {@ nick.alt.3 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.4}\[0m\) Enter 4th nickname: " if ([$0]) {@ nick.alt.4 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.5}\[0m\) Enter 5th nickname: " if ([$0]) {@ nick.alt.5 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.6}\[0m\) Enter 6th nickname: " if ([$0]) {@ nick.alt.6 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.7}\[0m\) Enter 7th nickname: " if ([$0]) {@ nick.alt.7 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.8}\[0m\) Enter 8th nickname: " if ([$0]) {@ nick.alt.8 = [$0]}
	input "\(Current: \[1\;37m$[-9]{nick.alt.9}\[0m\) Enter 9th nickname: " if ([$0]) {@ nick.alt.9 = [$0]}
}
alias configure.6 {
	clear;echo ${hwht}Nick Completion${hblk}:${cl}
	for (@ num = [0], num <= 16, @ num++) {echo   ${cy}Type ${hblk}[${hgrn}$[-2]num${hblk}]: ${cl}$nickcomp($num $N)${cl}}
	input "\(Current: \[1\;37m${type.n}\[0m\) Select completion type: " if ([$isnum($0)] && ([$0] >= 0) && ([$0] <= 16)) {@ type.n = [$0]}
}
alias config.refresh {
	@ configure.1 = [FKey Binds]
	@ configure.2 = [Flood Prot]
	@ configure.3 = [DCC Options]
	@ configure.4 = [Prompt Char]
	@ configure.5 = [AltNick List]
	@ configure.6 = [Nick Completion]
	@ configure.a = [Sounds]		;@ config.a = [$onoff($sounds)]
	@ configure.b = [Ban Type]		;@ config.b = [$bantype($type.b)]
	@ configure.c = [User Modes]		;@ config.c = [$usermode]
	@ configure.d = [Bitch Mode]		;@ config.d = [$onoff($bitch)]
	@ configure.e = [Join On Invite]	;@ config.e = [$onoff($ainv)]
	@ configure.f = [Rejoin On Kick]	;@ config.f = [$onoff($auto_rejoin)]
	@ configure.g = [Long Ctcp Format]	;@ config.g = [$onoff($type.c)]
	@ configure.h = [Kick Banned Users]	;@ config.h = [$onoff($kick_if_banned)]
	@ configure.i = [Kick On Caps/Bold]	;@ config.i = [$onoff($annoy_kick)]
	@ configure.j = [Nethack Prot Level]	;switch ($hacking) {(2) {@ config.j = [echo]} (1) {@ config.j = [on]} (0) {@ config.j = [off]}}
	@ configure.k = [Autoaway]		;@ config.k = [$onoff($auto_away)]
	@ configure.l = [Supress Server Motd]	;@ config.l = [$onoff($suppress_server_motd)]
	@ configure.m = [Auto Channel Cycling]	;@ config.m = [$onoff($cycle)]
	@ configure.n = [Kick On Ctcp Version]	;@ config.n = [$onoff($autokick_on_version)]
	@ configure.o = [Inform Ignored Users]	;@ config.o = [$onoff($send_ignore_msg)]
	@ configure.u = [Utils Directory]	;@ config.u = [$utils]
	@ configure.v = [Sounds Directory]	;@ config.v = [$audir]
	@ configure.w = [Dcc Get Directory]	;@ config.w = [$dcc_dldir]
	@ configure.x = [Dcc Send Directory]	;@ config.x = [$dcc_uldir]
}
alias config {
	config.refresh;clear
	echo ${hwht} ${cy}EN${hcyn}i${cy}GMA ${cy}Configuration ${hwht}ķ${cl}
	echo ${hwht} ${hblk}[${hgrn}1${hblk}]${cy} Configure${hcyn}: ${cl}$[21]configure.1 ${hblk}[${hgrn}2${hblk}]${cy} Configure${hcyn}: ${cl}$[22]configure.2 ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}3${hblk}]${cy} Configure${hcyn}: ${cl}$[21]configure.3 ${hblk}[${hgrn}4${hblk}]${cy} Configure${hcyn}: ${cl}$[22]configure.4 ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}5${hblk}]${cy} Configure${hcyn}: ${cl}$[21]configure.5 ${hblk}[${hgrn}6${hblk}]${cy} Configure${hcyn}: ${cl}$[22]configure.6 ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}7${hblk}]${cy} Configure${hcyn}: ${cl}$[21]configure.7 ${hblk}[${hgrn}8${hblk}]${cy} Configure${hcyn}: ${cl}$[22]configure.8 ${hwht}${cl}
	echo ${hwht}Ķ${cl}
	echo ${hwht} ${hblk}[${hgrn}A${hblk}]${cy} $[21]configure.a${hcyn}- ${cl}$[-9]config.a ${hblk}[${hgrn}B${hblk}]${cy} $[22]configure.b${hcyn}- ${cl}$[-9]config.b ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}C${hblk}]${cy} $[21]configure.c${hcyn}- ${cl}$[-9]config.c ${hblk}[${hgrn}D${hblk}]${cy} $[22]configure.d${hcyn}- ${cl}$[-9]config.d ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}E${hblk}]${cy} $[21]configure.e${hcyn}- ${cl}$[-9]config.e ${hblk}[${hgrn}F${hblk}]${cy} $[22]configure.f${hcyn}- ${cl}$[-9]config.f ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}G${hblk}]${cy} $[21]configure.g${hcyn}- ${cl}$[-9]config.g ${hblk}[${hgrn}H${hblk}]${cy} $[22]configure.h${hcyn}- ${cl}$[-9]config.h ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}I${hblk}]${cy} $[21]configure.i${hcyn}- ${cl}$[-9]config.i ${hblk}[${hgrn}J${hblk}]${cy} $[22]configure.j${hcyn}- ${cl}$[-9]config.j ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}K${hblk}]${cy} $[21]configure.k${hcyn}- ${cl}$[-9]config.k ${hblk}[${hgrn}L${hblk}]${cy} $[22]configure.l${hcyn}- ${cl}$[-9]config.l ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}M${hblk}]${cy} $[21]configure.m${hcyn}- ${cl}$[-9]config.m ${hblk}[${hgrn}N${hblk}]${cy} $[22]configure.n${hcyn}- ${cl}$[-9]config.n ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}O${hblk}]${cy} $[21]configure.o${hcyn}- ${cl}$[-9]config.o ${hblk}[${hgrn}P${hblk}]${cy} $[22]configure.p${hcyn}- ${cl}$[-9]config.p ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}Q${hblk}]${cy} $[21]configure.q${hcyn}- ${cl}$[-9]config.q ${hblk}[${hgrn}R${hblk}]${cy} $[22]configure.r${hcyn}- ${cl}$[-9]config.r ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}S${hblk}]${cy} $[21]configure.s${hcyn}- ${cl}$[-9]config.s ${hblk}[${hgrn}T${hblk}]${cy} $[22]configure.t${hcyn}- ${cl}$[-9]config.t ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}U${hblk}]${cy} $[21]configure.u${hcyn}- ${cl}$[-9]config.u ${hblk}[${hgrn}V${hblk}]${cy} $[22]configure.v${hcyn}- ${cl}$[-9]config.v ${hwht}${cl}
	echo ${hwht} ${hblk}[${hgrn}W${hblk}]${cy} $[21]configure.w${hcyn}- ${cl}$[-9]config.w ${hblk}[${hgrn}X${hblk}]${cy} $[22]configure.x${hcyn}- ${cl}$[-9]config.x ${hwht}${cl}
	echo ${hwht}Ķ${cl}
	echo ${hwht}                 ${hblk}[${hgrn}!${hblk}] ${cy}save ${hblk}- ${cl}save all changes since last save                ${hwht}${cl}
	echo ${hwht}Ľ${cl}
	input_char "Select: " if ([$0]) {configure $0}
}
alias configure switch ($toupper($0)) {
	(.) {config}
	(!) {saveall}
	(1) {configure.1}
	(2) {configure.2}
	(3) {configure.3}
	(4) {configure.4}
	(5) {configure.5}
	(6) {configure.6}
	(A) {input_char "Sounds [$bigyn($config.a)]: " if ([$0] == [y]) {@ sounds = [1]}{@ sounds = [0]}}
	(B) {input_char "Ban Type [\[1\;37mhusnbd\[0m]: " if ([$match($tolower($0) h u s n b d)]) {@ type.b = [$tolower($0)];bantype $type.b}}
	(C) {input "User Modes: " if ([$0]) {^set usermode $0;umode $0}}
	(D) {input_char "Bitch Mode [$bigyn($config.d)]: " if ([$0] == [y]) {^set bitch on}{^set bitch off}}
	(E) {input_char "Join On Invite [$bigyn($config.e)]: " if ([$0] == [y]) {^set ainv 1}{^set ainv 0}}
	(F) {input_char "Rejoin On Kick [$bigyn($config.f)]: " if ([$0] == [y]) {^set auto_rejoin 1}{^set auto_rejoin 0}}
	(G) {input_char "Long Ctcp Format [$bigyn($config.g)]: " if ([$0] == [y]) {@ type.c = [1]}{@ type.c = [0]}}
	(H) {input_char "Kick Banned Users [$bigyn($config.h)]: " if ([$0] == [y]) {^set kick_if_banned on}{^set kick_if_banned off}}
	(I) {input_char "Kick On Caps/Bold [$bigyn($config.i)]: " if ([$0] == [y]) {^set annoy_kick on}{^set annoy_kick off}}
	(J) {input_char "Nethack Prot Level [012]: " if ([$isnum($0)]) {^set hacking $0}}
	(K) {input_char "Autoaway [$bigyn($config.k)]: " if ([$0] == [y]) {^set auto_away on}{^set auto_away off}}
	(L) {input_char "Supress Server Motd [$bigyn($config.l)]: " if ([$0] == [y]) {^set suppress_server_motd on}{^set suppress_server_motd off}}
	(M) {input_char "Auto Cycle Channels [$bigyn($config.m)]: " if ([$0] == [y]) {@ cycle = [1]}{@ cycle = [0]}}
	(N) {input_char "Kick On Ctcp Version [$bigyn($config.n)]: " if ([$0] == [y]) {^set autokick_on_version on}{^set autokick_on_version off}}
	(O) {input_char "Inform Ignored Users [$bigyn($config.o)]: " if ([$0] == [y]) {^set send_ignore_msg on}{^set send_ignore_msg off}}
	(U) {input "Utils Directory: " if ([$0]) {@ utils = [$0]}}
	(V) {input "Sounds Directory: " if ([$0]) {@ audir = [$0]}}
	(W) {input "Dcc Get Directory: " if ([$0]) {^set dcc_dldir $0}}
	(X) {input "Dcc Send Directory: " if ([$0]) {^set dcc_uldir $0}}
	(*) {config}
}
