Posted 28 September 2013 - 06:25 PM
Hello out there in the great world!
- ive spend my night makeing a program that can build a House after your input :D/>
its quite simple to understand but even more simple to use :D/>
All you need to do when you want to build a house with your turtle is:
<program name> <width> <height> – Woila! the turtle goes up and start building your house ;)/>
Example: BuildMeAHouse 6 5
pastebin: http://pastebin.com/ThTv6i3G
Hope you like it :)/>
Regards Plazter
Ps. You can make it uneven number still but then it will derp on the roof :b
EDIT1: Noticed that it is currently kinda broke.. i just downloaded it to a turtle and it is only placeing every second block for some reason, if you get this fail aswell, let me know, i will work on the code when i got the time for it again.
EDIT2: That is only when i try to do the "while turtle.forward() == false do" :/
- ive spend my night makeing a program that can build a House after your input :D/>
its quite simple to understand but even more simple to use :D/>
All you need to do when you want to build a house with your turtle is:
<program name> <width> <height> – Woila! the turtle goes up and start building your house ;)/>
Example: BuildMeAHouse 6 5
pastebin: http://pastebin.com/ThTv6i3G
Spoiler
-- 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()
turtle.forward()
if turtle.getItemCount(slot) < 1 then
slot = slot+1
turtle.select(slot)
end
end
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
-- The program --
layer()
roof()
print("Done building..")
Hope you like it :)/>
Regards Plazter
Ps. You can make it uneven number still but then it will derp on the roof :b
EDIT2: That is only when i try to do the "while turtle.forward() == false do" :/