PDA

View Full Version : "easy" (i)TCL question?


Hans_
01-27-2014, 06:51 AM
Hi all,

as you know the topstats.tcl do not work anymore..my idea was to create a small script wich gets executed via the sheduler in ioftpd (wich works fine), it generates the file with the info i want.

so the next thing is to trigger an tcl or itcl file wich actualy reads that newly generated file for ex. stats.log via the ioftpd sheduler.

if some1 got any good ideas on how to do this?

basicly: open file, read and output each line to a specified channel(s)?

any help would be greatly appreciated :)

Yil
01-27-2014, 07:19 PM
Since you want to output to IRC you'll want to do that via windrop. There are many ways to do that. You could format all the output in the textfile generated by your ioFTPD script and then just print that to a channel via windrop by reading it in and sending it to a channel. You could output the data in a raw form via ioFTPD and then have the windrop script format the output. Either way you might want to think about things like !stats <nick> or whatever to output just subsets of the data. That might mean having windrop format the output is a better plan. Either way, it shouldn't be that hard but you'll have to learn some TCL to do it.

For just learning TCL you might want to look at something like Komodo from ActiveState. It won't play well with ioFTPD or windrop but you can play with it to figure out how to read a file, parse data, format text output, etc and once you've got that working things should go smoother.

I don't really have a better method of debugging ioFTPD scripts than defining a new TCL site command and calling that with lots of output to the logfile that I watch in another window... Kind of annoying, but it's the same thing in windrop as well. Server processes suck to debug.