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.

How do I check if a user is known to my bot?

Old posts that have not been replied to for several years.
Locked
d
daVinci

Post by daVinci »

Hey everybody,

I'd like to add functionality to my bot so that users known to the bot can for example change the topic. Those users will be +f (friends) only.

Can anybody please tell me how to do this (if possible with some code or a reference to a already exsisting script) and how can +f users log in?

Thanks for reading sofar,

Vinz.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

+f users are recognized by their hostmasks just like other users. There's no logging in unless you have some sort of auth script running.

In your script, you can pass the 'f' flag to bind and it will only respond to +f users. Or, in your procs, you can test if they have +f with matchattr (see tcl-commands.doc).

So your topic changing thing would be sort of like this:

Code: Select all

bind pub f !topic my_set_topic
proc my_set_topic {nick uhost hand chan text} {
  putserv "TOPIC $chan :$text (set by $nick)"
  return 1
  # the 1 makes eggdrop log this command in the logfile
}
Locked