refactor common apps into its own package
This commit is contained in:
16
common/.package
Normal file
16
common/.package
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
title = 'Useful applications',
|
||||
repository = 'kepler155c/opus-apps/{{OPUS_BRANCH}}/common',
|
||||
description = [[Various applications for Opus.
|
||||
|
||||
* App Store
|
||||
* Peripheral API viewer
|
||||
* Disk / Computer copier
|
||||
* A better editor (copy/paste/undo)
|
||||
* Turtle swarm miner
|
||||
* Turtle follow
|
||||
* Screen recorder
|
||||
* and more...
|
||||
]],
|
||||
licence = 'MIT',
|
||||
}
|
||||
6
common/autorun/common.lua
Normal file
6
common/autorun/common.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
_ENV.shell.setCompletionFunction("packages/common/edit.lua",
|
||||
function(shell, nIndex, sText)
|
||||
if nIndex == 1 then
|
||||
return _G.fs.complete(sText, shell.dir(), true, false)
|
||||
end
|
||||
end)
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
title = 'Core apps and apis',
|
||||
title = 'APIs used by various programs',
|
||||
repository = 'kepler155c/opus-apps/{{OPUS_BRANCH}}/core',
|
||||
description = [[Provides common files used by Opus applications. Also includes various useful applications.]],
|
||||
description = [[Provides APIs used by Opus applications.]],
|
||||
licence = 'MIT',
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
if fs.exists('packages/core/lavaRefuel.lua') then fs.delete('packages/core/lavaRefuel.lua') end
|
||||
if fs.exists('packages/core/t.lua') then fs.delete('packages/core/t.lua') end
|
||||
|
||||
_ENV.shell.setCompletionFunction("packages/core/edit.lua",
|
||||
function(shell, nIndex, sText)
|
||||
if nIndex == 1 then
|
||||
return _G.fs.complete(sText, shell.dir(), true, false)
|
||||
end
|
||||
end)
|
||||
@@ -587,12 +587,12 @@ Event.addRoutine(function()
|
||||
)
|
||||
local maxDistance = Point.distance(
|
||||
HOME_PT,
|
||||
{ x = mining.x + 16, y = 0, z = mining.z + 16 }
|
||||
{ x = mining.x, y = 0, z = mining.z }
|
||||
)
|
||||
|
||||
_G._debug({ distance = distance, maxDistance = maxDistance })
|
||||
|
||||
if distance > maxDistance then
|
||||
if distance > maxDistance + 16 then
|
||||
term.clear()
|
||||
term.setCursorPos(1, 1)
|
||||
_G.printError('WARNING\n\nTurtle is outside the mining area\n')
|
||||
|
||||
Reference in New Issue
Block a user