spaces->tab, equipper improvements, supertreefarm rewrite, follow improvements, sensor cleanup, milo multiple items allowed in recipes, remote canvas access

This commit is contained in:
kepler155c@gmail.com
2019-06-18 15:23:20 -04:00
parent 3b9b509429
commit 045b32884f
162 changed files with 20448 additions and 20286 deletions

View File

@@ -1,7 +1,7 @@
local GPS = require('gps')
local Util = require('util')
local Point = require('point')
local Proxy = require('proxy')
local Proxy = require('core.proxy')
local os = _G.os
@@ -10,38 +10,38 @@ local remoteId = args[1] or error('mobFollow <remote id>')
local ni = Proxy.create(remoteId, 'device/neuralInterface')
if not ni then
error('failed to connect')
error('failed to connect')
end
local lpt = nil
while true do
local pt = GPS.locate(2)
local pt = GPS.locate(2)
if not pt then
print('No GPS')
else
local gpt = Util.shallowCopy(pt)
if pt and lpt and Point.same(pt, lpt) then
-- havent moved
print('no move')
else
if not lpt then
gpt.x = gpt.x - 2
else
local dx = lpt.x - pt.x
local dz = lpt.z - pt.z
local angle = math.atan2(dx, dz)
gpt.x = pt.x + 2.5 * math.sin(angle)
gpt.z = pt.z + 2.5 * math.cos(angle)
end
lpt = pt
local s, m = ni.goTo(gpt.x, gpt.y + 1, gpt.z)
if not s then
print(m)
end
end
end
if not pt then
print('No GPS')
else
local gpt = Util.shallowCopy(pt)
if pt and lpt and Point.same(pt, lpt) then
-- havent moved
print('no move')
else
if not lpt then
gpt.x = gpt.x - 2
else
local dx = lpt.x - pt.x
local dz = lpt.z - pt.z
local angle = math.atan2(dx, dz)
gpt.x = pt.x + 2.5 * math.sin(angle)
gpt.z = pt.z + 2.5 * math.cos(angle)
end
lpt = pt
local s, m = ni.goTo(gpt.x, gpt.y + 1, gpt.z)
if not s then
print(m)
end
end
end
os.sleep(.5)
os.sleep(.5)
end