I've got a problem with a computer session (citrix) with an idle time of 30 mins. I need to display the information 24/7, but the idle timer keeps disconnecting my session after 30 mins.
I cannot change the idle time at the moment. I've tried caffeine - which isn't working.
Furthermore, I've created several scripts which (for instance) checks the idle time (Idletime > 20mins) and moves the mouse and send a f15 key - what other ways do I have to simulate a user?
Code: Select all
SetTitleMatchMode, 2
VarsToSearch := ["Dynamics", "Rolcentrum", "Taakoverzicht"]
SetTimer, CheckTime, 5000 ; Time in miliseconds (1000 = 1s)
Code: Select all
CheckTime:
if (A_TimeIdle > 1200000)
{
; MsgBox, 0, , % A_TimeIdle, 2
; Define the time
TheTime := A_Hour A_Min
; is day monday - friday?
if A_WDay between 1 and 7
{
; Is the time between set variables
If TheTime between 0530 and 2330 && !Ran)
{
; Create a loop
Loop, 1
{
Sleep, 500
; Display tooltip
TrayTip, LZ, Searching for Dynamics NAV, 10, 17
Sleep, 3000
; Check if NAV Dynamics is running, else start it
If WinExist("Dynamics")
{
HideTrayTip()
Sleep, 1000
TrayTip, LZ, Activating Dynamics NAV and simulating user input, 10, 17
Sleep, 1000
For Key, Value in VarsToSearch
If WinExist(%Value%)
{
; Active Window in order of variables
WinActivate, %Value%
Sleep, 300
MouseMove, 1, 1, 1, R
Sleep 500
MouseMove, -1, 1, 1, R
Sleep, 300
Send, {F15}
}
}
Else
{
HideTrayTip()
Sleep, 1000
TrayTip, LZ, Dynamics NAV not found, 10, 17
Goto Process
}
Ran := 1
}
}
}
}