This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Creating a 'logged in' user list

Old posts that have not been replied to for several years.
Locked
s
shanks
Voice
Posts: 19
Joined: Mon Aug 18, 2003 7:03 am

Creating a 'logged in' user list

Post by shanks »

Ok I need some help - I'm trying to think of how to do this, but I can't - (Once I know 'how' to do it, I should be able to code most of it myself, it's just working out what is the best way of doing it)

What will happen: A user can /msg mybot login user pass

The bot then checks the username and password against a mysql database (this bit I've done fine) - if user/pass dont' match obviously it does nothing.

However, if the user + pass is accepted, I want the bot to add that person (the guy who logged in) to a user list.

When another proc is called, I want it to message every one who is in the user list.

when the person leaves a specific channel they get removed from the user list - if they change names it keeps them on the user list (but obviously with a new name so it'll need to be changed).

I'm not sure what would be the best way of doing this - with an array? A database table? A file?

Also, but the bit about getting the bot to message every one who is logged in.. not sure about that bit either.


Any help / ideas offered for this are much appreciated.
Thanks,

- shanks
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

simple, add extra flags to it's bot's user with "xtra"
tcl-commands.doc wrote: getuser <handle> <entry-type> [extra info]
Description: an interface to the new generic userfile support. Valid
entry types are:
BOTFL - returns the current bot-specific flags for the user
(bot-only)
BOTADDR - returns a list containing the bot's address, telnet port,
and relay port (bot-only)
HOSTS - returns a list of hosts for the user
LASTON - returns a list containing the unixtime last seen and the
last seen place. LASTON #channel returns the time last
seen time for the channel or 0 if no info exists.
INFO - returns the user's global info line
XTRA - returns the user's XTRA info
COMMENT - returns the master-visible only comment for the user
EMAIL - returns the user's e-mail address
URL - returns the user's url
HANDLE - returns the user's handle as it is saved in the userfile
PASS - returns the user's encrypted password
Returns: info specific to each entry-type
Once the game is over, the king and the pawn go back in the same box.
Locked