Code:
on 1:JON:#channame: {
  var %n = $readini(users.ini,$chan,$nick) | inc %n
  writeini users.ini $chan $nick %n
  if (%n > 1) { echo $chan *** User Info: $nick has joined %n times }
  else { echo $chan *** $nick is a new user! }
}


that what u were looking for? it will count how many times each person joins a channel .. if its the first time it will say they are a new user, else it will say how many times the user has joined. .. and it could be set up to work for more than one chan.

as far as your 2nd q .. answering that without seeing the source code as to how it works .. all i can tell u is to use $lines() to count how many lines are in a file.

Cobra^