fix neural autorun

This commit is contained in:
kepler155c
2018-11-06 17:28:41 -05:00
parent 01452ced72
commit 3098cd86bf
2 changed files with 6 additions and 6 deletions

View File

@@ -160,7 +160,7 @@ local ct = os.clock()
for _, adapter in self:onlineAdapters() do for _, adapter in self:onlineAdapters() do
if adapter.dirty then if adapter.dirty then
_debug('STORAGE: refresh: ' .. adapter.name) --_debug('STORAGE: refresh: ' .. adapter.name)
adapter:listItems(throttle) adapter:listItems(throttle)
adapter.dirty = false adapter.dirty = false
end end

View File

@@ -2,10 +2,10 @@ _G.requireInjector(_ENV)
local GPS = require('gps') local GPS = require('gps')
local kernel = _G.kernel local device = _G.device
kernel.onDeviceAttach('neuralInterface', function(dev) if device.neuralInterface and device.wireless_modem then
dev.goTo = function(x, _, z) device.neuralInterface.goTo = function(x, _, z)
local pt = GPS.locate(2) local pt = GPS.locate(2)
if pt then if pt then
return pcall(function() return pcall(function()
@@ -16,9 +16,9 @@ kernel.onDeviceAttach('neuralInterface', function(dev)
} }
gpt.x = math.min(math.max(gpt.x, -15), 15) gpt.x = math.min(math.max(gpt.x, -15), 15)
gpt.z = math.min(math.max(gpt.z, -15), 15) gpt.z = math.min(math.max(gpt.z, -15), 15)
return dev.walk(gpt.x, gpt.y, gpt.z) return device.neuralInterface.walk(gpt.x, gpt.y, gpt.z)
end) end)
end end
return false, 'No GPS' return false, 'No GPS'
end end
end) end