ON *:TEXT:!*:#: {
tokenize 32 $strip($1-)
if ($1 == !addnick) {
if ($nick == westor) {
if (!%addnick. [ $+ [ $nick ] ]) {
if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify a nickname! | return }
set -eu600 %addnick. $+ $nick on
var %f = text.txt
var %l = $read(%f,n,1)
var %n = @ $+ $2
if ($istok(%l,%n,44)) { .msg # ( $+ $nick $+ ): The $qt($2) nickname is already into the list! | return }
var %l = $addtok(%l,%n,44)
write -l1 $qt(%f) %l
.msg # ( $+ $nick $+ ): The $qt(%n) has been added to the list!
}
}
else { .msg # ( $+ $nick $+ ): Error, You have NOT access for this command! }
}
if ($1 == !delnick) {
if ($nick == westor) {
if (!%delnick. [ $+ [ $nick ] ]) {
if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify a nickname! | return }
set -eu600 %delnick. $+ $nick on
var %f = text.txt
var %l = $read(%f,n,1)
var %n = @ $+ $2
if (!$istok(%l,%n,44)) { .msg # ( $+ $nick $+ ): The $qt($2) nickname is NOT into the list! | return }
var %l = $remtok(%l,%n,1,44)
write -l1 $qt(%f) %l
.msg # ( $+ $nick $+ ): The $qt(%n) has been removed from the list!
}
}
else { .msg # ( $+ $nick $+ ): Error, You have NOT access for this command! }
}
if ($1 == !nicks) {
if ($nick == westor) {
if (!%allnick. [ $+ [ $nick ] ]) {
set -eu600 %allnick. $+ $nick on
var %f = text.txt
var %l = $read(%f,n,1)
if (!%l) { .msg $chan ( $+ $nick $+ ): There is NOT any nickname into the list! }
elseif (%l) { .msg # ( $+ $nick $+ ): Nickname(s): %l }
}
}
else { .msg # ( $+ $nick $+ ): Error, You have NOT access for this command! }
}
if ($1 == !totalnicks) {
if ($nick == westor) {
if (!%totnick. [ $+ [ $nick ] ]) {
set -eu600 %totnick. $+ $nick on
var %f = text.txt
var %l = $read(%f,n,1)
if (!%l) { .msg $chan ( $+ $nick $+ ): There is NOT any nickname into the list! }
elseif (%l) { .msg # ( $+ $nick $+ ): There are $qt($numtok(%l,44)) nicknames into the list! }
}
}
else { .msg # ( $+ $nick $+ ): Error, You have NOT access for this command! }
}
if ($1 == !clearnicks) {
if ($nick == westor) {
if (!%clearnick. [ $+ [ $nick ] ]) {
set -eu600 %clearnick. $+ $nick on
var %f = text.txt
var %l = $read(%f,n,1)
if (!%l) { .msg $chan ( $+ $nick $+ ): There is NOT any nickname into the list! }
elseif (%l) {
.remove $qt(%f)
.msg # ( $+ $nick $+ ): All the nicknames have been cleared!
}
}
}
else { .msg # ( $+ $nick $+ ): Error, You have NOT access for this command! }
}
}