diff --git a/getBlocks.lua b/getBlocks.lua new file mode 100644 index 0000000..b1e30ae --- /dev/null +++ b/getBlocks.lua @@ -0,0 +1,29 @@ +local args = { ... } +if #args < 1 then + print("Usage: getBlocks ") + return +end + +numBlocks = tonumber(args[1]) +if numBlocks == nil then + print("Failed to parse number of blocks") + return +end + +print("Getting " .. tostring(numBlocks) .. " blocks") + +for i = 1,numBlocks +do + print(tostring(i) .. "...") + + --start casting + redstone.setOutput("back", true) + os.sleep(0.1) --just in case the turtles can act faster than 1 tick + redstone.setOutput("back", false) + + while (not turtle.suck(1)) do + os.sleep(0.1) + end +end + +print("Done!")