Posted 31 December 2012 - 02:57 AM
Hi guys! I've watched some of direwolfs tutorials about turtles and i realy wanted to make a 9x9 house. This is what i've coded but it has some bugs! Could someone help me?
function lineTwo()
for i= 1,9 do
turtle.forward()
turtle.digDown()
end
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
function lineOne()
for i = 1,9 do
turtle.forward()
turtle.digDown()
end
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
end
lineOne()
lineTwo()
lineOne()
lineTwo()
lineOne()
lineTwo()
lineOne()
lineTwo()
lineOne()
turtle.turnRight()
for i = 1, 9 do
turtle.forward()
end
turtle.turnLeft()
for i = 1, 9 do
turtle.forward()
end
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
function floorLine()
for i = 1, 9 do
turtle.forward()
turtle.placeDown()
end
end
function cplFL()
floorLine()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
function cplFR()
floorLine()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
end
cplFL()
cplFR()
cplFL()
cplFR()
cplFL()
cplFR()
cplFL()
turtle.select(2)
cplFR()
cplFL()
turtle.back()
turtle.left()
turtle.forward()
turtle.right()
function wallLine()
for i = 1, 8 do
turtle.forward()
turtle.placeDown()
end
end
function downwall()
for i = 1, 5 do
turtle.down()
end
end
function wall1()
for i = 1, 5 do
turtle.up()
wallLine()
turtle.turnLeft()
turtle.turnLeft()
turtle.back()
end
downwall()
turtle.turnLeft()
turtle.back()
end
function wall2()
for i = 1, 5 do
turtle.up()
wallLine()
turtle.turnLeft()
turtle.turnLeft()
turtle.back()
end
downwall()
turtle.turnLeft()
turtle.back()
end
function wall3()
for i = 1, 5 do
turtle.up()
wallLine()
turtle.turnLeft()
turtle.turnLeft()
turtle.back()
end
turtle.turnLeft()
turtle.back()
end
function wall4()
turtle.forward()
for i = 1, 5 do
turtle.up()
for z = 1, 1 do
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown() --only solution i found. try to do it youtself with a for loop and you'll see :P/>
end
turtle.turnLeft()
turtle.turnLeft()
end
end
turtle.select(3) --I know i could've add those guys at the function but when i realised it, i've already added them here :P/>.
wall1()
turtle.select(4)
wall2()
turtle.select(5)
wall3()
turtle.select(6)
wall4()
turtle.back()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
function floorLine()
for i = 1, 7 do
turtle.forward()
turtle.placeDown()
end
end
function cplFL()
floorLine()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
function cplFR()
floorLine()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
end
turtle.select(7)
cplFL()
cplFR()
cplFL()
cplFR()
turtle.select(8)
cplFL()
cplFR()
cplFL()
turtle.select(10)
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
for i = 1, 5 do
turtle.down()
end
turtle.turnRight()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.down()
turtle.down()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.turnLeft()
turtle.forward()
turtle.down()
turtle.down()
turtle.down()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.dig()
turtle.up()
turtle.dig()
turtle.select(10)
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
for i = 1, 5 do
turtle.down()
end
turtle.turnRight()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.down()
turtle.down()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.turnLeft()
turtle.forward()
turtle.down()
turtle.down()
turtle.down()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.dig()
turtle.up()
turtle.dig()
Edited by