turtle follow

This commit is contained in:
kepler155c@gmail.com
2019-02-20 08:53:12 -05:00
parent 9f009c164a
commit 1643145cf0
8 changed files with 192 additions and 141 deletions

View File

@@ -1,8 +1,6 @@
local Config = require('config')
local Event = require('event')
local Mobs = require('neural.mobs')
local Project = require('neural.project')
local Sound = require('sound')
local UI = require('ui')
local Util = require('util')
@@ -14,7 +12,6 @@ local function equip(side, rawName)
return turtle and turtle.equip(side, rawName) and peripheral.wrap(side)
end
local lastWarning = os.clock()
local target = nil
local ni = device.neuralInterface
local sensor = ni or
@@ -81,7 +78,7 @@ function page.grid:getDisplayValues(row)
row = Util.shallowCopy(row)
row.x = row.x and math.floor(row.x) or ''
row.y = row.y and math.floor(row.y) or ''
row.z = math.floor(row.z)
row.z = row.z and math.floor(row.z) or ''
return row
end
@@ -181,13 +178,6 @@ Event.onInterval(.5, function()
Project:drawPoints(meta, t, 'X', 0xFFDF50AA)
end
if os.clock() > lastWarning + 5 then
if Util.any(entities, function(e) return Mobs.getNames()[e.name] end) then
lastWarning = os.clock()
Sound.play('entity.player.breath')
end
end
if config.totals then
local t = { }
for _,v in pairs(entities) do