Posted 16 November 2013 - 10:48 AM
Hey,
I'm new to lua programming and have tried everything i can to get this code working, whenever i iniate the startup command it just goes on to the next line without doing anything, the code is below:
Please help me! Thanks in advance.
I'm new to lua programming and have tried everything i can to get this code working, whenever i iniate the startup command it just goes on to the next line without doing anything, the code is below:
function refuel() --ReFuels the turtle if the fuel count is less than 200.
if turtle.getFuelLevel < 200 then
turtle.refuel()
print("No Fuel Left, Refuelling...")
else
print("No Fuel Needed")
end
end
function buildPlatform() --Specifies the blocks to build up and iniates the building sequence.
local build = ""
term.write("How Many Blocks Up? ")
build = read()
for i = 1, build do
while not turtle.up() do
turtle.digUp()
end
end
function moveDown()
build = read()
turtle.down()
print("Done, Thank you for using the simple platform builder!")
end
--Main Program Below
print("Welcome To The Simple Platform Builder!")
print("The system will now do everything required to start,")
print("Checking fuel level... ")
refuel()
print("Initializing build printer...")
print("Initialization Complete, Enjoy your Program!")
print("Please Remember to place a block in slot 2, or the program WILL break.")
buildPlatform()
turtle.select(2)
turtle.forward()
turtle.place()
turtle.up()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
moveDown()
end
Please help me! Thanks in advance.