diff --git a/scripts/cobble_generator/README.md b/scripts/cobble_generator/README.md index 21511d4..533ff53 100644 --- a/scripts/cobble_generator/README.md +++ b/scripts/cobble_generator/README.md @@ -1,12 +1,29 @@ -# TreeFarm.lua -Robot script for automatic chopping of trees, given a lumber axe, bonemeal, and saplings. +# cobble_generator.lua +Robot script for generating cobblestone on a square 4-block generator, as shown below: + +``` +Top Layer: + OOO O = Glass +OLSWO L = Lava source +OS SO W = Water source +OWSLO S = Sign + OOO R = Robot + C = Cobblestone + Second layer: + OOO +O C O +OCRCO +O C O + OOO +``` + +The robot will rotate and mine each cobblestone block in sequence, and drop its harvest to the block below it. ## Pastebin -[mRTULKY0](https://pastebin.com/mRTULKY0) +[52ZtDZF1](https://pastebin.com/52ZtDZF1) ## Module Requirements -* tractor_beam -* inventory_controller +None ## Instructions -To operate this program, simply execute it, and it will prompt the user to decide if they wish to choose a number of trees to chop, or `-1` for chopping until out of resources. The robot will stop if its axe has less than 10% durability, it runs out of bonemeal, or runs out of saplings. \ No newline at end of file +To operate this program, simply execute it, and choose either to run infinitely, or for a set number of cycles. If infinite cycles are chosen, then be sure to check back once in a while, because the tool the robot uses may run out, in which case it will stop until a new tool is added. \ No newline at end of file diff --git a/scripts/cobble_generator/cobble_generator_min.lua b/scripts/cobble_generator/cobble_generator_min.lua new file mode 100644 index 0000000..7588f74 --- /dev/null +++ b/scripts/cobble_generator/cobble_generator_min.lua @@ -0,0 +1 @@ +local a=require("robot")local b=0 local function c()local f,g=a.durability()while not f do print("No valid tool. Please place one in the tool slot and press enter.")io.read()end a.swing()end local function d()for f=1,4 do c()a.turnRight()end a.dropDown()print("Cycles done: "..b)b=b+1 end local function e()print("# Andrew's Cobblestone Generator #")print("# Copyright 2018 Andrew Lalis #")print("#--------------------------------#")print("Please enter the number of cycles to perform, or -1 to continue forever.")local f=tonumber(io.read())if(f==nil or f==-1)then print("Beginning infinite cycles.")while true do d()end else print("Beginning "..f.." cycles.")for g=1,f do d()end end print("#------Program completed.--------#")end e() \ No newline at end of file