Post by zukks on May 19, 2020 18:00:16 GMT
Hey guys, i'm new to scripting and programming in general tbh so i need some help here
I want to do a simple loop where if "cristalfim.png" it does the following clicks, my problem is the script runs fine and loops for 3-4 times but then it stops recognizing the "cristalfim.png", so he skips the if statement and enters in an infinite loop, any sugestions?
ps: sorry for any gramar or spelling errors, english not my main language =P
I want to do a simple loop where if "cristalfim.png" it does the following clicks, my problem is the script runs fine and loops for 3-4 times but then it stops recognizing the "cristalfim.png", so he skips the if statement and enters in an infinite loop, any sugestions?
localPath = scriptPath()
imgPath = localPath .. "imagens"
setImagePath(imgPath)
immersive = true
setImmersiveMode(immersive)
setAutoGameArea = true
pcall (autoGameArea, setAutoGameArea)
appUsableSize = getAppUsableScreenSize()
toast("Resolução: " .. appUsableSize:getX() .. " x " .. appUsableSize:getY())
scriptDimension = 2254
Settings:setScriptDimension(true, scriptDimension)
Settings:setCompareDimension(true, scriptDimension)
Settings:set("MinSimilarity", 0.90)
Settings:set("AutoWaitTimeout", 1)
cristalfim = Region(1723, 453, 210, 210)
bau = Region(1130, 585, 210, 210)
sell = Region(859, 726, 210, 210)
butao = Region(800, 500, 650, 550)
replay = Region(560, 483, 210, 210)
function expfarm()
if cristalfim:highlight(1):existsClick(Pattern("cristalfim.png")) then
toast("Fim da run")
bau:highlight(1):existsClick(Pattern("bau.png"))
sell:highlight(1):existsClick(Pattern("sell.png"))
butao:highlight(1):existsClick(Pattern("ysell.png"))
usePreviousSnap(true)
butao:existsClick(Pattern("okitem.png"))
usePreviousSnap(false)
butao:existsClick(Pattern("okitem.png"))
replay:highlight(1):existsClick(Pattern("replay.png"))
else
wait(5)
end
end
while true do
expfarm()
end
ps: sorry for any gramar or spelling errors, english not my main language =P