SUNiNET - Your Eggdrop & TCL resources site
[ Home Eggdrop TCL Links About ]

Guide to TCL scripting for Eggdrop 1.6

[ Previous ] [ Index ] [ Next ]

12.6 Checking user flags

At some points you might want to check if a user has a certain flag before you want the bot to execute something, you could want somebody to be at least a master for example.
This can be done with the matchattr command.
The syntax of a matchattr command is matchattr <handle> <flag(s)> [channel].

The <handle> is the name of the user you want to check, this has to be the nickname in which the bot knows the user and not the current nickname of the user.

The <flag(s)> are the flags you want to check.
This can be a number of flags or just one.
Note that if you use "of" for instance as <flag(s)> the bot will check if the user has +o OR +f, not +o AND +f.
You can seperate the different flags with a | or & to define whether you want the bot the check if the user has all those flags or just one of them, so "o&f" would make the bot check if the user has +o AND +f.

The [channel] is of which channel the flag will be checked.
Note that if you specify a channel, only the channel flags of the user are checked and not the global flags, so a global moderator without a +o channel flag would turn up negative in this command unless you make it "+o OR +o for #chan".

For example, matchattr $hand o|o $chan would check if the user is a global operator or a channel operator of $chan, matchattr $hand o&m $chan would check if the user is a global operator and a master of $chan.

[ Previous ] [ Index ] [ Next ]

Design & Graphics by Shawn Borton
Copyright © 2000-2005 Marijn van Zon