Hello! So my HOPE is to get a base for a program to build a house. What I want it to do isn't to hard, I don't think. But here's the outline that I have for it. I am somewhat new to programming so some things may be wrong. http://pastebin.com/S8pKkrTH
-1-10 are the variables. Read comments in code.
-12-24 is a function to get the current Pos of the turtle. My hope is to not use the gps command, but have it keep it to its self(I guess). As well as update each time it moves.
-26-27 is for a goHome() function, again using the hx, hy, hz, and x, y, z, variables.
-29-30 is a function to check how much materials it has. My plan for this is to NOT have to be the amount it needs, but stop when it runs out and "goHome()" to get more stuff, assuming there is more.
-32-33 is to make the floor.
-35-36 is to make the walls of the house.
-38-39 is to make the roof.
Also, I do not believe the commands for the house it self matter, but if they do I can post a world with the house.
House Building Program Base
Started by dylanrhodes0, May 09 2013 07:00 PM
4 replies to this topic
#1
Posted 09 May 2013 - 07:00 PM
#2
Posted 10 May 2013 - 08:45 AM
Split into new topic.
#3
Posted 10 May 2013 - 09:47 AM
Ive once bothered making something like this, it was really simple though and not advanced, its pretty much the same over and over 
- First a script to clear the area
- Simple part to dig out a few areas (for a nice basement)
- Simple part to dump blocks every now and then
- Grab blocks from chest to build
- Placing the blocks in the way you want the walls to be there
- Placing the blocks for the roof
That code is for a simple floor part, you can repeat this code and/or add parts to it to make different shapes (including editing parts for the positioning btw)
This part is the part for putting up the walls, its built up the same pretty much (all the things in it, are copied from what my house looked like)
These script are all just copied, I put some helpfull comments in there but it will give you a general idea of a simple way to do this (in my opinion atleast
)
The blockbelow function is here, it checks how many items it has in its selected slot, if its 0 it selects the next slot, and then places a block. (It does not keep in mind when it used up all slots, but that is an easy fix)
Might be a bit of a messy post, but as I said, should give you a general idea of how to do it, let me know if you have any questions
- First a script to clear the area
- Simple part to dig out a few areas (for a nice basement)
- Simple part to dump blocks every now and then
- Grab blocks from chest to build
- Placing the blocks in the way you want the walls to be there
- Placing the blocks for the roof
Spoiler
That code is for a simple floor part, you can repeat this code and/or add parts to it to make different shapes (including editing parts for the positioning btw)
Spoiler
This part is the part for putting up the walls, its built up the same pretty much (all the things in it, are copied from what my house looked like)
These script are all just copied, I put some helpfull comments in there but it will give you a general idea of a simple way to do this (in my opinion atleast
The blockbelow function is here, it checks how many items it has in its selected slot, if its 0 it selects the next slot, and then places a block. (It does not keep in mind when it used up all slots, but that is an easy fix)
Spoiler
Might be a bit of a messy post, but as I said, should give you a general idea of how to do it, let me know if you have any questions
#4
Posted 10 May 2013 - 09:49 AM
a better input function
function getPos()
print("Hello!")
print("What is my location?")
write("X: ")
x = tonumber(read())
write("Y: ")
y = tonumber(read())
write("Z: ")
z = tonumber(read())
print("North=1, East=2, South=3, West=4")
write("Dir: ")
d=tonumber(read())
end
#5
Posted 10 May 2013 - 11:28 AM
So here's the world with the house on it. (-124 64 340~ish, can't miss it at night.) Hopefully this won't make things harder.
https://www.dropbox....y3o5t/world.rar
And let me know if I'm asking for a miracle, lol.
https://www.dropbox....y3o5t/world.rar
And let me know if I'm asking for a miracle, lol.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











