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.
Old posts that have not been replied to for several years.
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Mon Dec 27, 2004 4:52 am
I've been going at this for awhile but i can't seem to figure to figure out how to do it
What i came up with
Code: Select all
foreach channel [channels] { set user [llength [chanlist $channel]] }
This would return all the users for the channels, but i can't seem to figure out how to make the bot add it all up to one number, for example 203
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon Dec 27, 2004 5:14 am
Code: Select all
set count 0
foreach channel [channels] {
incr count [llength [chanlist $channel]]
}
# then use $count
Once the game is over, the king and the pawn go back in the same box.
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Mon Dec 27, 2004 6:05 am
Thanks figured it out, now the next problem i'm having is this
Code: Select all
set users 0 ; foreach channel [channels] { foreach nick [chanlist $channel] { if {[nick2hand $nick] != "*"} { incr users } } }
putquick "NOTICE $nickname :Currently AUTH'ed Users: $users"
This code counts every person that's authed at that moment but the problem is that it also counts the same handle again and i have no clue how to take that out
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Dec 27, 2004 10:13 am
Code: Select all
set ul {}
foreach c [channels] {
foreach n [chanlist $c] {
if {[nick2hand $n $c] != "*" && [lsearch -exact $ul $n] == -1} {
lappend ul $n
}
}
}
puthelp "notice $nick :auth'ed users: [llength $ul]"
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon Dec 27, 2004 10:39 am
Should you escape the * thing like "\*" ?
Once the game is over, the king and the pawn go back in the same box.
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Dec 27, 2004 10:46 am
you mean enclosing it in double quotes? yes, it's necessary... otherwise you get syntax error "unexpected operator *"
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon Dec 27, 2004 10:49 am
Actualy it should be "shouldnt" not "should" .. damn typo
Yah, something like that..
Once the game is over, the king and the pawn go back in the same box.