Idle trigger

Discuss RoboTask here
Post Reply
siuf
Posts: 2
Joined: Tue Sep 24, 2013 11:38 am

Idle trigger

Post by siuf »

Hi,

I have task (log off - sleep) that is triggering when computer is idle .
I don't want this task to activate if video is playing (XBMC, VLC, Youtube and simmilar).
I couldn't find how to do this anywhere.

Please help!
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Idle trigger

Post by Oleg »

There is no universal mechanism.
For example: for VLC player you can check the existence of VLC.EXE process in memory

Like in this example:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2099193306
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task673"
Hide=INTEGER|0
ID=INTEGER|1478593806
LogOnAsUser=INTEGER|1
Name=STRING|"sleep if..."
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action1\Params]
case=STRING|"0"
operator=STRING|"1"
type=STRING|"3"
value1=STRING|"{IsProcessExists(vlc.exe)}"

[Actions\Action2]
ActionID=STRING|"A_GENERAL_LOGOFF"
Enabled=INTEGER|-1
Name=STRING|"Suspend the computer"
Params=FOLDER

[Actions\Action2\Params]
mode=STRING|"4"

[Actions\Action3]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
For YouTube you can check the existence the window with word YouTube
and etc.
Oleg Yershov
siuf
Posts: 2
Joined: Tue Sep 24, 2013 11:38 am

Re: Idle trigger

Post by siuf »

Thanks for the quick answer!

This is to complicated, to many possible programs.
Is it possible for robotask not to only monitor mouse and keyboard activity but also low power blocking that some programs use to prevent system to enter low power states?
I think that this would be great feature.

Also power off monitor would be great as log off option.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Idle trigger

Post by Oleg »

Look at the another one variant of the task (see below)
I think that this is not very complicated.
You can just add necessary process into the list in step #2 (Text loop)

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2099193306
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task673"
Hide=INTEGER|0
ID=INTEGER|1478593806
LogOnAsUser=INTEGER|1
Name=STRING|"sleep if..."
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""PROC"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"PROC"

[Actions\Action2]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action2\Params]
destvar=STRING|"PROC"
line0=STRING|"vlc.exe"
line1=STRING|"notepad.exe"
line2=STRING|"wmplayer.exe"
linecount=STRING|"3"
sourcetext=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{IsProcessExists({proc})}"

[Actions\Action4]
ActionID=STRING|"A_FLOW_EXIT"
Enabled=INTEGER|-1
Name=STRING|"Exit"

[Actions\Action5]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action6]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action7]
ActionID=STRING|"A_GENERAL_LOGOFF"
Enabled=INTEGER|-1
Name=STRING|"Suspend the computer"
Params=FOLDER

[Actions\Action7\Params]
mode=STRING|"4"
Oleg Yershov
Post Reply