package manager + tweaks to milo

This commit is contained in:
kepler155c
2018-11-06 16:21:31 -05:00
parent d113b1da1a
commit 01452ced72
9 changed files with 117 additions and 63 deletions

View File

@@ -32,15 +32,6 @@
\030 \031 \030f\0317\130\030 \031 \030f\0317\130",
run = "Appstore.lua",
},
[ "4486006f811b88cacd5f211fd579717e29b600cd" ] = {
title = "Miner",
category = "Apps",
icon = " \0315\\\030 \031 \
\0304\031f _ \030 \031c/\0315\\\
\0304 ",
run = "simpleMiner.lua",
requires = 'turtle',
},
[ "131260cbfbb0c821f8eae5e7c3c296c7aa4d50b9" ] = {
title = "Music",
category = "Apps",
@@ -52,13 +43,14 @@
requires = 'turtle',
},
--[[
[ "81c0d915fa6d82fd30661c5e66e204cea52bb2b5" ] = {
title = "Activity",
[ "4486006f811b88cacd5f211fd579717e29b600cd" ] = {
title = "Miner",
category = "Apps",
icon = "\0318/\030f\031 \030 \0318\\\
\030f \0308\0319o\030f\031 \
\0318\\\030f\031 \030 \0318/",
run = "storageActivity.lua",
icon = " \0315\\\030 \031 \
\0304\031f _ \030 \031c/\0315\\\
\0304 ",
run = "simpleMiner.lua",
requires = 'turtle',
},
[ "89307d419a2fe4fbb69af92b3d3af27b6ec14d3e" ] = {
title = "Telnet",
@@ -76,6 +68,15 @@
\031e\\/\031 \0319c",
run = "vnc.lua",
},
[ "131f0b008f44298812221d120d982940609be781" ] = {
title = "Builder",
category = "Apps",
icon = "\0317_____\
\030e\031c###\0308\0317=\030e\031c#\
\030e\031c#\0307\031f.\030e\031c###",
run = "usr/apps/builder.lua",
requires = "turtle",
},
--]]
[ "a0365977708b7387ee9ce2c13e5820e6e11732cb" ] = {
title = "Pain",
@@ -85,15 +86,6 @@
\030 \031f\030f\0318\143\133\0312\136\0302\031f\159\159\143\131\030f\0312\132",
run = "http://pastebin.com/raw/wJQ7jav0",
},
[ "9e092dda4f0e27d0c7686ddd00272079e678b6e6" ] = {
title = "Storage",
category = "Apps",
icon = "\0307 \
\0307 \0308\0311 \0305 \0308\031 \0307 \0308 \0301 \
\0307 ",
run = "chestManager.lua",
requires = 'turtle',
},
[ "114edfc04a1ab03541bdc80ce064f66a7cfcedbb" ] = {
title = "Recorder",
category = "Apps",
@@ -105,15 +97,6 @@
\030 \031f\030f\031e\139\030e\128\030f\159\129\0314\130\131\131\129",
run = "recorder.lua",
},
[ "131f0b008f44298812221d120d982940609be781" ] = {
title = "Builder",
category = "Apps",
icon = "\0317_____\
\030e\031c###\0308\0317=\030e\031c#\
\030e\031c#\0307\031f.\030e\031c###",
run = "usr/apps/builder.lua",
requires = "turtle",
},
[ "d8c298dd41e4a4ec20e8307901797b64688b3b77" ] = {
title = "GPS Deploy",
category = "Apps",
@@ -150,19 +133,6 @@
\030 \031f\030f\0310\136\140\140\030 ",
run = "https://gist.github.com/LDDestroier/c7528d95bc0103545c2a/raw",
},
--[[
[ "d78f28759f255a0db76604ee560b87c4715a0da5" ] = {
title = "Sketch",
category = "Apps",
icon = " \031bskch\
\0303\031f \030d \
\030d\031f ",
iconExt = "\030 \031f\0308\031f\151\0313\140\140\140\030f\0318\148\
\030 \031f\030b\031f\149\0318\130\131\129\030f\031b\149\
\030 \031f\030f\0318\138\0308\031b\130\131\129\030f\0318\133",
run = "http://pastebin.com/raw/Mm5hd97E",
},
]]
[ "58ec8d6e36e346d9f42eb43935652e3e58e2c829" ] = {
title = "Mwm",
category = "Apps",
@@ -174,15 +144,6 @@
\030 \031f\0304\031f\131\131\131\131\131\131\131\030e\0314\131",
run = "mwm.lua usr/config/mwm",
},
[ "8d1b0a73bedc0dc492377c2f6ab880940b97ec6e" ] = {
title = "Treefarm",
icon = "\030 \031f \0305 \030 \030d \030 \
\0305\031f \030d \030 \030d \0305 \030d \
\030 \031f \030c \030 \0304 \030 \030c \030 ",
category = "Apps",
run = "treefarm.lua",
requires = "turtle",
},
[ "01c933b2a36ad8ed2d54089cb2903039046c1216" ] = {
title = "Enchat",
icon = "\030e\031f\151\030f\031e\156\0311\140\0314\140\0315\140\031d\140\031b\140\031a\132\

View File

@@ -93,7 +93,7 @@ end
local chest = InventoryAdapter({ side = 'top', direction = 'down' }) or
error('missing chest above')
turtle.run(function()
local s, m = turtle.run(function()
turnOffWater()
repeat
@@ -117,3 +117,7 @@ turtle.run(function()
os.sleep(5)
until turtle.isAborted()
end)
if not s and m then
error(m)
end

11
farms/etc/apps/apps.db Normal file
View File

@@ -0,0 +1,11 @@
{
[ "8d1b0a73bedc0dc492377c2f6ab880940b97ec6e" ] = {
title = "Treefarm",
icon = "\030 \031f \0305 \030 \030d \030 \
\0305\031f \030d \030 \030d \0305 \030d \
\030 \031f \030c \030 \0304 \030 \030c \030 ",
category = "Apps",
run = "treefarm.lua",
requires = "turtle",
},
}

View File

@@ -106,7 +106,7 @@ local function harvest(blocks)
turtle.equip('right', 'plethora:module:2')
end
turtle.run(function()
local s, m = turtle.run(function()
local facing = scanner.getBlockMeta(0, 0, 0).state.facing
turtle.point.heading = Point.facings[facing].heading
@@ -125,3 +125,7 @@ turtle.run(function()
end
until turtle.isAborted()
end)
if not s and m then
error(m)
end

View File

@@ -2,8 +2,10 @@
required = {
'opus-develop-1.8',
},
title = 'Inventory manager for Opus OS',
title = 'Milo: Advanced inventory management',
repository = 'kepler155c/opus-apps/develop-1.8/milo',
description = [[ ... ]],
description = [[Provides AE style crafting in computercraft.
Includes Importing, exporting, autocrafting, replenish and limits, and much more.
Includes over 200 standard Minecraft recipes.]],
licence = 'MIT',
}

View File

@@ -69,7 +69,7 @@ local context = {
_G._p = context --debug
Event.on('storage_offline', function()
Milo:showError('A storage chest has gone offline, ctrl-l to continue')
Milo:showError('A storage chest has gone offline - See configuration screen')
end)
Milo:init(context)
@@ -99,8 +99,7 @@ end
Milo:clearGrid()
local page = UI:getPage('listing')
UI:setPage(page)
UI:setPage(UI:getPage('listing'))
Event.on('milo_cycle', function()
if not context.turtleBusy then

54
milo/apps/furni.lua Normal file
View File

@@ -0,0 +1,54 @@
--[[
Use 4 furnaces at once to smelt items.
Set up a turtle with a hopper on top and surrounded by furnaces.
Set the hopper as a machine used for crafting.
Export coal to slot 2 of each furnace and import from slot 3.
--]]
_G.requireInjector(_ENV)
local Event = require('event')
local Util = require('util')
local device = _G.device
local os = _G.os
local turtle = _G.turtle
local intro =
device['plethora:introspection']
local inv = intro.getInventory()
Event.on('turtle_inventory', function()
while true do
local list = inv.list()
local sleepTime = 10
if Util.empty(list) then
break
end
for k,slot in pairs(list) do
for _ = 1, 4 do
local count = 0
local s, m = pcall(function()
count = inv.pushItems('front', k, 8, 1)
end)
if not s then
_G.printError(m)
end
if count > 0 then
sleepTime = 0
end
turtle.turnRight()
slot.count = slot.count - count
if slot.count <= 0 then
break
end
end
end
os.sleep(sleepTime)
end
end)
os.queueEvent('turtle_inventory')
Event.pullEvents()

View File

@@ -58,7 +58,7 @@ local machinesPage = UI.Page {
function machinesPage.grid:getDisplayValues(row)
row = Util.shallowCopy(row)
local t = { row.name:match(':(.+)_(%d+)') }
local t = { row.name:match(':(.+)_(%d+)$') }
if t and #t == 2 then
row.name, row.suffix = table.unpack(t)
row.name = row.name .. '_' .. row.suffix

View File

@@ -0,0 +1,19 @@
{
[ "81c0d915fa6d82fd30661c5e66e204cea52bb2b5" ] = {
title = "Activity",
category = "Apps",
icon = "\0318/\030f\031 \030 \0318\\\
\030f \0308\0319o\030f\031 \
\0318\\\030f\031 \030 \0318/",
run = "storageActivity.lua",
},
[ "9e092dda4f0e27d0c7686ddd00272079e678b6e6" ] = {
title = "Storage",
category = "Apps",
icon = "\0307 \
\0307 \0308\0311 \0305 \0308\031 \0307 \0308 \0301 \
\0307 ",
run = "chestManager.lua",
requires = 'turtle',
},
}