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.

foreach question

Old posts that have not been replied to for several years.
Locked
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

foreach question

Post by Jag »

Code: Select all

foreach user [userlist |v #jag] {
whats wrong with this? :(
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

Well That is not the right way to do this.
This is the right way.
If it is voice that u mean then this the way.

Code: Select all

set channel #jag
foreach user [chanlist $channel] {
if {![isvoice $user $chan]} {
do something here }
return 1 }
[/code]
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

correct syntax:

Code: Select all

[chanlist #jag |v]
this will return users with channel +v flag.
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

Post by Jag »

Code: Select all

foreach user [chanlist #jag |A] {
  putlog "$user"
}
(jag) .chattr jag #jag
(KarishBot) [16:21] #jag# (#jag) chattr jag
(KarishBot) Channel flags for jagr on #jag are now +A.
and it didn't work :(
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

works fine with me, are you sure you are on the channel ?
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

Post by Jag »

it's

Code: Select all

[userlist #jag |A]
Thanks :P
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

userlist will get the name of all the users that have access on the specified channel with the specified flag while the chanlist gets the name of the users that have the specified flag on the channel and are on it at the moment of the check.
Once the game is over, the king and the pawn go back in the same box.
Locked