[eluser]WanWizard[/eluser]
Last activity is also stored in the session record.
It's not entirely accurate, as it is actually the last session update timestamp, so it depends on the session id rotation time you have defined in the config (default = 300 seconds).
You can easily run a query to get all session records from users active in the last 10 minutes or so. Loop through the results, unserialize the user_data, and retrieve the user info. This also allows you to count guests (user_data without user info).