Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Ceiling
- --NAPTlME
- --Main
- function ceiling()
- term.write("How many blocks forward?\n")
- local length = tonumber(read())
- term.write("How many blocks to the right?\n")
- local width = tonumber(read())
- term.write("How many blocks up?\n")
- local height = tonumber(read())
- term.write("Now raising the roof.")
- sleep(1)
- turtle.turnRight()
- digCeiling(length, width, height)
- end
- --Dig
- function digCeiling(length, width, height)
- for i =1,height do
- for j = 1,length do
- local u = 1
- for k = 1,width do
- turtle.digUp()
- if u < width then
- turtle.forward()
- u = u+1
- end
- end
- if length == j then
- print("Ready for next row")
- elseif isOdd(j) then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- if i == height then
- print("Thank you for choosing...\n RestEasy:\n SecureSolutions")
- repeat
- turtle.down()
- until turtle.detectDown() == true
- for b = 1,3 do
- turtle.up()
- end
- elseif isOdd(length) then
- turtle.turnRight()
- local l = 1
- while l < length do
- turtle.forward()
- l = l + 1
- end
- turtle.turnRight()
- local l=1
- while l < width do
- turtle.forward()
- l = l+1
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.up()
- else
- turtle.turnLeft()
- local l = 1
- while l < length do
- turtle.forward()
- l = l+1
- end
- turtle.turnLeft()
- turtle.up()
- end
- end
- end
- --Is the number odd?
- function isOdd(n)
- if n%2 == 1 then
- return true
- else
- return false
- end
- end
- ceiling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement