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: Select all
set data [lindex [split $arg] 1]
set type [lindex [split $arg] 2]
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.
