Jump to content


M4WL's Content

There have been 2 items by M4WL (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#153188 Program Problem

Posted by M4WL on 17 November 2013 - 05:42 AM in Ask a Pro

Thanks bomb, really helped.



#153116 Program Problem

Posted by M4WL on 16 November 2013 - 10:48 AM in Ask a Pro

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:

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.