Advertisement
Guest User

canawireless

a guest
Oct 25th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. rednet.open("top")
  3. print("Enviando sinal...")
  4.  
  5. while true do
  6. prox = peripheral.wrap("left")
  7. --print(textutils.serialize(prox.getTargets()))
  8.  local targets = prox.getTargets()
  9.  
  10. for name, basicDetails in pairs(targets) do
  11.  
  12.  local moreDetails = prox.getTargetDetails(name)
  13.   if moreDetails.RawName == "net.chest" then
  14.     local T = {}
  15.     T[0] = moreDetails.InventoryPercentFull
  16.     T[1] = moreDetails.ItemCount
  17.     T[2] = moreDetails.TotalSpace
  18.     local Table = textutils.serialize(T)
  19.     --rednet.send(18, moreDetails.ItemCount)
  20.     rednet.send(18, Table)
  21.   end
  22. end -- Fecha o FOR in Pairs
  23.  
  24. sleep(4)
  25. end  -- fecha o While
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement