alias writeallusers {
var %file = channellist.txt
var %chan = $$1, %i = 1, %n = $nick(%chan,0)
fopen allusers %file
if ($ferr) {
echo -stc info Problem occurred with opening file $+(%",file,")
fclose allusers
return
}
fseek allusers $file(%file).size
while (%i < %n) {
fwrite allusers $nick(%chan,%i) $+ ,
if ($ferr) {
echo -stc info Problem occurred writing to file $+(%",file,")
fclose allusers
return
}
inc %i
}
fwrite -n allusers $nick(%chan,%i)
fclose allusers
}
; This will write all users to a new line in the file channellist.txt
on !*:JOIN:#yourchannel:writeallusers $chan
on !*:QUIT:#yourchannel:writeallusers $chan