Option 1)
Code:
 on 1:join:#channel:{
write -c c:\channels.txt //users
}
 

Option 2)
Code:
 on 1:join:#Channel:{
  if $exists(c:\channels.txt) { remove c:\channels.txt }
  var %a = 1, %b = $nick($chan,0)
  while %a <= %b {
    write c:\channels.txt $nick($chan,%a)
    inc %a
  }
}
 


BTW: This should've been posted in the Scripts & Pop-ups Forum, not Developer Forum.