Script to count unique number of user loged in

Hi all, I am taking my first course in unix and having some problems.

I would line to create a scrip that does the following:

1) will tell me the number of users logged in. If a user is logged more than once just count it only ones.

2) want to be able to display the number of users that logged before me.

3) want to be able to display the number of user that logged after me.

4) run this process every 30 minutes.

Please help.

Peter Fana

Please read our rules.