Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Wed Mar 22, 2006 6:09 am Post subject: Need a small add script :) |
|
|
Hi there,
I need a small script for adding and reading data from a file.
The trigger it must respond to looks like this:
!add data type
If I'm not mistaken code for that part should be
| Code: | set data [lindex [split $arg] 1]
set type [lindex [split $arg] 2] |
However, I need to write whats added to a texfile, new line each time something gets added. Textfile should look like "unixtime type data".
For the reading part, trigger would be !find data.
Output to chan would be FOUND: data was added XXX (w/d/hr/m/s) ago (mmdd)..
Thats all I need.
However, if possible and if its not too much work, there would also be quite nice with;
· Reading from textfile before adding to check if data allready exists. If so, return/halt.
· Adding the recently added data into cach/memory for 3600 seconds, and check cach/memory if data is allready there before checking from textfile (would prevent unnecessary lag/reading afaik).
I'd be greatful for any help I could get.  |
|