Advertisement
Guest User

glass

a guest
Jul 11th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. local p = peripheral.wrap("front")
  2. local terminal = peripheral.wrap("bottom")
  3.  
  4. local io = peripheral.wrap("left")
  5. if io.isConnected() then
  6.  io.disconnect()
  7.  
  8. function swapDisk()
  9.     turtle.suck()
  10.     turtle.drop()
  11. end
  12.  
  13. function manageDisk()
  14.     while true do
  15.         os.pullEvent("redstone")
  16.  
  17.         sleep(1)
  18.         swapDisk()
  19.     end
  20. end
  21.  
  22. function manageTerminal()
  23.     while true do
  24.         local event, command = os.pullEvent("chat_command")
  25.   print(command)
  26.         if command == "storage" then
  27.             redstone.setOutput("front", true)
  28.             sleep(1)
  29.             redstone.setOutput("front", false)
  30.  
  31.             swapDisk()
  32.         end
  33.     end
  34. end
  35.  
  36. parallel.waitForAny(manageDisk, manageTerminal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement