|
Post by Sikat on Apr 1, 2017 15:21:13 GMT
Does the usage of usePreviousSnap skips all the image finding functions' (exists, existsClick, etc.) waiting?
e.g
Will something like this run (almost) instantaneously ignoring the wait time?
if (exists(a,1)) then usePreviousSnap(true) existsClick(b, 3) existsClick(c, 3) existsClick(d, 3) usePreviousSnap(false) end
What about :
if (region_a:exists(a,1)) then usePreviousSnap(true) existsClick(b, 3) existsClick(c, 3) existsClick(d, 3) usePreviousSnap(false) end Would the script able to find image b,c,d outside of region_a?
Also
if (exists(a,1)) then usePreviousSnap(true) region_bot:existsClick(b, 3) existsClick(c, 3) existsClick(d, 3) usePreviousSnap(false) end Would the script able to find b in region_bot? Would the script able to find b outside of region_bot?
|
|
|
Post by AnkuLua on Apr 1, 2017 22:53:27 GMT
Does the usage of usePreviousSnap skips all the image finding functions' (exists, existsClick, etc.) waiting? e.g Will something like this run (almost) instantaneously ignoring the wait time? if (exists(a,1)) then usePreviousSnap(true) existsClick(b, 3) existsClick(c, 3) existsClick(d, 3) usePreviousSnap(false) end
Without snapping the pictures, it's much faster. But ignoring what wait time? Yes. The script can only find b in region_bot, because it specify the region. In general, usePrevious() just change to snap new screenshot or not. Everything else is still the same.
|
|
|
Post by Sikat on Apr 2, 2017 0:04:49 GMT
existsClick(PSMRL [, seconds]): Keeps searching the given pattern in the screen until the image appears or the specified amount of time has elapsed. If the pattern found, click on the target. No exception is generated even the pattern not found. The return value is boolean, true if pattern found.
Therefore, the docs said that it will wait x seconds then continue if the pattern is not found. However, since usePreviousSnap is true, it will not find anything if on the first check it does not find anything, right? So what's the use of waiting?
|
|
|
Post by AnkuLua on Apr 2, 2017 0:39:05 GMT
Seconds = 0 existsClick("target.png,0)
|
|
|
Post by Sikat on Apr 2, 2017 4:36:43 GMT
Ah, so you have to manually set the seconds to 0 instead of AnkuLua recognizing it's futile to wait because the image is still the same?
|
|
|
Post by AnkuLua on Apr 2, 2017 13:04:47 GMT
We can improve it in next release. But for now, please manually set the seconds to 0. Thanks.
|
|