Advertisement
Guest User

startup

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