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

26
LINES

< > BotCompany Repo | #1020171 // Watch Module Screenshot For Changes [OK]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (15567L/108K).

1  
!7
2  
3  
module WatchModule > DynPrintLogAndEnabled {
4  
  int interval = 200;
5  
  S moduleID;
6  
  transient BufferedImage lastImage;
7  
  
8  
  start {
9  
    doEvery(interval, r {
10  
      if (!enabled) ret;
11  
      O mod = dm_getModule(moduleID);
12  
      if (mod == null) ret;
13  
      BufferedImage img = dm_moduleScreenShot_noFocus_justContents(mod);
14  
      try {
15  
        if (lastImage != null && !imagesIdentical(img, lastImage))
16  
          printWithMilliseconds("CHANGE!");
17  
      } finally { lastImage = img; }
18  
    });
19  
  }
20  
  
21  
  visualize {
22  
    ret northAndCenterWithMargins(
23  
      dm_moduleSelectorComboBox_justID(dm_fieldLiveValue('moduleID)),
24  
      super.visualize());
25  
  }
26  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020171
Snippet name: Watch Module Screenshot For Changes [OK]
Eternal ID of this version: #1020171/8
Text MD5: 728dfbaee9c3d3bcf9b02c6d1f868f24
Transpilation MD5: 3dae2a6d602e4cae1cbdf5638bcfd466
Author: stefan
Category: javax / stefan's os / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-09 21:21:30
Source code size: 675 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 255 / 378
Version history: 7 change(s)
Referenced in: [show references]