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

23
LINES

< > BotCompany Repo | #1006031 // Auto-Shoot Area Around Mouse Pointer

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

Libraryless. Click here for Pure Java version (4669L/31K/105K).

!752

static int grabWidth = 500, grabHeight = 300;

p {
  while licensed {
    pcall {
      Point from = mouseLocation();
      //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");
    }
    sleepSeconds(1);
  }
}

Author comment

Began life as a copy of #1006028

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: #1006031
Snippet name: Auto-Shoot Area Around Mouse Pointer
Eternal ID of this version: #1006031/1
Text MD5: c03c6c07ec4dcd86c012a86309999173
Transpilation MD5: 05958315ede4419277d5433b558d3a3a
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:20:54
Source code size: 695 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 525 / 605
Referenced in: