If you are using webmail or any other page that thinks it needs to log you out after just a few minutes (like it is the only thing you are working on). Here is some code to help you keep a page alive indefinitely.
While the code below is the full script to allow for pausing and resuming the heart of this are two lines:
1 |
$oIE=_IECreate("https://YOURPAGEHERE.COM",0,1,1,1) |
and
1 |
_IEAction($oIE, "refresh") |
These two lines are the most important. _IECreate launches an instance if IE and $oIE is the hook to send it commands.
There are lots more you can do like write a screen scraper (that is another story for another time)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
Global $Paused, $MinMax, $currwin HotKeySet("{PAUSE}", "TogglePause") HotKeySet("+!q", "quit") ;Shift-Alt-q #include <IE.au3> if not (ProcessExists("THENAMEOFTHEPROGRAM") )Then $oIE=_IECreate("https://YOURPAGEHERE",0,1,1,1) Send("{Pause}") While 1 keepAlive() wend EndIf Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused-Shift-Alt-q to quit',0,0) WEnd ToolTip("Keep Alive Script is Running - Shift-Alt-q to quit",0,0) EndFunc Func keepAlive() sleep(random(60000,120000)) _IEAction($oIE, "refresh") EndFunc Func quit() Exit EndFunc |