milo: cobblegen

This commit is contained in:
kepler155c
2018-11-29 02:07:11 -05:00
parent ccec3ceaf4
commit a2a87db49c

30
milo/apps/cobblegen.lua Normal file
View File

@@ -0,0 +1,30 @@
_G.requireInjector(_ENV)
local Util = require('util')
local fs = _G.fs
local os = _G.os
local turtle = _G.turtle
local STARTUP_FILE = 'usr/autorun/cobbleGen.lua'
if not fs.exists(STARTUP_FILE) then
Util.writeFile(STARTUP_FILE,
[[os.sleep(1)
shell.openForegroundTab('packages/milo/apps/cobblegen')]])
end
os.queueEvent('turtle_inventory')
while true do
print('waiting')
os.pullEvent('turtle_inventory')
print('waiting for cobble')
for _ = 1, 20 do
if turtle.inspectDown() then
break
end
os.sleep(.1)
end
print('digging')
turtle.digDown()
end