Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CRL = peripheral.wrap("top")
- local handles = {}
- local links = {}
- local links_config = {
- action_1 = {"minecraft:red_wool", "minecraft:lever"},
- action_2 = {"minecraft:blue_wool", "minecraft:lever"},
- action_3 = {"minecraft:green_wool", "minecraft:lever"}
- }
- -- Load the handles
- for _, h in pairs(CRL.getHandles()) do
- local items = h.getItems()
- handles[items[1]..items[2]] = h
- end
- -- Assign relevant handles
- for id, items in pairs(links_config) do
- links[id] = handles[items[1]..items[2]] or CRL.openHandle(items[1], items[2])
- end
Advertisement
Add Comment
Please, Sign In to add comment