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

20
LINES

< > BotCompany Repo | #1006028 // Auto-Shoot Area Around Mouse Click

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

Libraryless. Click here for Pure Java version (4815L/33K/118K).

1  
!752
2  
3  
static int grabWidth = 500, grabHeight = 300;
4  
5  
p {
6  
  forwardClicks(func(Point from, Point to, int btn) {
7  
    //print("yo " + from + " " + to);
8  
    Rect r = intersectWithScreen(rectAround(new Pt(from), grabWidth, grabHeight));
9  
    BWImage img = shootScreenBW(r);
10  
    L<Rect> rects = autoSegment(img, 3);
11  
    print("Grabbing " + r + ", got " + n(l(rects), "rect"));
12  
    Rect found = firstRectContaining(rects, from.x-r.x, from.y-r.y);
13  
    if (found != null) {
14  
      BWImage result = img.clip(found.getRectangle());
15  
      quickShowZoomedImage(result.getBufferedImage());
16  
    } else
17  
      print("Nope");
18  
    false; // don't forward click
19  
  });
20  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006028
Snippet name: Auto-Shoot Area Around Mouse Click
Eternal ID of this version: #1006028/1
Text MD5: b1da34eac7c7aa1db15b24c39b56c997
Transpilation MD5: 95636dfa366ec3b4ef13049cb2cf7576
Author: stefan
Category: javax / gui
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-15 02:18:26
Source code size: 666 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 530 / 635
Referenced in: [show references]