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
if adapter.dirty then
_debug('STORAGE: refresh: ' .. adapter.name)
--_debug('STORAGE: refresh: ' .. adapter.name)
adapter:listItems(throttle)
adapter.dirty = false
end

View File

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