/*

Usage: $proguptime(process [,N])

If no N is specified, it will take the first instance of the process that you specified.

Examples:

$proguptime(notepad.exe,2)
$proguptime(winamp.exe)

*/

Code:
alias proguptime {
  var %a = $$1 $+ $ticks, %b = b $+ %a
  .comopen %a WbemScripting.SWbemLocator
  if ($comerr) return 
  .comclose %a $com(%a,ConnectServer,1,dispatch* %b) 
  if ($com(%b)) .comclose %b $com(%b,ExecQuery,1,bstr*,SELECT $&
    creationdate FROM Win32_Process WHERE Name = " $+ $1",dispatch* %a)
  if (!$com(%a)) return 
  %b = $comval(%a,$iif($2 isnum 1-,$2,1),creationdate)
  .comclose %a
  return $iif(%b,$msdate(%b))
}

alias msdate {
  return $duration($calc($ctime - $ctime($+($left($$1,4),-,$mid($1,5,2),-, $&
    $mid($1,7,2) $mid($1,9,2),:,$mid($1,11,2),:,$mid($1,13,2)))))
}


Edit: forgot to mention, you need atleast mIRC 6.16 for this, and minimum Windows 2000 professional.


Gone.