/** * do a find op with the given image or the given text in the Finder's image * (hasNext() and next() will reveal possible match results) * @param imageOrText image file name or text * @return null. if find setup not possible */ public String find(String imageOrText) { if (!valid) { log(-1, "not valid"); return null; } Image img = Image.create(imageOrText); if (img.isText()) { return findText(imageOrText); } if (img.isValid()) { return find(img); } return null; }
f = new Finder(getScreen().capture(x, y, w, h), this); lastSearchTime = (new Date()).getTime(); f.findText(someText);
log(lvl, "findInImage: Switching to TextSearch"); finder = new Finder(getScreen().capture(x, y, w, h), this); finder.findText((String) target);