Advertisement
Guest User

Untitled

a guest
May 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local wired = peripheral.wrap("back")
  2. local wireless = peripheral.wrap("right")
  3. local mfsu_one = peripheral.wrap("mfsu_1")
  4. local mfsu_two = peripheral.wrap("mfsu_2")
  5.  
  6. local euStoredTotal, capacityTotal
  7. local relayID = 18
  8.  
  9. function OpenWireless()
  10.     rednet.open("right")
  11.     rednet.close("back")
  12. end
  13.  
  14. function OpenWired()
  15.     rednet.open("back")
  16.     rednet.close("right")
  17. end
  18.  
  19. function SendToRelay(msg)
  20.     rednet.send(relayID, msg)
  21. end
  22.  
  23. function MainLoop()
  24.     while true do
  25.         sleep(1)
  26.         OpenWired()
  27.         euStoredTotal = mfsu_one.getEUStored() + mfsu_two.getEUStored()
  28.         capacityTotal = mfsu_one.getEUCapacity() + mfsu_two.getEUCapacity()
  29.         OpenWireless()
  30.         SendToRelay("<eustored>" .. euStoredTotal)
  31.         SendToRelay("<eucapacity>" .. capacityTotal)
  32.     end
  33. end
  34.  
  35. MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement