Advertisement
StavenCross

Untitled

Jan 6th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function()
  2. {
  3.  setInterval(logToSystem, 15000);
  4. });
  5.  
  6.  
  7. function logToSystem() {
  8.  
  9.     var lastCheck = window.localStorage.getItem('LastKeepAlive');
  10.     var now = new Date(Date.now());
  11.     if(now - lastCheck > 30000) {
  12.         alert('Disconnected ' + ((now-lastCheck)/1000) + ' seconds ago');
  13.     } else {
  14.         alert('Connected for ' + ((now-lastCheck)/1000) + ' seconds');
  15.     }
  16.     AHK('keepAliveCheck');
  17. }
  18.  
  19. function keepAliveUpdate() {
  20.     var now = new Date(Date.now());
  21.     window.localStorage.setItem('LastKeepAlive',now);
  22.     var response = "success";
  23.     return response
  24. }
  25.  
  26. /*AHK SCRIPT
  27. keepAliveCheck() { 
  28.     wb:=reconnectToPage()
  29.     response:=wb.Evaluate("keepAliveUpdate()")
  30.     wb.Disconnect()
  31. }
  32. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement