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.

help needed

Old posts that have not been replied to for several years.
Locked
f
floid
Voice
Posts: 2
Joined: Fri Dec 10, 2004 3:50 pm

help needed

Post by floid »

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.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set f [open file.txt w]
puts $f [llength [chanlist #yourchan]]
close $f
f
floid
Voice
Posts: 2
Joined: Fri Dec 10, 2004 3:50 pm

Post by floid »

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!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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 
}
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

countusers is an existing tcl command so its probably a good idea to give the proc a different name
photon?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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
}
Locked