on [color:red] BOTMASTER [/color]:text:!chan *:*:{
if ($2 == add && $3 != $null) {
var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
if ($read(list.txt,w,%chan) == $null) {
write list.txt %chan
.notice $nick $3 added to list.
}
else .notice $nick Channel already exists.
}
elseif ($2 == del && $3 != $null) {
var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
if ($read(list.txt,w,%chan) != $null) {
write -dl $+ $readn list.txt
.notice $nick $3 deleted from list.
} else .notice $nick No channel on list.
} elseif ($2 == join) {
var %cnt = 1 var %lines = $lines(list.txt)
while (%cnt <= %lines) {
join -n $read(list.txt,%cnt)
inc %cnt
}
}
else .notice $nick Invalid command.
}