Uses 911K of libraries. Click here for Pure Java version (6971L/39K).
1 | !7 |
2 | |
3 | cmodule FindActiveTab > DynPrintLogAndEnabled { |
4 | transient CloseToColorPredicate solution = new(0x266D9F, 0.05051); |
5 | transient int gridSize = 4; |
6 | |
7 | start { |
8 | doEvery(1.0, r doIt); |
9 | } |
10 | |
11 | void doIt { |
12 | if (!enabled) ret; |
13 | time "Shoot" { |
14 | BufferedImage img = shootScreenArea(0, 0, screenWidth(), 50); |
15 | } |
16 | time "Analyze" { |
17 | RGBImage rgb = new(scaleImageWithFactor(1.0/gridSize, img)); |
18 | DoublePt pt = centroidForColorPredicate(solution, rgb); |
19 | } |
20 | if (pt == null) ret with print("No result"); |
21 | int x = iround(pt.x*gridSize), y = iround(pt.y*gridSize); |
22 | print(x + "/" + y); |
23 | pointArrowsToArea(toRectangle(rectAround(x, y, 80, 30)), 1.0); |
24 | } |
25 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1022953 |
Snippet name: | Find active tab v1 [OK] |
Eternal ID of this version: | #1022953/12 |
Text MD5: | 8fb0f5cee313e74aff8dd3ac4864dbee |
Transpilation MD5: | 3891465a9a13586789ebd3e39f67ed99 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-04-15 04:19:56 |
Source code size: | 714 bytes / 25 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 309 / 564 |
Version history: | 11 change(s) |
Referenced in: | [show references] |