diff --git a/cargo-elevator.lua b/cargo-elevator.lua index 3a850ea..4e674c7 100644 --- a/cargo-elevator.lua +++ b/cargo-elevator.lua @@ -9,14 +9,70 @@ local FLOORS = { return first_char == "A" or first_char == "W" end, detect = function () - -- TODO + return redstone.getOutput("top") end, call = function () - -- TODO + redstone.setOutput("top", true) + os.sleep(0.5) + redstone.setOutput("top", false) end - storage = "", - elevator_storage = "", - } + storage = "create:item_vault_17", + elevator_storage = "bottom", + }, + { + match = function (input) + local first_char = string.sub(input, 1, 1) + return first_char == "F" + end, + detect = function () + local relay = "redstone_relay_21" + peripheral.call(relay, "getOutput", "top") + end, + call = function () + local relay = "redstone_relay_21" + peripheral.call(relay, "setOutput", "top", true) + os.sleep(0.5) + peripheral.call(relay, "setOutput", "top", false) + end + storage = "create:item_vault_18", + elevator_storage = "create:portable_storage_interface_8", + }, + { + match = function (input) + local first_char = string.sub(input, 1, 1) + return first_char == "L" + end, + detect = function () + local relay = "redstone_relay_22" + peripheral.call(relay, "getOutput", "top") + end, + call = function () + local relay = "redstone_relay_22" + peripheral.call(relay, "setOutput", "top", true) + os.sleep(0.5) + peripheral.call(relay, "setOutput", "top", false) + end + storage = "create:item_vault_19", + elevator_storage = "create:portable_storage_interface_9", + }, + { + match = function (input) + local first_char = string.sub(input, 1, 1) + return first_char == "E" + end, + detect = function () + local relay = "redstone_relay_23" + peripheral.call(relay, "getOutput", "top") + end, + call = function () + local relay = "redstone_relay_23" + peripheral.call(relay, "setOutput", "top", true) + os.sleep(0.5) + peripheral.call(relay, "setOutput", "top", false) + end + storage = "create:item_vault_20", + elevator_storage = "create:portable_storage_interface_10", + }, } local SLEEP_T = 5