Posted 25 November 2014 - 01:11 AM
So I'm building a large mining program…( Yes I Know there are like 900 i could use but you know pride)
But im running into issues with a if then loop. The turtle is doing both the if and the else. Ill Post a copy of my code here
The area of the code is between line 138 and 165. Ill also include those lines here
But im running into issues with a if then loop. The turtle is doing both the if and the else. Ill Post a copy of my code here
The area of the code is between line 138 and 165. Ill also include those lines here
Spoiler
local function right()
turtle.turnRight()
for i = 1,10 do
tCheck = true
while tCheck == true do
p1,p2 = turtle.inspect()
if p1 == true then
for k,v in pairs(p2) do
if v == "ComputerCraft:CC-Turtle" then
sleep(.1)
else
turtle.dig()
turtle.forward()
tCheck = false
end
end
else
turtle.dig()
turtle.forward()
tCheck = false
end
end
end
turtle.turnLeft()
end
right()