mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170
edited my post, but it was the folder the file was in that had the problem. Spaces work fine for me but foldername(1) doesn't. An explanation on why would be nice but I just renamed the folder and it's fine. Thanks anyway smile

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Yes, you must be using window 8 or higher, which doesn't handle $shortfn, you need to workaround that, by using the $md5 of the filename for example.

Code:
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
}
Should work, didn't try it.

"(1)" inside a folder name shouldn't be an issue

Last edited by Wims; 23/10/14 11:31 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Page 2 of 2 1 2

Link Copied to Clipboard