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.

listing all users with a certain attribute

Old posts that have not been replied to for several years.
Locked
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

listing all users with a certain attribute

Post by z_one »

Hi,

What's the loop that would list all the users added on the bot with a flag "+o" for example.

Thanks.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Code: Select all

foreach myuser [userlist] { 
if {[matchattr $myuser o]} {
....
}
} 
not tested, but it should work
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You don't need the matchattr command, userlist provides this function allready.

Code: Select all

foreach op [userlist o|o] {
   ...code
}
B
Bytez
Op
Posts: 168
Joined: Mon Aug 11, 2003 1:42 pm

Post by Bytez »

can't you just type .match +o
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Bytez wrote:can't you just type .match +o
he's talking about a loop to list all admins, what he does with the output is another question... .match is just one formated output of the same proc
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

Thanks for your replies, however the code suggested by ppslim does the trick for me.
I don't want to list admins only. I wanted to list all the users with any flag I choose. It could be flag "f" or anything else.
Locked