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.

Need a small add script :)

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
Danko
Voice
Posts: 18
Joined: Thu Mar 09, 2006 1:07 pm

Need a small add script :)

Post by Danko »

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: Select all

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. :)
Post Reply