Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function check()
- local g=2
- if turtle.getItemCount(s)==0
- then
- s=s+1
- if s<17
- then
- turtle.select(s)
- else
- s=1
- turtle.select(s)
- while g == 2
- do
- print("Waiting for supplies. Type 1 to continue building.")
- g=read()
- end
- end
- end
- end
- --main script
- print("Hello! What is the length of both sides of your house? The turtle will build your house in front of it and to the right.")
- x=read()
- tonumber(x)
- print("How high off the ground? (0 if at ground level)")
- y=read()
- tonumber(y)
- print("how tall from the base of the house do you want your house?")
- h=read()
- tonumber(h)
- print(" Building your house!")
- --main script floor of house
- s=1 -- for check script
- tonumber(s)
- for i=1,y
- do
- turtle.up()
- end
- for i=1, x/2
- do
- for i=1,x-1
- do
- check()
- turtle.placeDown()
- sleep(.1)
- turtle.forward()
- end
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- for i=1,x-1
- do
- check()
- turtle.placeDown()
- sleep(.1)
- turtle.forward()
- end
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.up()
- --building the walls of the house
- for i=1, h
- do
- for i=1,4
- do
- for i=1,x-1
- do
- check()
- turtle.placeDown()
- sleep(.1)
- turtle.forward()
- end
- turtle.turnLeft()
- end
- turtle.up()
- end
- --ceiling of house
- turtle.down()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- for i=1, (x-2)/2
- do
- for i=1,x-3
- do
- check()
- turtle.placeDown()
- sleep(.1)
- turtle.forward()
- end
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- for i=1,x-3
- do
- check()
- turtle.placeDown()
- sleep(.1)
- turtle.forward()
- end
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement