Advertisement
vacnoa

detector dispositivos

Apr 30th, 2025
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. -- detectarPerifericos.lua
  2. -- Lista todos los periféricos conectados y su tipo
  3.  
  4. print("Detectando periféricos conectados...\n")
  5.  
  6. local found = false
  7.  
  8. for _, side in pairs(peripheral.getNames()) do
  9.     local pType = peripheral.getType(side)
  10.     print("Lado: " .. side .. "  →  Tipo: " .. pType)
  11.     found = true
  12. end
  13.  
  14. if not found then
  15.     print("No se detectaron periféricos.")
  16. end
  17.  
  18. print("\nFin de la lista.")
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement