Posted 08 September 2012 - 01:28 PM
Hi i have a code that stopped working and i can't figure out why
y = 1
z = 1
cx = 1
cy = 1
cz = 1
function f()
if turtle.forward() == false then
repeat
turtle.dig()
sleep(0.25)
until turtle.forward() == true
end
end
function loadpos()
local f1 = io.open("posx", "r")
local f2 = io.open("posy", "r")
posx = tonumber(f1:read())
posy = tonumber(f2:read())
f1:close()
f2:close()
end
function goback()
print("y - ",posy)
print("x - ",posx)
turtle.turnLeft()
while cx > x do
f()
cx = cx - 1
end
turtle.turnLeft()
while cy > y do
f()
cy = cy - 1
end
end
loadpos()
cx = posx
cy = posy
goback()
any of these codes were changed?
or is there any detailed change log so i can try to find the problem?
Spoiler
x = 1y = 1
z = 1
cx = 1
cy = 1
cz = 1
function f()
if turtle.forward() == false then
repeat
turtle.dig()
sleep(0.25)
until turtle.forward() == true
end
end
function loadpos()
local f1 = io.open("posx", "r")
local f2 = io.open("posy", "r")
posx = tonumber(f1:read())
posy = tonumber(f2:read())
f1:close()
f2:close()
end
function goback()
print("y - ",posy)
print("x - ",posx)
turtle.turnLeft()
while cx > x do
f()
cx = cx - 1
end
turtle.turnLeft()
while cy > y do
f()
cy = cy - 1
end
end
loadpos()
cx = posx
cy = posy
goback()
any of these codes were changed?
or is there any detailed change log so i can try to find the problem?