123 lines
4.5 KiB
Markdown
123 lines
4.5 KiB
Markdown
<table align=center>
|
|
<tr>
|
|
<td>
|
|
|
|
<h1 align=center>(S)ophie</h1>
|
|
<h1 align=center>(I)ncorporated</h1>
|
|
<p align=center> </p>
|
|
<h1 align=center>(S)torage</h1>
|
|
<h1 align=center>(S)olution</h1>
|
|
|
|
</td>
|
|
<td align="right" width="40%">
|
|
<img src="logo.png" alt="Logo" width="168">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
## Features
|
|
- Lua matching for inventories that are passed into AIL/Hopper
|
|
- Import all items from certain inventories (like ender storages for all of your farms)
|
|
- Chatbox support for withdrawing and depositing items
|
|
- Remote access via enderstorages
|
|
- Complete remote access via Modem (RA) and a enderstorage with a UI and everything
|
|
|
|
## How to use
|
|
1. First, in your /config.lua file, add the following:
|
|
```lua
|
|
return {
|
|
["inventories"] = { -- REQUIRED!! Please set at least one inventory pattern.
|
|
".*barrel.*" -- Lua patterns to match all barrels
|
|
},
|
|
["import"] = { -- Not required, just don't set!
|
|
"ender_storage_156" -- A inventory I want to move all items from into our storage
|
|
},
|
|
--- Enable the experimental hopper.lua backend.
|
|
-- ["beta"] = {
|
|
-- ["hopper"] = true
|
|
-- },
|
|
["chatbox"] = { -- Not required, just don't set!
|
|
["prefix"] = "home",
|
|
["players"] = {
|
|
["hartbreix"] = "manipulator_42" -- Chatbox support
|
|
}
|
|
},
|
|
["remote"] = { -- Access your items via modem, not required, just don't set!
|
|
["ender_storage"] = "ender_storage_493", -- Enderstorage that will be changed (set this to owner-only and computer-chanagable!)
|
|
["modem"] = "modem_1277", -- Modem to recieve messages
|
|
--- Uses RA backend. Connects with a already running SiSS instance. Not required!
|
|
-- ["connection"] = {
|
|
-- ["port"] = 32000,
|
|
-- ["password"] = "test123",
|
|
-- ["connection"] = "white/white/white"
|
|
-- },
|
|
["remotes"] = { -- Remote access
|
|
["red/green/green"] = {
|
|
["port"] = 42420,
|
|
["password"] = "test123" -- Required!
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
2. Run the following command:
|
|
```
|
|
wget run https://git.sad.ovh/sophie/storage-solution/raw/branch/main/src/.main-installer.lua
|
|
```
|
|
|
|
This will install storage-solution to /storage-solution.
|
|
To make it start every time you turn on the computer, add
|
|
|
|
```
|
|
shell.run("wget run https://git.sad.ovh/sophie/storage-solution/raw/branch/main/src/.main-installer.lua")
|
|
```
|
|
to startup.lua
|
|
|
|
### [EXTRA!]
|
|
|
|
You can also run `wget run https://files.sad.ovh/public/storage-solution/.beta-installer.lua`, which is quite unstable. You may experience issues while running the beta version, but also new juicy features :)
|
|
|
|
|
|
## RA
|
|
SiSS has a remote access system that allows you to access your items via modem.
|
|
To use it, first set up your config.lua correctly. After that you need to implement the tiny_ra_library into your program.
|
|
You can download it by downloading SiSS itself, and importing.
|
|
```
|
|
package.path = package.path .. ";/storage-solution/?.lua"
|
|
|
|
local ra = require("storage-solution/tiny_ra_library")
|
|
```
|
|
|
|
|
|
Example program (takes sand out of your inventory while you're farming sand):
|
|
```lua
|
|
package.path = package.path .. ";/storage-solution/?.lua"
|
|
local ra = require("storage-solution/tiny_ra_library")
|
|
|
|
local modules = peripheral.wrap("back")
|
|
local inv = modules.getInventory()
|
|
|
|
local yourManipulator = "manipulator_76"
|
|
|
|
--- use any registered enderstorage, it'll work the exact same
|
|
ra.init(peripheral.find("modem"), 00000, "my_password")
|
|
|
|
while true do
|
|
|
|
local yes = false
|
|
local amount = 0
|
|
for _, item in pairs(inv.list()) do
|
|
if item.name == "minecraft:sand" then
|
|
yes = true
|
|
amount = amount + item.count
|
|
end
|
|
end
|
|
|
|
if yes and amount > 100 then
|
|
print("Moved " .. tostring(amount) .. " of sand.")
|
|
ra.depositFromManipulator(yourManipulator, "minecraft:sand", amount, true)
|
|
end
|
|
|
|
sleep(1)
|
|
end
|
|
```
|