Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Funzione per controllare se il blocco davanti è acqua
- function isWater()
- local success, data = turtle.inspect()
- if success then
- return data.name == "minecraft:water" or data.name == "minecraft:flowing_water"
- end
- return false
- end
- -- Funzione principale che stampa se il blocco davanti è acqua o no ogni 0.5 secondi
- function checkBlock()
- while true do
- if isWater() then
- print("Il blocco davanti è acqua.")
- else
- print("Il blocco davanti non è acqua.")
- end
- sleep(0.5)
- end
- end
- -- Avvio del programma
- checkBlock()
Advertisement
Add Comment
Please, Sign In to add comment