mIRC Home    About    Download    Register    News    Help

Print Thread
#235402 14/12/11 01:29 PM
Joined: Dec 2011
Posts: 2
E
Bowl of petunias
OP Offline
Bowl of petunias
E
Joined: Dec 2011
Posts: 2
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?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Checks every 60 seconds.

Code:
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
  }
}

Joined: Dec 2011
Posts: 2
E
Bowl of petunias
OP Offline
Bowl of petunias
E
Joined: Dec 2011
Posts: 2
hi, thank you for your help, i tested it, and its not do anything, i mean, its not showing in the channel the file content..?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard