|
Post by wmerussi on May 17, 2017 20:41:29 GMT
How do I check for a pattern in a given Region?
I'm trying the code below but it seems it's not working, as an `Exception` is being thrown all the time, even if the pattern is there.
Region(0, 0, 80, 80):find(pattern.png) I know that the pattern is found because the code below works
find(pattern.png) How may I use it properly or check if the pattern is there before continuing the code?
|
|
|
Post by wmerussi on May 17, 2017 21:11:20 GMT
Ok, I got it, the thing was that my region was smaller than the pattern, so I made the region larger if Region(0, 0, 80, 80):exist(pattern.png) then -- found it, do something else -- didn't find it, do something else end
|
|