Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("bottom")
- turbine = peripheral.wrap("top")
- rpmTurbine = "null"
- rfTurbine = "null"
- temp = "null"
- print("En attente...")
- local idServer = 5
- function detect()
- rpmTurbine = math.floor(turbine.getRotorSpeed())
- rfTurbine = math.floor(turbine.getEnergyProducedLastTick())
- id,temp = rednet.receive()
- end
- while true do
- if temp == "RPM" then
- rpmTurbine = math.floor(turbine.getRotorSpeed())
- rednet.send(idServer,rpmTurbine)
- temp = "null"
- end
- if temp == "rf" then
- rfTurbine = math.floor(turbine.getEnergyProducedLastTick())
- rednet.send(idServer,rfTurbine)
- temp = "null"
- end
- if temp == "null" then
- term.clear()
- term.setCursorPos(1,1)
- print("Envoi donnees de Turbine 1 : ID : 7")
- print("")
- print(rpmTurbine.." RPM")
- print(rfTurbine.." RF/T")
- detect()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement