Jump to content




Simple Turtle Builder


3 replies to this topic

#1 thedriver87

  • Members
  • 28 posts
  • LocationSouthern Oregon

Posted 20 November 2013 - 03:04 AM

This program is designed to allow a user to task turtles with basic building or digging jobs using an easy to understand interface, There are four patterns currently included in the turtles program, The Line. Square, Floor, and Wall patterns can be used to form most if not any basic structures, Giving the user time to focus on decorating, or other tasks while the rooms and hallways are built/hollowed. All patterns take in values for the length, height, and width when required. The Line building pattern will build until the turtle encounters an obstacle, making it ideal for long bridge builds or filling in floors and roofs with odd shapes that are just too large to spend the time building manually. In time I hope to incorporate a feature that will check for a config file on the disk first, if found the turtle will execute the set pattern immediately rather than needing to input the information repeatedly. The hope is to increase the ease of use when operating numerous turtles on a complex pattern.
It is also worth noting the predictability of the patterns in complete and as a result you can place blocks in the turtle in an order to produce any pattern you like an example of this is included at the bottom of the images

Source:
Spoiler
examples left to right Square, Wall, Floor(with a height of 4 to show the potential to fill), and Line showing use of obstruction.
Posted Image
example of a wall pattern using special blocks
Posted Image
and the result of that pattern
Posted Image

this is my first official program release so any advice, or criticisms are welcome! thanks for having a look, and if you find yourself using this program as I do to make your build efforts go farther than enjoy!

Attached Files


Edited by thedriver87, 20 November 2013 - 09:25 PM.


#2 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 20 November 2013 - 12:27 PM

Please please please localize your variables!
And put the source code in a [spoiler] or a [namedspoiler]

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 20 November 2013 - 05:36 PM

Indeed, use of spoiler tags would be good. ;)

For whatever reason, my turtle's display has one row and column less then yours, apparently. Default CC 1.57 install.

If the turtle encounters a pre-existing structure while working, it gets stuck. This includes when it runs into blocks in front of itself while "breaking".

You might consider having it wait until it has an entire stack of blocks to discard instead of spitting out lots of individual items as it goes.

Your "square" building system actually seems to form pipes - does it just go until it runs out of blocks? I asked for a 4x5 "square", and got a 5x5 pipe that seemed to stretch upwards forever... It'd be more useful if one could specify three dimensions, as with the "floor".

Use of the keys API makes for less obfuscation in your code. "keys.left" and "keys.right" is a lot easier for people reading to quickly identify than numbers like 203 and 205.

If you use "os.pullEvent("key")", then the event you'll get back will be a key. There's no need to perform additional checks for this lower down.

Otherwise in my quick tests, it seems to more or less work as intended. :)

#4 thedriver87

  • Members
  • 28 posts
  • LocationSouthern Oregon

Posted 20 November 2013 - 09:38 PM

thanks for the advice, as for the square it is intended for building a square room the specified height. Seems to be working just fine for me so I am confused as to why it does not stop at the height of your second value. also the stopping when encountering a structure was intended as i use this little guy for clearing out mistakes and i wanted to be very specific about what blocks to break. in this case anything outside the area defined will not be broken and instead the turtle stops. I will be working on a rewrite in the near future. again thanks for the advice!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users