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

25
LINES

< > BotCompany Repo | #1022953 // Find active tab v1 [OK]

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

Uses 911K of libraries. Click here for Pure Java version (6971L/39K).

!7

cmodule FindActiveTab > DynPrintLogAndEnabled {
  transient CloseToColorPredicate solution = new(0x266D9F, 0.05051);
  transient int gridSize = 4;
  
  start {
    doEvery(1.0, r doIt);
  }
  
  void doIt {
    if (!enabled) ret;
    time "Shoot" {
      BufferedImage img = shootScreenArea(0, 0, screenWidth(), 50);
    }
    time "Analyze" {
      RGBImage rgb = new(scaleImageWithFactor(1.0/gridSize, img));
      DoublePt pt = centroidForColorPredicate(solution, rgb);
    }
    if (pt == null) ret with print("No result");
    int x = iround(pt.x*gridSize), y = iround(pt.y*gridSize);
    print(x + "/" + y);
    pointArrowsToArea(toRectangle(rectAround(x, y, 80, 30)), 1.0);
  }
}

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: 239 / 477
Version history: 11 change(s)
Referenced in: [show references]