Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Code by Plazter --
- -- 2013 --
- -- House builder --
- -- Description: This is a turtle program, to build houses as you wish, right now it can only take a even number
- --Heres an example on how to start it to build: Build 4=the widht. 3= the height of the house
- local args = {...}
- turtle.up()
- if args[1] == nil or args[1] == "help" then
- print("<program name> <width> <Height>")
- return
- end
- local slot = 1
- function wall()
- for i = 1,args[1] -1 do
- turtle.placeDown()
- while not turtle.forward() do
- turtle.dig()
- sleep(0.8)
- end
- if turtle.getItemCount(slot) < 1 then
- slot = slot+1
- turtle.select(slot)
- end
- end
- --turtle.up()
- end
- function right()
- turtle.turnRight()
- end
- function left()
- turtle.turnLeft()
- end
- function square()
- wall()
- right()
- wall()
- right()
- wall()
- right()
- wall()
- right()
- end
- function roof() -- Work in progress
- for i = 1,args[1] /2 do
- wall()
- right()
- turtle.placeDown()
- turtle.forward()
- right()
- wall()
- left()
- turtle.placeDown()
- turtle.forward()
- left()
- end
- turtle.back()
- for i = 1,args[2] +1 do
- turtle.down()
- right()
- right()
- end
- end
- function layer()
- for i = 1, args[2] do
- square()
- turtle.up()
- end
- end
- layer()
- roof()
- print("Done building..")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement