mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 38
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2006
Posts: 38
Have anybody seen such thing?

I am looking for a dll(s) ar anything that makes it possible to determine if user has not used the computer (not only mIRC) for a certain period of time. I have beel looking for it for a while in a number of places and found out everybody uses idle-based away machines which do not show the real away time (there can be even no idle). So I want find one based on mouse and keyboard inactivity.

It would be even greater if the dll was able to determine if audio/video player is currently running, as most people do not use input controls while watching video (anime!) or listening to the music.

Thanks for help.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
For the second part you could use $com

Code:
alias isprocess {
  var %a = a $+ $ticks, %b = b $+ $ticks, %c = $false
  .comopen %a WbemScripting.SWbemLocator
  if ($com(%a)) {
    .comclose %a $com(%a,ConnectServer,3,dispatch* %b)
    if ($com(%b)) {
      .comclose %b $com(%b,ExecQuery,3,bstr,Select Name From Win32_Process Where Name = ' $+ $1',dispatch* %a)
      if ($com(%a)) {
        noop $com(%a,Count,3)
        if ($com(%a).result) %c = $true
        .comclose %a
      }
    }
  }
  return %c
}


Then you can do something like:

Code:
alias ismediaopen {
  if ($isprocess(wmplayer.exe)) || ($isprocess(iTunes.exe)) || ($isprocess(winamp.exe)) || ($isprocess(rplayer.exe)) || ($isprocess(quicktime.exe)) return $true
  return $false
}

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You could replace:

noop $com(%a,Count,3)
if ($com(%a).result)

with:

if ($comval(%a,0))


Gone.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Ah I didn't realise $comval had that feature. Thanks smile


Link Copied to Clipboard