Kryzeth

startup-receive

Oct 18th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. chest = peripheral.wrap("top")
  2. modem = peripheral.wrap("back")
  3. modem.open(10)
  4. dir = "EAST"
  5. print(dir)
  6. while true do
  7.   local _,_,_,_,msg = os.pullEvent("modem_message")
  8.   if msg[1] == "PULL" then
  9.     chest.pullItem(dir,1,1,msg[2])
  10.     print("pulled into slot "..msg[2])
  11.   elseif msg[1] == "PUSH" then
  12.     chest.pushItem(dir,msg[2])
  13.     print("pushed item from "..msg[2])
  14.   end
  15. end
Add Comment
Please, Sign In to add comment