Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fuelUp( amount )
- for a = 1, 16, 1 do
- data = turtle.getItemDetail(a)
- if data.name == "Coal" then
- turtle.select(a)
- turtle.refuel( amount )
- end
- end
- end
- function fuelUpIfNeeded()
- if turtle.getFuelLevel() <= 30 then
- fuelUp(1)
- end
- end
- fuelUp()
- if turtle.getFuelLevel() == 0 then
- error("no fuel")
- end
- print("How far forward? (z of house)")
- zlength = read()
- print("How far right? (x of house)")
- xlength = read()
- print("How many floors?")
- floorsno = read()
- print("How high is the ceiling of each floor?")
- floorsheight = read()
- ylength = floorsno * (floorsheight + 1)
- print("Working...")
- if turtle.detectDown() == true then
- turtle.up()
- end
- turtle.turnRight()
- turtle.turnRight()
- for y = 0, ylength, 1 do
- if (y % floorsheight) == 0 then
- for z = 1, zlength, 1 do
- turtle.back()
- for x = 1, xlength, 1 do
- if x ~= xlength then
- turtle.forward()
- end
- fuelUpIfNeeded()
- turtle.placeDown()
- end
- if z ~= zlength then
- if (z % 2) == 0 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- end
- turtle.placeDown()
- else
- for a = 1, 2, 1 do
- for z = 0, zlength, 1 do
- fuelUpIfNeeded()
- turtle.placeDown()
- turtle.forward()
- end
- turtle.turnLeft()
- for x = 0, xlength, 1 do
- fuelUpIfNeeded()
- turtle.placeDown()
- turtle.forward()
- end
- turtle.turnLeft()
- end
- end
- turtle.up()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement