|
Post by noncombat on Jan 24, 2017 7:46:25 GMT
Hello, I'm kinda stuck on this piece but can't get it to work unfortantly. function checkHBMChances()
toast("Gonna check our chances")
all = findAll("hbmChance.png")
count = table.getn(all)
if(hbmchance_reg:exists("hbmChance.png")) then
if (count > 1) then
toast("We have " .. count .." chances")
return true
else
return false
end
end
end Edit : fixed function checkHBMChances()
toast("Gonna check our chances")
all = findAllNoFindException("hbmChance.png")
count = table.getn(all)
if not (hbmchance_reg:exists("hbmChance.png")) then
toast("We don't have any chance(s)")
else
if(hbmchance_reg:exists("hbmChance.png")) then
if (count > 0) then
toast("We have " .. count .." chances")
return true
end
end
end
end It does return true, with the amount of chances. if (hbmchallanges_reg:exists("HBMChallangeScreen.png")) then
toast("We are in the HBM screen, gonna start the chosen HBM")
if (checkHBMChances() == true) then
toast("Can do some sweepes mate")
selectedHBM()
sweepHBM()
end
end Because it continues to sweep() It just wont return false if it can't find the image, instead it throws me the error. The image that it has to find Hopefully someone can help me out. Edit : fixed it.
|
|