diff --git a/apps/neural.lua b/apps/mobfollow.lua similarity index 100% rename from apps/neural.lua rename to apps/mobfollow.lua diff --git a/autorun/neural.lua b/autorun/neural.lua new file mode 100644 index 0000000..8636e72 --- /dev/null +++ b/autorun/neural.lua @@ -0,0 +1,24 @@ +_G.requireInjector(_ENV) + +local GPS = require('gps') + +local device = _G.device + +if device.neuralInterface then + function device.neuralInterface.goTo(x, _, z) + local pt = GPS.locate(2) + if pt then + return pcall(function() + local gpt = { + x = x - pt.x, + y = 0, + z = z - pt.z, + } + gpt.x = math.min(math.max(gpt.x, -15), 15) + gpt.z = math.min(math.max(gpt.z, -15), 15) + return device.neuralInterface.walk(gpt.x, gpt.y, gpt.z) + end) + end + return false, 'No GPS' + end +end