|
Post by wmerussi on Jun 6, 2017 15:46:44 GMT
I'm trying to check for a color in a given region but to search for 100 pixels takes about 16 seconds with the function bellow:
for i = 1, 100 do
local r, g, b = getColor(Region(1, i, 1, 1))
print("i: " .. i .. ", r: " .. r .. ", g: " .. g .. ", b: " .. b)
-- do something end
So I took a screen shot and made a 1px with the color I wanted, but it always returns true with the code below, even if I put exact() and the color is not at the region:
pmColor = Pattern("pm-color.png"):exact()
if messageArea:exists(pmColor) then
scriptExit("found")
end
How may I make this better in performance or is there a better way to find for a specific color within a region?
Thanks in advance!
|
|
|
Post by theycallmek on Jun 6, 2017 18:46:31 GMT
BZZZZZZZZZ [delete plz]
|
|
|
Post by wmerussi on Jun 6, 2017 18:58:36 GMT
Thanks for the reply! I tried with a 3px image, but I got the same result... I've "evolved" to this question though: ankulua.boards.net/thread/499/fixIt seems it's faster to use the same image, but that error appears.
|
|
|
Post by AnkuLua on Jun 6, 2017 22:27:47 GMT
|
|
|
Post by wmerussi on Jun 7, 2017 14:44:42 GMT
Sweet, thanks for the example code, now its working and it's way faster. Thanks you so much Ankulua!
I was taking the snapshop of an exists function and not from a getColor funcion, that was the difference!
Cheers!
|
|