From 3db36154677343bf5490cd6d6df37544d8bd13ad Mon Sep 17 00:00:00 2001 From: osmarks Date: Tue, 14 Aug 2018 22:28:57 +0100 Subject: [PATCH] IO stuff --- IO.lua | 6 +++--- README.md | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/IO.lua b/IO.lua index c30820a..3a5df65 100644 --- a/IO.lua +++ b/IO.lua @@ -24,17 +24,17 @@ while true do local request = w.string_to_item(item_name) request.type = "extract" request.destination_inventory = w.chest - w.query_by_type("storage", request) + w.unwrap(w.query_by_type("storage", request), "extracting items") end end for slot, item in pairs(stacks_stored) do if not conf.items[w.get_internal_identifier(item)] then -- if item is not in want list, send it back to storage - w.query_by_type("storage", { + w.unwrap(w.query_by_type("storage", { type = "insert", from_inventory = conf.chest, from_slot = slot - }) + }), "inserting items") end end diff --git a/README.md b/README.md index 2d059ed..1cb0ddb 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Client Client Client * **Server** is a computer running `backend-chests`. Other backends may eventually become available. It must be connected to the chests, clients, and both sides of the buffers. * **Client** is a crafty turtle running `client`. It must be connected to the server and external side of the buffers. * **Processing** will be used for autocrafting systems. It is not yet implemented. +* **IO** units should be computers connected to chests. ### Configuration Configuration is stored in `wyvern_config.tbl` in lua table syntax as used by `textutils.(un)serialise`. @@ -51,6 +52,10 @@ Configuration is stored in `wyvern_config.tbl` in lua table syntax as used by `t `buffer_external` must contain the network name of the buffer on the client side. `modem_internal` can contain the network name of the server on the chest side. This is only required if your network contains chests on the client side which are connected. +#### IO +`chest` must contain the network name of some sort of storage device to use for item IO. +`items` must can contain the desired quantities of each item, with the item name in "minecraft:cobblestone:0" format as the key and desired quantity as value. + ## Warnings * Inserting/extracting items manually into/out of chests will result in the index being desynchronised with the actual items. To correct the index, run `reindex` in the CLI client. * If you try and extract items when the storage server is still starting up, it may fail, as not all chests will have been indexed yet.