|
Post by centurianzz on Apr 10, 2020 10:07:08 GMT
Hi there, im trying to do an infinite loop running so that whenever an image pops up on the screen it will start the next clicking through the next step, then when it finishes it goes back to the start waiting for the image again. My problem is after the fist successful loop it seems to stop recognising the image so maybe its the way I've written the script? It always works first time it sees the image then stops recognising the image after the 1st loop.
Here is the code: (first time coding too so any help would be great)
REG = {}
-- Ankulua TIMEOUT = 3 SIMILAR = 0.8 WIDTH = 1080 HEIGHT = 1920
ROOT = scriptPath()
DIR_IMAGES = ROOT .. "images/" DIR_LIBS = ROOT .. "libs/" setImagePath(DIR_IMAGES)
-- Ankulua settings -- --------------------------------------- Settings:setCompareDimension(true, WIDTH) Settings:setScriptDimension(true, WIDTH) Settings:set("AutoWaitTimeout", TIMEOUT) Settings:set("MinSimilarity", SIMILAR)
luaLib = loadstring(httpGet("https://raw.githubusercontent.com/mercobots/luaLib/master/luaLib.lua")) luaLib()
commonLib = loadstring(httpGet("https://raw.githubusercontent.com/AnkuLua/commonLib/master/commonLib.lua")) commonLib()
--Main start--
while ( true ) do
if(exists("hatch.png")) then click(Location(547, 1132)) wait(11)
click(Location(528, 1779)) wait(2) click(Location(539, 1780)) wait(4) click(Location(237, 1572)) wait(3) click(Location(781, 182)) wait(2) click(Location(213, 529)) wait(2) click(Location(572, 1402)) wait(2.5) click(Location(146, 1393)) wait(1.5) click(Location(551, 1800)) wait(1) else toast("image not found") wait(30) end end
|
|