|
Post by wmerussi on May 26, 2017 15:34:43 GMT
So, I have 4 regions, top, right, bottom and left. How may I check all of them at the same time?
To check for only 1 region it's used Region(x, y, w, h):exists(), what about 4 distinct ones?
Thanks in advance!
|
|
|
Post by Mercobots on May 26, 2017 22:51:56 GMT
hi i think is not possible ,you need check 1 by 1
|
|
|
Post by wmerussi on May 29, 2017 15:36:59 GMT
If anyone is interested, I made this function:
function insert_table(value, array, position)
size = count(array)
position = position or (size + 1)
table.insert(array, position, value)
end
function existsMulti(regions, pattern, wait)
existsRegions = {}
for index, region in ipairs(regions) do
if region:exists(pattern, wait) then
insert_table(region, existsRegions)
end
end
if count(existsRegions) > 0 then
return existsRegions
end
return false
end
Thanks Farrusco ^^
|
|