Advertisement
Guest User

startup

a guest
Jul 25th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local ped = peripheral.wrap("top")
  2. local mod = peripheral.wrap("bottom")
  3. mod.open(13)
  4.  
  5. function sendItem()
  6.   local stack = ped.getStackInSlot(1)
  7.   for k,v in pairs(stack) do
  8.     print(v)
  9.     if (v == null) then
  10.       return null
  11.     end
  12.     print("Received Message... Sending: "..v)
  13.     mod.transmit(20,25,v)
  14.     return true
  15.   end
  16. end
  17.  
  18. while true do
  19.   local event, modemSize, replyChannel, message, distance = os.pullEvent("modem_message")
  20.   sendItem()
  21.   sleep(1)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement