|
Post by Exilereven on Jun 2, 2017 15:43:05 GMT
I just started scripting with ankukua, I've got the click("img.png")
To work perfectky, I can even use regions.
I'm trying to figure out how to make it recognize image is there, click it, wait for it to dissapear, then move on to next piece of code. It always says image is gone, but it's not, then it just moves right on to clicking the chest.png image.
It will click on image then just start going through rest commands, not waiting for previous image to go away before moving on. Here's my code any help would be great thanks.
-- ========== Settings ================ Settings:setCompareDimension(true, 1920) Settings:setScriptDimension(true, 1920) Settings:set("MinSimilarity", 0.65) righttop = Region(1580,20,140,140) center = Region (770,360,360,360) -- ========== main program =========== local img1 = "trolltop.png" local waitTime = 10 center:click (img1) if (waitVanish (img1,waitTime)) then print("image gone") else print ("image still here") end righttop:click ("chest.png")
|
|
|
Post by AnkuLua on Jun 2, 2017 23:22:51 GMT
try to insert some wait time after click(img1) Is the screen stable or changing? If still with problem, please share the screenshot with problem and img1. You can use usePreviousSanp(true) and save() after waitVanish to get the screenshot on what waitVanish last seen.
|
|
|
Post by Exilereven on Jun 4, 2017 3:01:18 GMT
Your advice was spot on, and thank you for the snapshot and save thing, will be helpful for debugging my image stuff.
|
|
|
Post by wmerussi on Jun 6, 2017 15:50:12 GMT
waitVanish() didn't work for me so I used:
while region:exists(pattern, 1) do -- nothing end
Hope it helps!
|
|