GapBuilder

Started by RockRevenchy, Apr 15, 2021, 09:37 pm

Previous topic - Next topic

RockRevenchy

Apr 15, 2021, 09:37 pm Last Edit: Apr 15, 2021, 09:46 pm by RockRevenchy
"I DONT WANNA READ, JUST GIMME THE DAMN PASTEBIN!"
sheesh alright:
https://pastebin.com/pz9ERpKL


GapBuilder

First of all this is like my first lua program that isnt less than 10 lines so excuse my potential mistakes lol also this was made on a patched computercraft original mod for 1.7.10 so I have no clue if it works on modern version of CC, be my guest :D !

The Story:
Here how the story goes, I wanted to place light sources in my floor in my base or have at least a way to place torches via turtles so I wouldnt have to manually do it and then search where dark spots are and deal with how ugly it'd be if I went berserk with torches. So I came up with this.

Usage:
This program is pretty simple, you place the turtle on the bottom left of your dimensions and it'll build from there to top right, the turtle will stop moving at bottom right.

the command has 4 arguments
synthax: [length] [width] [gap] [u|d]

-[length] [width]
these are no different from your casual excavate command, this is the boundary in which the turtle is allowed to build and move.

-[gap]
the gap is how many blocks should be left untouched between the blocks that should be replaced (this number should not include the block placed, only the gap between each

-[u|d] (or up|down)
this basically asks you if the turtle should place the blocks above or below itself while placing blocks

Finally the program can also run with an empty inventory and only mine holes (it will however let you know your turtle is empty and ask you if it should proceed, just in case)

features:
  • Will mine and attack entities and blocks in its way
  • never goes out of its set boundaries
  • can run empty
  • progress display
  • can do one line only
  • actually waits instead of ending its process if it has no more fuel/blocks
  • a handy little guide if you run the command dry (without any arguments)
  • consistent and precise
  • plenty of comments on how the code works if you intend to learn/modify

Kaikaku

This is a useful program. What I've seen there souldn't be an issues with the current CC-Tweaked version.
And as you mentioned, it's nicely commented.

Maybe the frequency of the fuel level checks (with every move) could be reduced?
However, I'm not sure if these checks need much time.
Hi there!
I make YouTube videos about my turtle programs (incl. pastebin). Visit me if you like :)

RockRevenchy

I kinda figured I was doing these checks a bit too frequently but I left it like that because I'd rather be sure it has enough fuel to carry on ;p

and thank you!