Working on a bunch of things
This commit is contained in:
parent
e45b1ea995
commit
bcbb419179
@ -7,4 +7,5 @@ This is an implementation of a centralized storage network architecture that use
|
|||||||
1. Deploy a Smart Computer
|
1. Deploy a Smart Computer
|
||||||
2. Connect the computer to at least 1 chest and 1 hopper via physical modem lines. Chests need to be attached from the bottom and hoppers from their output direction
|
2. Connect the computer to at least 1 chest and 1 hopper via physical modem lines. Chests need to be attached from the bottom and hoppers from their output direction
|
||||||
3. Put a chest on top of the Smart Computer
|
3. Put a chest on top of the Smart Computer
|
||||||
4. Deploy the script
|
4. Install Basalt (`wget run https://basalt.madefor.cc/install.lua release latest.lua`)
|
||||||
|
5. Deploy the script (as `startup`, of course)
|
@ -5,7 +5,9 @@
|
|||||||
|
|
||||||
-- Startup diagnostics
|
-- Startup diagnostics
|
||||||
print("Salt's CC Storage Net")
|
print("Salt's CC Storage Net")
|
||||||
print("Computer " .. os.getComputerID() .. " configured as " .. mode)
|
|
||||||
|
-- Required libraries
|
||||||
|
local basalt = require("basalt") -- wget run https://basalt.madefor.cc/install.lua release latest.lua
|
||||||
|
|
||||||
-- Global scope locals
|
-- Global scope locals
|
||||||
local output = peripheral.wrap("top") or error("Put a chest on top of this terminal for output items", 0)
|
local output = peripheral.wrap("top") or error("Put a chest on top of this terminal for output items", 0)
|
||||||
@ -29,7 +31,7 @@ function pushDepositsToChests()
|
|||||||
-- Take all the contents of all connected hoppers and stuff them into any other connected inventory
|
-- Take all the contents of all connected hoppers and stuff them into any other connected inventory
|
||||||
-- These things are wrapped into tables because that's how you take multiple return values and stuff them in a table, apparently
|
-- These things are wrapped into tables because that's how you take multiple return values and stuff them in a table, apparently
|
||||||
local hoppers = getDepositHoppers()
|
local hoppers = getDepositHoppers()
|
||||||
local chests = {peripheral.find("inventory", function(name,i) return string.find(name, "minecraft:chest") end)}
|
local chests = getConnectedChests()
|
||||||
-- For each hopper connected to the network...
|
-- For each hopper connected to the network...
|
||||||
for k,hopper in ipairs(hoppers) do
|
for k,hopper in ipairs(hoppers) do
|
||||||
-- For each item in that hopper's inventory...
|
-- For each item in that hopper's inventory...
|
||||||
|
@ -16,5 +16,5 @@ echo "Root: $_ccroot"
|
|||||||
for computer in "$masterid"; do
|
for computer in "$masterid"; do
|
||||||
echo "Deploying to: $computer"
|
echo "Deploying to: $computer"
|
||||||
mkdir -p "$_ccroot/$computer"
|
mkdir -p "$_ccroot/$computer"
|
||||||
cp common.lua "$_ccroot/$computer/autostart"
|
cp common.lua "$_ccroot/$computer/startup"
|
||||||
done
|
done
|
Loading…
Reference in New Issue
Block a user