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.
floid
Voice
Posts: 2 Joined: Fri Dec 10, 2004 3:50 pm
Post
by floid » Fri Dec 10, 2004 3:54 pm
I need a very simple script, it would be great if somebody could help me out: The script should write the current number of users in a certain channel to a text file.
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Fri Dec 10, 2004 4:15 pm
Code: Select all
set f [open file.txt w]
puts $f [llength [chanlist #yourchan]]
close $f
floid
Voice
Posts: 2 Joined: Fri Dec 10, 2004 3:50 pm
Post
by floid » Fri Dec 10, 2004 4:26 pm
demond wrote: Code: Select all
set f [open file.txt w]
puts $f [llength [chanlist #yourchan]]
close $f
thanks!
can you also expand the script, so that is automatically updates the file every minute? thanks a lot in advance!
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Fri Dec 10, 2004 4:33 pm
Code: Select all
bind time - * countusers
proc countusers {m h d mo y} {
set f [open file.txt w]
puts $f [llength [chanlist #yourchan]]
close $f
}
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Fri Dec 10, 2004 4:46 pm
countusers is an existing tcl command so its probably a good idea to give the proc a different name
photon?
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Fri Dec 10, 2004 4:53 pm
wisely said, spock
Code: Select all
bind time - * countchan
proc countchan {m h d mo y} {
set f [open file.txt w]
puts $f [llength [chanlist #yourchan]]
close $f
}