From bddf4c8e9bb838750251c81a686900ac9720ed5b Mon Sep 17 00:00:00 2001 From: fucksophie Date: Sat, 31 Jan 2026 22:08:15 +0200 Subject: [PATCH] update RA tutorial --- readme.md | 71 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/readme.md b/readme.md index f02cb2c..63b4a72 100644 --- a/readme.md +++ b/readme.md @@ -81,36 +81,43 @@ You can also run `wget run https://files.sad.ovh/public/storage-solution/.beta-i ## 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 using `wget https://git.sad.ovh/sophie/storage-solution/raw/branch/main/tiny_ra_library.lua`. - -Example program: -```lua -local ra = require("tiny_ra_library") -local modem = peripheral.find("modem") - --- modem, port, password -ra.init(modem, 42420, "test123") - -print("withdraws 64 of dirt") -ra.withdraw("minecraft:dirt") -sleep(2) - -print("deposits 64 of dirt") -ra.depositByItemName("minecraft:dirt") -sleep(2) - -print("withdraws 12 dirt") -ra.withdraw("minecraft:dirt", 12) -sleep(2) - -print("deposits the first slot") -ra.depositBySlots({1}) -sleep(2) - -print("withdraws 32 dirt") -ra.withdraw("minecraft:dirt", 32) -sleep(2) - -print("deposits 16 items from the first slot") -ra.depositBySlots({1}, 16) +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 ```