|
Post by newbiex on Oct 11, 2017 16:57:43 GMT
/* this check the whole region? if (exists("apple.png") then
/* how to find image in a specific region? reg = Region(10, 10, 300, 500) if (exists(reg:"apple.png") ) then
exists() function returns coordinates?
|
|
|
Post by newbiex on Oct 11, 2017 17:00:26 GMT
i think i got it now..
local optionsRegion = Region(550, 650, 650, 250) local sellPattern=Pattern("sell.png"):similar(0.9) if optionsRegion:exists(sellPattern,5) then
|
|
timtim
Junior Member
Posts: 67
|
Post by timtim on Feb 5, 2018 6:04:48 GMT
I am trying this and getting an error "attempt to index a nil value at getLastMatch():highlight(5)
though getLastMatch() works on full screen search but this one is giving error. Anyone know why?
imageToSearch = "ButtonAttack.png"
attackButtonRegion = Region(527,1135,493,197)
if (attackButtonRegion: exists(Pattern(imageToSearch):similar(0.80), 5)) then
print("found image")
getLastMatch():highlight(5)
end
To add:- This works perfectly imageToSearch = "ButtonAttack.png"
attackButtonRegion = Region(527,1135,493,197)
if (exists(Pattern(imageToSearch):similar(0.80), 5)) then
print("found image")
getLastMatch():highlight(5)
end
The aim is to use click (getLastMatch()) so as to save on search time again.
|
|
|
Post by AnkuLua on Feb 5, 2018 6:19:04 GMT
Use following for last match of attackButtonRegion region. attackButtonRegion:getLastMatch():highlight(5)
|
|