William8812

Untitled

Dec 7th, 2021
869
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Copyright Wily#3114 2021
  2. --Computer placed with an ender modem and drawer on any side
  3. --"Client" Script
  4.  
  5. -- Initial vars --
  6. drawer_side = "back"
  7. modem_side = "top"
  8. rednet_port = 20
  9. refresh_rate = 60
  10.  
  11. -- Wrapping drawer --
  12. p = peripheral.wrap(drawer_side)
  13. pl = p.list()
  14.  
  15. -- RedNet --
  16. rednet.open(modem_side)
  17.     if pl[2].count == nil then
  18.         else
  19.             rednet.send(rednet_port, pl[2].name.." "..pl[2].count)
  20.     end
  21.  
  22. -- Loop --
  23. while true do
  24.     os.sleep(refresh_rate)
  25.     pl = p.list()
  26.     if pl[2].count == nil then
  27.         else
  28.             rednet.send(rednet_port, pl[2].name.." "..pl[2].count)
  29.     end
  30.    
  31. end
  32.  
RAW Paste Data