mIRC Home    About    Download    Register    News    Help

Print Thread
Keyboard/Mouse away machine (dll?) #144571
11/03/06 09:04 PM
11/03/06 09:04 PM
Joined: Feb 2006
Posts: 38
N
NineTails Offline OP
Ameglian cow
NineTails  Offline OP
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.

Re: Keyboard/Mouse away machine (dll?) #144572
11/03/06 09:16 PM
11/03/06 09:16 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
hixxy  Offline
Hoopy frood
H

Joined: Sep 2005
Posts: 2,876
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
}

Re: Keyboard/Mouse away machine (dll?) #144573
11/03/06 09:36 PM
11/03/06 09:36 PM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
You could replace:

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

with:

if ($comval(%a,0))


Gone.
Re: Keyboard/Mouse away machine (dll?) #144574
12/03/06 10:36 AM
12/03/06 10:36 AM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
hixxy  Offline
Hoopy frood
H

Joined: Sep 2005
Posts: 2,876
Ah I didn't realise $comval had that feature. Thanks smile