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.

counter

Help for those learning Tcl or writing their own scripts.
Post Reply
h
helpme
Voice
Posts: 17
Joined: Sun May 08, 2005 11:07 am

counter

Post by helpme »

can you help me pls, after a .restart the counter begins from 0 -- sfda


Code: Select all

if {![file exists usersbny]} { close [open usersbny w+] }  
if {![info exists usersbny]} {  
  set file [open usersbny r]  
  set usersbny [gets $file]  
  close $file  
  
  if {$usersbny == ""} { set usersbny 0 }  
}  
  
bind join - * bny_voice  
proc bny_voice { nick uhost hand chan } {  
global usersbny  
incr usersbny  
putquick "notice $nick :Hi $nick. There are $usersbny joins since 30.01.2006. Welcome to $chan!"  
set file [open counter.txt w]
puts $file $usersbny  
close $file
}  
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Your first line is obviously blank then?
Post Reply