Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slot = 1
- function f()
- turtle.forward()
- end
- function cl()
- shell.run("clear")
- end
- function b()
- turtle.place()
- end
- function bd()
- turtle.placeDown()
- end
- function bu()
- turtle.placeUp()
- end
- function s(place)
- turtle.select(place)
- slot = slot+1
- end
- function u()
- turtle.up()
- end
- function d()
- turtle.down()
- end
- function r()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- function l()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- function c()
- count = turtle.getItemCount(slot)
- if count == 0 then
- if slot < 9 then
- newslot = slot+1
- s(newslot)
- end
- end
- end
- function co()
- return turtle.getItemCount()
- end
- function df()
- turtle.dig()
- end
- function dd()
- turtle.digDown()
- end
- cl()
- print "House Builder - Made by Vilsol"
- print ""
- repeat
- write "How wide do you want the house? (Max: 14): "
- width = tonumber(read())
- if width > 14 then
- cl()
- print "Too wide!"
- print ""
- end
- until width < 15
- cl()
- repeat
- write "How deep you want the house? (Max: 14): "
- deep = tonumber(read())
- if deep > 14 then
- cl()
- print "Too deep!"
- print ""
- end
- until deep < 15
- cl()
- repeat
- write "How high you want the house? (Max: 3): "
- high = tonumber(read())
- if high > 3 then
- cl()
- print "Too high!"
- print ""
- end
- until high < 4
- cl()
- repeat
- write "Do you want your house above ground? (y/n): "
- lev = read()
- if lev == "y" then
- lev = true
- levt = true
- elseif lev == "n" then
- lev = false
- levt = true
- else
- levt = false
- cl()
- print "Choose y OR n!"
- print ""
- end
- until levt == true
- total = ((width * deep * 2) + (((width-1) * 2 * high) + (deep-1) * 2 * high))
- s(1)
- s1 = turtle.getItemCount(1)
- s2 = turtle.getItemCount(2)
- s3 = turtle.getItemCount(3)
- s4 = turtle.getItemCount(4)
- s5 = turtle.getItemCount(5)
- s6 = turtle.getItemCount(6)
- s7 = turtle.getItemCount(7)
- s8 = turtle.getItemCount(8)
- s9 = turtle.getItemCount(9)
- totalblocks = s1+s2+s3+s4+s5+s6+s7+s8+s9
- print ("Theese settings will use " .. total .. " blocks!")
- print ("You have provided " .. totalblocks .. " blocks!")
- if totalblocks >= total then
- print "That is enough!"
- else
- repeat
- print "That is not enough!"
- needed = total - totalblocks
- print ("I need " .. needed .. " more blocks!")
- print "Write anything to check!"
- check = read()
- if check then
- s(1)
- s1 = turtle.getItemCount(1)
- s2 = turtle.getItemCount(2)
- s3 = turtle.getItemCount(3)
- s4 = turtle.getItemCount(4)
- s5 = turtle.getItemCount(5)
- s6 = turtle.getItemCount(6)
- s7 = turtle.getItemCount(7)
- s8 = turtle.getItemCount(8)
- s9 = turtle.getItemCount(9)
- totalblocks = s1+s2+s3+s4+s5+s6+s7+s8+s9
- if totalblocks >= total then
- print "That is enough!"
- ok = true
- end
- end
- until ok == true
- end
- print "Press any key to start building!"
- os.pullEvent("key")
- if lev == true then
- turtle.turnRight()
- u()
- turn = "left"
- for de = 1,deep do
- c()
- bd()
- for wi = 2,width do
- c()
- f()
- bd()
- end
- if turn == "left" then
- turtle.turnLeft()
- f()
- turtle.turnLeft()
- turn = "right"
- else
- turtle.turnRight()
- f()
- turtle.turnRight()
- turn = "left"
- end
- end
- else
- turtle.turnRight()
- turn = "left"
- for de = 1,deep do
- c()
- dd()
- bd()
- for wi = 2,width do
- c()
- f()
- dd()
- bd()
- end
- if turn == "left" then
- turtle.turnLeft()
- f()
- turtle.turnLeft()
- turn = "right"
- else
- turtle.turnRight()
- f()
- turtle.turnRight()
- turn = "left"
- end
- end
- end
- if turn == "left" then
- turtle.turnRight()
- turn = "right"
- else
- turtle.turnLeft()
- turn = "left"
- end
- for upe = 1,high+1 do
- u()
- end
- f()
- if turn == "left" then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- for de = 1,deep do
- c()
- bd()
- for wi = 2,width do
- c()
- f()
- bd()
- end
- if turn == "left" then
- turtle.turnLeft()
- f()
- turtle.turnLeft()
- turn = "right"
- else
- turtle.turnRight()
- f()
- turtle.turnRight()
- turn = "left"
- end
- end
- if turn == "left" then
- turtle.turnRight()
- turn = "right"
- else
- turtle.turnLeft()
- turn = "left"
- end
- d()
- w = "down"
- for ww = 1,width do
- if w == "down" then
- for wh = 1,high do
- d()
- b()
- end
- r()
- w = "up"
- else
- for wh = 1,high do
- b()
- u()
- end
- r()
- w = "down"
- end
- end
- wall = "side"
- for walls = 1,3 do
- if wall == "side" then
- size = deep
- wall = "back"
- else
- size = width
- wall = "side"
- end
- f()
- f()
- turtle.turnLeft()
- for ww = 1,size-1 do
- if w == "down" then
- for wh = 1,high do
- d()
- b()
- end
- r()
- w = "up"
- else
- for wh = 1,high do
- b()
- u()
- end
- r()
- w = "down"
- end
- end
- end
- if math.fmod(width, 2) == 0 then
- even = true
- else
- even = false
- end
- if even == true then
- go = width/2
- for fow = 1,go do
- f()
- end
- turtle.turnLeft()
- df()
- u()
- df()
- r()
- df()
- d()
- df()
- else
- go = math.ceil(width/2)
- for fow = 1,go do
- f()
- end
- turtle.turnLeft()
- df()
- u()
- df()
- end
- d()
- d()
- turtle.turnRight()
- f()
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement