OC_Scripts/scripts/cobble_generator/cobble_generator_min.lua

1 line
751 B
Lua
Raw Normal View History

2018-06-24 07:43:34 +00:00
local a=require("robot")local b=0 local function c()local f=a.durability()while not f do print("No valid tool. Please place one in the tool slot and press enter.")io.read()f=a.durability()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()