Check .txt file for updates? - 17/07/14 11:32 PM
Is there a way to have mIRC constantly (or maybe on a small delay) checking a certain file for if it updated or not? And if it DID update to display a certain message?
alias monitor { var %1 $1- if ($1 == list) { var %a 1 echo -a * /monitor's list: while ($timer(%a)) { if (monitor* iswm $v1) { echo -a $longfn($mid($v2,8)) } inc %a } } elseif ($1 == off) { :del if ($hget(monitor,$shortfn($2-))) { if ($show) echo -a * /monitor: $2- has been removed from the watched list hdel monitor $shortfn($2-) } .timermonitor $+ $shortfn($2-) off } elseif ($exists(%1)) { if ($isid) { tokenize 32 $hget(monitor,$shortfn(%1)) ;to add the check on $md5 too, use "if ($file(%1).mtime > $2) && ($md5(%1,2) != $1) {" if ($file(%1).mtime > $2) { echo -st %1 has changed (old md5: $1 - new md5: $md5(%1,2) $+ ) } } elseif ($show) echo -a * /monitor: $1- has been added from the watched list hadd -m monitor $shortfn(%1) $md5(%1,2) $file(%1).mtime .timermonitor $+ $shortfn(%1) -m 0 100 noop $!monitor( %1 ) } else .timer -h 1 0 monitor off %1 }
alias monitor { var %1 $1- if ($1 == list) { var %a 1 echo -a * /monitor's list: while ($timer(%a)) { if (monitor* iswm $v1) { echo -a $longfn($mid($v2,8)) } inc %a } } elseif ($1 == off) { :del if ($hget(monitor,$shortfn($2-))) { if ($show) echo -a * /monitor: $2- has been removed from the watched list hdel monitor $shortfn($2-) } .timermonitor $+ $shortfn($2-) off } elseif ($exists(%1)) { if ($isid) { tokenize 32 $hget(monitor,$shortfn(%1)) ;to add the check on $md5 too, use "if ($file(%1).mtime > $2) && ($md5(%1,2) != $1) {" if ($file(%1).mtime > $2) && ($md5(%1,2) != $1) { msg # /me New follower! Welcome, $read(C:\Users\braze_000\Documents\TeeBoard\widgets\notifications\follower-last.txt) $+ !!! } } elseif ($show) echo -a * /monitor: $1- has been added to the watched list hadd -m monitor $shortfn(%1) $md5(%1,2) $file(%1).mtime .timermonitor $+ $shortfn(%1) -m 0 100 noop $!monitor( %1 ) } else .timer -h 1 0 monitor off %1 }
if (%1 == file1) msg #chan ... elseif (%1 == file2) msg #chan ...
alias monitor { var %1 $1- if ($1 == list) { var %a 1 echo -a * /monitor's list: while ($timer(%a)) { if (monitor* iswm $v1) { echo -a $longfn($mid($v2,8)) } inc %a } } elseif ($1 == off) { :del if ($hget(monitor,$md5($2-))) { if ($show) echo -a * /monitor: $2- has been removed from the watched list hdel monitor $md5($2-) } .timermonitor $+ $md5($2-) off } elseif ($exists(%1)) { if ($isid) { tokenize 32 $hget(monitor,$md5(%1)) ;to add the check on $md5 too, use "if ($file(%1).mtime > $2) && ($md5(%1,2) != $1) {" if ($file(%1).mtime > $2) && ($md5(%1,2) != $1) { DO SOMETHING HERE } } elseif ($show) echo -a * /monitor: $1- has been added to the watched list hadd -m monitor $iif($md5(%1),$v1 $v1) $file(%1).mtime .timermonitor $+ $v1 -m 0 100 noop $!monitor( %1 ) } else .timer -h 1 0 monitor off %1 }