Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1010663 // Auto-Restart Program On Server Change [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (3320L/23K).

1  
!7
2  
3  
sS progID = #1009961;
4  
static double interval = 1;
5  
6  
p {
7  
  repeat with sleep interval {
8  
    checkProgram(progID);
9  
  }
10  
}
11  
12  
svoid checkProgram(S progID) ctex {
13  
  if (!isProgramRunning(progID)) { print(progID + " not running"); ret; }
14  
  
15  
  S newMD5 = getServerTranspilationMD5(progID);
16  
  if (!isMD5(newMD5)) { print("No server transpilation"); ret; }
17  
  print("Server MD5 for " + progID + ": " + newMD5);
18  
  
19  
  //S localMD5 = md5(DiskSnippetCache_get(psI(progID)));
20  
  S localMD5 = md5(loadCachedTranspilation(progID));
21  
  print("Local MD5: " + localMD5);
22  
23  
  if (neq(localMD5, newMD5)) {
24  
    restartProgram(progID);
25  
    sleepSeconds(10);
26  
  }
27  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010663
Snippet name: Auto-Restart Program On Server Change [OK]
Eternal ID of this version: #1010663/14
Text MD5: 8a06023d7293bd4373875155ab10e1ec
Transpilation MD5: a537b1c48db455a030cc7468c49eed7b
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-24 14:39:17
Source code size: 663 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 533 / 1158
Version history: 13 change(s)
Referenced in: [show references]