Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.find("monitor") -- Trouver le moniteur connecté
- if not monitor then
- print("Aucun moniteur trouvé.")
- return
- end
- function getTPS()
- local response = shell.run("tps") -- Exécute la commande tps dans le shell
- if response then
- return response
- else
- print("Erreur: Impossible de récupérer les TPS du serveur.")
- return nil
- end
- end
- function displayTPS()
- local tps = getTPS()
- if tps then
- monitor.clear()
- monitor.setCursorPos(1, 1)
- monitor.write("TPS du serveur:")
- monitor.setCursorPos(1, 3)
- monitor.write("TPS: " .. tps)
- end
- end
- while true do
- displayTPS()
- sleep(5) -- Mettre à jour toutes les 5 secondes
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement