Maybe something like:
on *:CONNECT:{
var %ajoin = 1
while (%ajoin <= $lines(ajoin.txt)) {
join $read(ajoin.txt, %ajoin)
inc %ajoin
}
}
on $*:Text:/^!ajoin\s(.*)/Si:#:{
if ($regex($nick($chan,$nick).pnick,/(!|@|&|~)/)) {
if ($2 == add) {
if ($read(ajoin.txt, w, $3)) msg $chan $3 is already on my ajoin list.
else write ajoin.txt $3 | msg $chan $3 added to my ajoin list
}
if ($2 == del) {
if (!$read(ajoin.txt, w, $3)) msg $chan 3 is not on my ajoin list to delete.
else write -ds $+ $3 ajoin.txt | msg $chan $3 removed from my ajoin list.
}
if ($2 == count) {
msg $chan I have $lines($read(ajoin.txt, w, $3)) channel's on my ajoin list.
}
}
}
?