fix neural autorun
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user