Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.wrap("left")
- while true do
- print("Veuillez sélectionner une fonction:")
- print("1. getItemDetail")
- print("2. list")
- print("3. size")
- print("4. Quitter")
- local choix = read()
- if choix == "1" then
- print("Entrez l'index de l'élément pour getItemDetail:")
- local index = tonumber(read())
- local detail = p.getItemDetail(index)
- if detail then
- for k, v in pairs(detail) do
- print(k, v)
- end
- else
- print("Aucun détail trouvé pour l'index spécifié.")
- end
- elseif choix == "2" then
- local liste = p.list()
- for k, v in pairs(liste) do
- print(k, v)
- end
- elseif choix == "3" then
- local taille = p.size()
- print("Taille :", taille)
- elseif choix == "4" then
- print("Programme terminé.")
- break
- else
- print("Choix non valide, veuillez réessayer.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement