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

58
LINES

< > BotCompany Repo | #1005750 // Find Start Button [execution, dev., v2]

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

Libraryless. Click here for Pure Java version (5123L/32K/109K).

!752

concepts.

!include #1005686 // PIF Classes v2

static L<BWImage> images;
static float similarity = 0.99f;

concept LastFound {
  BWImage img;
  Rect position;
}

p {
  concepts();
  images = loadGoodClipsFrom("#1005676");
  
  while licensed {
    step();
    sleepSeconds(1);
  }
}

svoid step {
  LastFound lf = latest(LastFound);
  if (lf != null && verify(lf))
    print("Verified!");
  else {
    deleteAll(LastFound);
    fullSearch();
    lf = latest(LastFound);
    if (lf != null && verify(lf))
      print("Verified!");
    else
      print("Not found.");
  }
}

svoid fullSearch {
  print("Full search.");
  BWImage big = new BWImage(shootScreen2());
  for (BWImage pat : images)
    for (FoundImg fi : bwRawImageSearch(big, pat, similarity)) {
      cnew(LastFound, img := pat, position := fi.r);
      print("Found.");
      ret;
    }
}

sbool verify(LastFound lf) {
  try {
    ret bwImagesSimilar(new BWImage(shootScreen2(lf.position)), lf.img, similarity);
  } catch e {
    printShortException(e);
    false;
  }
}

Author comment

Began life as a copy of #1005749

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005750
Snippet name: Find Start Button [execution, dev., v2]
Eternal ID of this version: #1005750/1
Text MD5: c733b229272239e49442d90c6a9837e1
Transpilation MD5: b3ff0692ce78d91aa1def70396ae5769
Author: stefan
Category: javax / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-05 23:54:11
Source code size: 1096 bytes / 58 lines
Pitched / IR pitched: No / No
Views / Downloads: 462 / 517
Referenced in: [show references]