Bug: IDLE not reset by emulated user activities

nnCron and nnCron LITE discussion

Bug: IDLE not reset by emulated user activities

Postby Yikes2000 » Mon, 18 Oct 2004, 00:31

According to the documents, emulated user activities should reset IDLE. As an example, the following task will print the value of idle timer (in ms) to the console each minutes. The timer is never reset, even though I am emulating user mouse activity.

Code: Select all
#( test_idle
NoLog
Action:
    MOUSE-MOVER: 1 1
    MOUSE-MOVER: -1 -1
    GetIdleTime . CR
)#
Yikes2000
 
Posts: 9
Joined: Mon, 18 Oct 2004, 00:17

Postby VK » Mon, 18 Oct 2004, 10:22

Yes, thank you for pointing. It seems all MOUSE-MOVE* words are not resetting the IDLE counter. All other user activity emulation words (like SEND-KEYS, MOUSE-LB*, MOUSE-RB*) are resetting the counter successfully.

2 Nicholas: can this issue be fixed or should I note this in the docs?
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby Nicholas_Nemtsev » Mon, 18 Oct 2004, 12:43

No, this issue can't be fixed.
Nicholas Nemtsev
User avatar
Nicholas_Nemtsev
Site Admin
 
Posts: 857
Joined: Thu, 01 Jul 2004, 22:25
Location: Псков

Postby VK » Mon, 18 Oct 2004, 12:57

OK, I'll update the docs as soon as possible.
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby Yikes2000 » Wed, 20 Oct 2004, 08:12

I was using 'IDLE' to hibernate my computer after 30 minutes:

Code: Select all
#( idle_hibernate
NoLog
Rule: IDLE 1800
Action: POWER-HIBERNATE
)#


When I wakeup my computer using Wake-On-LAN, it will hibernate again within 1 minute. The reason is that after waking up, the IDLE timer is still counting up from the time of the first hibernation. I also encounter this problem if I wake up the computer, but didn't move the mouse quickly enough - it hibernated again.

I used marker files to work around this issue:

Code: Select all
SET SLEEP_MARKER="C\Progra~1\nnCron\sleep_marker"
SET RESUME_MARKER="C\Progra~1\nnCron\resume_marker"

#( idle_hibernate
NoLog
Action:

   FILE-EXIST: %SLEEP_MARKER%
   IF
      FILE-DELETE: %SLEEP_MARKER%
      FILE-WRITE: %RESUME_MARKER% "touch"
   ELSE

      IDLE: 1800 \
      FT-CUR FILE-WTIME: %RESUME_MARKER% FTIME- 1800 > AND
      IF
         FILE-WRITE: %SLEEP_MARKER% "touch"
         POWER-HIBERNATE
      THEN
   THEN
)#


The above code will make sure the computer remains powered up after awaking from hibernation for 30 minutes, even without user interaction. I hope this is useful to someone.

P.S. I am using nnCron to hibernate because WinXP's hibernation doesn't work when some programs (e.g. if RealPlayer is running, it won't hibernate). nnCron doesn't have that problem.
Yikes2000
 
Posts: 9
Joined: Mon, 18 Oct 2004, 00:17

Postby VK » Wed, 20 Oct 2004, 10:00

Yes, AFAIK this is a known Windows problem. BTW - we have a special plugin for this purpose: http://www.nncron.ru/download/plugins/rstimer.spf (Resets system suspend timer: for example, this prevents resuming of sleep mode after automated system wake-up if there was no user activity for 5 minutes)
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby Yikes2000 » Thu, 21 Oct 2004, 00:48

No, Windows (XP) hibernation or standby are both turned off. I'm using just nnCron to hibernate the computer. It is nnCron's IDLE timer that keeps counting after Wake-on-LAN.
Yikes2000
 
Posts: 9
Joined: Mon, 18 Oct 2004, 00:17

Postby Yikes2000 » Thu, 21 Oct 2004, 19:57

Don't use the above script. It has a bug - manual hibernation will cause the computer to hibernate again within 1 minute when waking up. See the Network Traffic thread for an updated version that fixes this bug.
Yikes2000
 
Posts: 9
Joined: Mon, 18 Oct 2004, 00:17


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest