|
Post by oomkoos on Nov 22, 2019 5:14:50 GMT
I have the script below that searches the whole screen for a image soldPattern This takes a bit long, would it be faster if i make it search in a region only ?
The region is defined : boxRegion = Region(293,251,683,302)
How do i change the script below to just search for the image in the region?
while exists(soldPattern) do soldmatch = getLastMatch(soldPattern)
soldx = soldmatch:getCenter():getX()
soldy = soldmatch:getCenter():getY()
click(Location(soldx,soldy))
end
|
|
|
Post by AnkuLua on Nov 22, 2019 6:20:52 GMT
Change the whole script to boxRegion:existsClick(soldPattern)
Media projection screenshot method is faster.
|
|
|
Post by oomkoos on Nov 22, 2019 6:20:53 GMT
Got it:
boxRegion = Region(293,251,683,302) while (boxRegion:exists(soldPattern,2)) do -- === Clear sold items == soldmatch = boxRegion:getLastMatch():highlight(2) soldx = soldmatch:getCenter():getX() soldy = soldmatch:getCenter():getY() click(Location(soldx,soldy)) end
|
|
|
Post by oomkoos on Nov 22, 2019 6:21:49 GMT
Change the whole script to boxRegion:existsClick(soldPattern) Media projection screenshot method is faster. Thank you, i will change as above
|
|
|
Post by oomkoos on Nov 22, 2019 6:35:24 GMT
Media projection screenshot method is faster. I tried Media projection screenshot now, but when i do it changes the screen from landscape to upright and then coordinates doesnt work anymore Is there is a way to prevent that from happening ?
|
|
|
Post by AnkuLua on Nov 22, 2019 8:25:59 GMT
Media projection screenshot method is faster. I tried Media projection screenshot now, but when i do it changes the screen from landscape to upright and then coordinates doesnt work anymore Is there is a way to prevent that from happening ? Don't rotate the screen after starting the script.
|
|