Posted 11 July 2013 - 05:22 PM
Title: help new to computer craft
im trying to make a mining program and when i run it it just executes and does nothing code below
Updated code
im trying to make a mining program and when i run it it just executes and does nothing code below
function DigDown()
turtle.digDown()
turtle.dig()
if turtle.down() then
Go = Go - 1
end
end
function DigUp()
turtle.digUp()
turtle.dig()
if turtle.up() then
Go = Go + 1
end
end
function refuel()
if turtle.getFuelLevel < 200 then
turtle.refuel()
if turtle.getFuelLevel < 200 then
turtle.select(16)
turtle.digUp()
turtle.up()
turtle.digUp()
turtle.down()
turtle.placeUp()
turtle.suckUp()
turtle.refuel()
end
end
end
function dropOff()
turtle.select(15)
turtle.digUp()
turtle.up()
turtle.digUp()
turtle.down()
turtle.placeUp()
turtle.dropUp()
end
function test()
print ("hello world loop")
print (Go)
print (Going)
if Going == false then
if Go < 6 then
Going = true
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
else
DigDown()
end
else
if Go < 63 then
DigUp()
else
if turtle.detectUp() then
DigUp()
else
Going = false
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
end
end
end
end
function
Go = 78
Going = false
while true do
test()
end
Updated code