1.12 updates

This commit is contained in:
kepler155c
2018-04-01 18:28:46 -04:00
parent b0d5738a1f
commit 23368d1112
4 changed files with 4861 additions and 2410 deletions

38
apps/farm.lua Normal file
View File

@@ -0,0 +1,38 @@
_G.requireInjector(_ENV)
local Point = require('point')
local Util = require('util')
local scanner = device['plethora:scanner']
local function scan()
local blocks = scanner.scan()
Util.filterInplace(blocks, function(v)
return v.name == 'minecraft:wheat' and
scanner.getBlockMeta(v.x, v.y, v.z).metadata == 7
end)
return blocks
end
local function harvest(blocks)
Point.eachClosest(turtle.point, blocks, function(b)
Util.print(b)
turtle.goto(Point.above(b))
turtle.digDown()
turtle.placeDown('minecraft:wheat_seeds')
end)
end
turtle.reset()
local directions = { [5] = 2, [3] = 3, [4] = 0, [2] = 1, }
turtle.placeUp('minecraft:chest')
local _, bi = turtle.inspectUp()
turtle.digUp()
turtle.point.heading = directions[bi.metadata]
while true do
local blocks = scan()
harvest(blocks)
os.sleep(10)
end

View File

@@ -43,7 +43,7 @@ local page = UI.Page {
info = UI.Window {
x = 2, ex = -2, y = 2, ey = 5,
button = UI.Button {
ex = -1, y = 2, width = 9,
ex = -1, y = 3, width = 9,
text = 'Enable',
event = 'grid_select',
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,3 @@
_G.requireInjector(_ENV)
local Home = require('turtle.home')
turtle.run(Home.go)