Advertisement
Reratos

pinfo

Feb 18th, 2025
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | Gaming | 0 0
  1. local args = {...}
  2.  
  3. if #args ~= 1 then
  4.     print("Exemplo de uso: pinfo <namePeripheral>")
  5.     return
  6. end
  7.  
  8. print("arg: "..args[1])
  9. local item = { peripheral.find(args[1]) }
  10.  
  11. if #item == 0 then
  12.     print("Não foi encontrado nenhum periférico com este nome")
  13.     -- return
  14. end
  15.  
  16. for key, value in pairs(item) do
  17.     print(key.." - "..type(value))
  18. end
  19.  
  20. -- print("item: "..item[1].getName())
  21. for key, value in pairs(peripheral.getMethods(args[1])) do
  22.     print(key.." - "..value)
  23. end
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement