Post by dabblelabs on Aug 4, 2017 4:15:33 GMT
So basically im trying to make a loop but im having trouble getting it to execute properly
Also if i wanted to find the total number of AC at the end of the script i can use just Print(AC) right?
Also if i wanted to find the total number of AC at the end of the script i can use just Print(AC) right?
local InvLoop = 0
local InvA = true
local InvB = true
local InvC = true
local InvD = true
function FindAC()
AllReg = Region(834, 238, 160, 160)
Min1Reg = Region(359, 241, 160, 160)
SelReg = Region(574, 445, 160, 160)
ConReg = Region(247, 241, 160, 160)
ConSend = Region(522, 584, 160, 160)
OkReg = Region(559, 552, 160, 160)
if InvA == true then
if exists("1.png", 2) then
doubleClick("1.png")
AllReg:waitClick("2.png")
Min1Reg:waitClick("3.png")
SelReg:waitClick("4.png")
SelReg:waitVanish("4.png")
ConReg:waitClick("5.png")
ConReg:waitVanish("5.png")
ConSend:waitClick("6.png")
ConSend:waitVanish("6.png")
OkReg:waitClick("7.png")
OkReg:waitVanish("7.png")
AC = AC + 1
else
InvA = false
InvLoop = InvLoop + 1
end
elseif InvB == true then
waitClick("up.png")
if exists("1.png", 2) then
doubleClick("1.png")
AllReg:waitClick("2.png")
Min1Reg:waitClick("3.png")
SelReg:waitClick("4.png")
SelReg:waitVanish("4.png")
ConReg:waitClick("5.png")
ConReg:waitVanish("5.png")
ConSend:waitClick("6.png")
ConSend:waitVanish("6.png")
OkReg:waitClick("7.png")
OkReg:waitVanish("7.png")
AC = AC + 1
else
InvB = false
InvLoop = InvLoop + 1
end
elseif InvC == true then
waitClick("up.png")
if exists("99nc.png", 2) then
doubleClick("1.png")
AllReg:waitClick("2.png")
Min1Reg:waitClick("3.png")
SelReg:waitClick("4.png")
SelReg:waitVanish("4.png")
ConReg:waitClick("5.png")
ConReg:waitVanish("5.png")
ConSend:waitClick("6.png")
ConSend:waitVanish("6.png")
OkReg:waitClick("7.png")
OkReg:waitVanish("7.png")
AC = AC + 1
else
InvLoop = InvLoop + 1
InvC = false
end
elseif InvD == true then
waitClick("up.png")
if exists("99nc.png", 2) then
doubleClick("1.png")
AllReg:waitClick("2.png")
Min1Reg:waitClick("3.png")
SelReg:waitClick("4.png")
SelReg:waitVanish("4.png")
ConReg:waitClick("5.png")
ConReg:waitVanish("5.png")
ConSend:waitClick("6.png")
ConSend:waitVanish("6.png")
OkReg:waitClick("7.png")
OkReg:waitVanish("7.png")
AC = AC + 1
else
InvLoop = InvLoop + 1
InvD = false
end
end
end
while InvLoop <= 4 do
FindAC()
end