hello, i need a house building program, it needs to build a max of two floors or one, and a simple roof. and any blocks even if i needs modified, i need something to work off of
Help ASAP [Turtle Program]
Started by predatorxil, Oct 15 2012 09:45 PM
4 replies to this topic
#1
Posted 15 October 2012 - 09:45 PM
#2
Posted 15 October 2012 - 11:50 PM
Probably no one here will do an entire code on request, unless they made one prior. We're here to learn, and teach others what we know. Like if you made one, and had trouble with your variables, we'd help you. We enjoy it, that's why we are here. Don't... get your hopes up, I suppose, someone may have such a code lying around, and give it to you, but you should give it a try.
For some tips though, here you go. It will be more efficient if it were layer-based. Which means some loops, repeated, oh, 9 or 11 times per wall? Then turn, repeat, turn, repeat again, go up a level. Then destroy the blocks under it, twice, to start your door, and repeat the code you made prior to climbing. I advise making it a function actually, cause you may well repeat it 5+ times.
I'll probably make a house building program someday, but I'm already working on some other programs.
For some tips though, here you go. It will be more efficient if it were layer-based. Which means some loops, repeated, oh, 9 or 11 times per wall? Then turn, repeat, turn, repeat again, go up a level. Then destroy the blocks under it, twice, to start your door, and repeat the code you made prior to climbing. I advise making it a function actually, cause you may well repeat it 5+ times.
I'll probably make a house building program someday, but I'm already working on some other programs.
#3
Posted 16 October 2012 - 03:44 AM
Thanks, but im not asking someone to make one for me, to better word my post, i need help understanding programing turtles, ive made a simple one, but it wont run....
term.clear()
term.setCursorPos(1,1)
print("RSTown House Builder")
term.setCursorPos(1,2)
build = yes
shutdown = no
write("Ready to Build? ")
input = read()
if input == build then
print("Working...")
sleep(2)
turtle.select(2)
turtle.up()
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()
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()
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()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.turnLeft()
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()
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()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
elseif input == shutdown then
os.reboot()
sleep(2)
end
term.clear()
term.setCursorPos(1,1)
print("RSTown House Builder")
term.setCursorPos(1,2)
build = yes
shutdown = no
write("Ready to Build? ")
input = read()
if input == build then
print("Working...")
sleep(2)
turtle.select(2)
turtle.up()
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()
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()
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()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.turnLeft()
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()
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()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
turtle.placedown()
turtle.forward()
elseif input == shutdown then
os.reboot()
sleep(2)
end
#4
Posted 16 October 2012 - 04:07 AM
First off, when you say "it doesn't run", it's really helpful to post the error that comes up, though it wasn't necessary for this case because the errors are clear.
Secondly, it's also helpful when you put your code around [ code][/code] tags so it's easier to read. Either that, or use pastebin.
Now onto the actual script:
Secondly, Lua is case sensitive. Meaning
"turtle.placeDown" is the correct way of typing it.
Also, this will more than likely help you a ton to know that there's a way to shorten that.
One final tip, if you're going to be using CC versions above 1.33, you'll probably need to check if your turtle has enough fuel before starting the building process. You can read more about fuel on the wiki.
Secondly, it's also helpful when you put your code around [ code][/code] tags so it's easier to read. Either that, or use pastebin.
Now onto the actual script:
-- wrong build = yes shutdown = no -- right build = "yes" shutdown = "no"The "yes" and "no" should be around quotes. In this case, I'm assuming you're going to be asking for "yes" or "no" from the player, yes meaning to build and no for shutting down.
Secondly, Lua is case sensitive. Meaning
turtle.placedown()is not the same as
turtle.placeDown()
"turtle.placeDown" is the correct way of typing it.
Also, this will more than likely help you a ton to know that there's a way to shorten that.
for i=1, 20 do turtle.placeDown() turtle.forward() endIn this bit of code, it will repeat placing down and going forward 20 times. You can replace 20 with however many times you need to do this action.
One final tip, if you're going to be using CC versions above 1.33, you'll probably need to check if your turtle has enough fuel before starting the building process. You can read more about fuel on the wiki.
#5
Posted 17 October 2012 - 12:47 AM
Check the Turtle Programs forum, there are plenty of existing programs that can do stuff like this (tele_iz_dva4a's replacement for go utility--which I refer to as gox and included in my own program--is my personal favorite, but there are others).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











