Hello, i have an text file, that update each few mins, and i want to make an bot to keep update the channel, while an text added to the file, automatic not by command. anyone can show me how the script must be?
on *:start:.timercheckfile 0 60 checkfile
alias checkfile {
var %mtime = $file(file.txt).mtime
if (%mtime > %file.mtime) || (!%file.mtime) {
%file.mtime = %mtime
;file has changed do what you want
}
}
The example has a comment in there where you would put any commands you want to be done when the file is changed. You didn't provide a lot of detail on how you want it handled, so that part was left for you. If you want someone to do it for you, you'll need to provide some additional information...
* What changes in the file? Are lines added without removing lines? Are old lines removed and new ones added? Is the entire file changed? Are some lines in the middle changed to something else?
* How do you want the lines displayed? If there are a lot of lines, you could get flooded off the server or be stuck pasting lines for a very long time as more keep being added.
* If this is related to some kind of game or IM software or other public product, then mentioning the name of the game/site/product might produce a script that is already written to do what you want.