Advertisement
giwdul

send_data_reactor_CC

Jul 8th, 2023 (edited)
715
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. -- Send data of Bigger Reactors to another Computer, here the producedLastTick() function
  2.  
  3. -- Assurez-vous que votre modem est sur le bon côté, ici "front"
  4. local modem = peripheral.wrap("front")
  5. local reactor = peripheral.wrap("back")
  6. local reactor = reactor.battery()
  7. -- ID de l'ordinateur recevant les données
  8. local receiverID = 6
  9. -- La fréquence à laquelle envoyer des mises à jour (en secondes)
  10. local updateFrequency = 1
  11.  
  12. while true do
  13.     local production = reactor.producedLastTick()
  14.     rednet.open("front")
  15.     rednet.send(receiverID, production)
  16.     rednet.close("front")
  17.     sleep(updateFrequency)
  18. end
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement