Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Inspect the block in front of the turtle
- local success, data = turtle.inspect()
- if success then
- local blockName = data.name or "unknown_block"
- local fileName = blockName .. ".txt"
- local file = fs.open(fileName, "w")
- if file then
- file.write(textutils.serialize(data))
- file.close()
- print("Block data written to " .. fileName)
- else
- print("Failed to open file for writing.")
- end
- else
- print("No block in front to inspect.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement