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