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).

!752

static int grabWidth = 500, grabHeight = 300;

p {
  forwardClicks(func(Point from, Point to, int btn) {
    //print("yo " + from + " " + to);
    Rect r = intersectWithScreen(rectAround(new Pt(from), grabWidth, grabHeight));
    BWImage img = shootScreenBW(r);
    L<Rect> rects = autoSegment(img, 3);
    print("Grabbing " + r + ", got " + n(l(rects), "rect"));
    Rect found = firstRectContaining(rects, from.x-r.x, from.y-r.y);
    if (found != null) {
      BWImage result = img.clip(found.getRectangle());
      quickShowZoomedImage(result.getBufferedImage());
    } else
      print("Nope");
    false; // don't forward click
  });
}

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: 528 / 633
Referenced in: [show references]