turtle gps rework

This commit is contained in:
kepler155c@gmail.com
2019-02-22 03:53:40 -05:00
parent 70a3bd1166
commit f37dac0c79
11 changed files with 195 additions and 139 deletions

View File

@@ -99,4 +99,12 @@ Needs work
\030 \031f\030f\031e\139\030e\128\030f\159\129\0314\130\131\131\129",
run = "recorder.lua",
},
[ "4486006f811b88cacd5f211fd579717e29b600cd" ] = {
title = "Swarm",
category = "Turtle",
icon = " \0315\\\030 \031 \
\0304\031f _ \030 \031c/\0315\\\
\0304 ",
run = "multiMiner.lua",
},
}

View File

@@ -1,3 +1,7 @@
_G.requireInjector(_ENV)
local Home = require('turtle.home')
turtle.run(Home.go)
local config = require('config').load('gps')
if config.home then
if turtle.enableGPS() then
return turtle.pathfind(config.home)
end
end

View File

@@ -1,3 +1,8 @@
_G.requireInjector(_ENV)
local Home = require('turtle.home')
turtle.run(Home.set)
local Config = require('config')
local pt = turtle.enableGPS()
if pt then
local config = Config.load('gps', { })
config.home = pt
Config.update('gps', config)
end