ETvd

EMC receiver

Jan 9th, 2024
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modemSide = "back"
  2. local monitor = peripheral.wrap("left")
  3.  
  4. rednet.open(modemSide)
  5.  
  6. local function formatEMCValue(emc)
  7. local billion = emc / 1000000000
  8. return string.format("%.2fB", billion)
  9. end
  10.  
  11. while true do
  12. local senderID, message = rednet.receive()
  13.  
  14. monitor.clear()
  15. monitor.setBackgroundColor(colors.black)
  16. monitor.setTextColor(colors.red)
  17. monitor.setCursorPos(1, 1)
  18. monitor.write("Chest Contents")
  19. monitor.setCursorPos(1, 2)
  20. monitor.write("EMC: " .. formatEMCValue(tonumber(message)))
  21. end
  22.  
Add Comment
Please, Sign In to add comment