| View previous topic :: View next topic |
| Author |
Message |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Sun Dec 21, 2008 6:05 pm Post subject: Custom log file sort of |
|
|
Hi there im looking for help on how i would go about clearing a log file every 24 hours a sort of custom log file i guess based on specific triggers.
Any help appreciated thanks _________________ Driving lessons bolton |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Dec 21, 2008 6:18 pm Post subject: |
|
|
To clear a file you can use this code
| Code: | set f [open <file> w]
close $f |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Sun Dec 21, 2008 6:19 pm Post subject: |
|
|
cool thanks that will do  _________________ Driving lessons bolton |
|
| Back to top |
|
 |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Mon Dec 22, 2008 12:34 pm Post subject: |
|
|
This doesnt appear to work for me so im confused i tried to do it on a bind time basis and nothing also did it on a trigger and that didnt work either.
bind pub - !clear clear
proc clear {} {
global db
set f [open $db w]
close $f
}
Actually the above code just give an error when i try
Tcl error [clear]: wrong # args: should be "clear"
but as i say ive also tried to do it on a time basis
I tried to add things like
proc clear { nick uhost handle chan arg } {
but still gave simmilar arror to above. so any help appreciated. _________________ Driving lessons bolton |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Dec 22, 2008 2:26 pm Post subject: |
|
|
Since clear is triggered by a time-bind, it should take "minute hour day month year" (the names do not matter) as its parameters. You can just use "args" since you're not going to use any of the proc's parameters.
| Code: | proc clear args {
global db
set f [open $db w]
close $f
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|