Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function()
- {
- setInterval(logToSystem, 15000);
- });
- function logToSystem() {
- var lastCheck = window.localStorage.getItem('LastKeepAlive');
- var now = new Date(Date.now());
- if(now - lastCheck > 30000) {
- alert('Disconnected ' + ((now-lastCheck)/1000) + ' seconds ago');
- } else {
- alert('Connected for ' + ((now-lastCheck)/1000) + ' seconds');
- }
- AHK('keepAliveCheck');
- }
- function keepAliveUpdate() {
- var now = new Date(Date.now());
- window.localStorage.setItem('LastKeepAlive',now);
- var response = "success";
- return response
- }
- /*AHK SCRIPT
- keepAliveCheck() {
- wb:=reconnectToPage()
- response:=wb.Evaluate("keepAliveUpdate()")
- wb.Disconnect()
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement