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

@@ -103,7 +103,6 @@ end
function page.detail:eventHandler(event)
if event.type == 'grid_select' then
projecting = event.selected
_G._p = scanner.getBlockMeta(projecting.x, projecting.y, projecting.z)
else
return UI.SlideOut.eventHandler(self, event)
end

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

View File

@@ -33,7 +33,7 @@ local function run()
else
os.sleep(0.1)
end
elseif meta.isSneaking and not meta.isElytraFlying and meta.pitch == -90 then
if launchCounter < 2 then
launchCounter = launchCounter + 1
@@ -63,6 +63,7 @@ parallel.waitForAny(
function()
print('\nFlight control initialized')
print('\nSneak and look straight up for launch')
print('Sneak to deactivate during flight')
print('\nPress any key to exit')
os.pullEvent('char')
end,