Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = peripheral.wrap("front")
- local terminal = peripheral.wrap("bottom")
- local io = peripheral.wrap("left")
- if io.isConnected() then
- io.disconnect()
- function swapDisk()
- turtle.suck()
- turtle.drop()
- end
- function manageDisk()
- while true do
- os.pullEvent("redstone")
- sleep(1)
- swapDisk()
- end
- end
- function manageTerminal()
- while true do
- local event, command = os.pullEvent("chat_command")
- print(command)
- if command == "storage" then
- redstone.setOutput("front", true)
- sleep(1)
- redstone.setOutput("front", false)
- swapDisk()
- end
- end
- end
- parallel.waitForAny(manageDisk, manageTerminal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement