Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkBlock()
- local bool, data = turtle.inspect()
- while not bool do
- turn("r")
- bool, data = turtle.inspect()
- end
- parseBlock(data)
- end
- function parseNotes(data)
- song = fs.open("song","a")
- song.writeLine(data.state.instrument..":"..data.state.note)
- turtle.dig()
- turtle.forward()
- turn("l")
- local bool, data1 = turtle.inspect()
- if (bool) then
- song.writeLine(data1.state.instrument..":"..data1.state.note)
- end
- turn("r")
- turn("r")
- local bool1, data2 = turtle.inspect()
- if (bool1) then
- song.writeLine(data2.state.instrument..":"..data2.state.note)
- end
- song.close()
- turn("l")
- end
- function parseBlock(data)
- if(data.name == "minecraft:repeater") then
- song = fs.open("song", "a")
- song.writeLine("delay:"..data.state.delay)
- turtle.dig()
- turtle.forward()
- song.close()
- elseif(data.name == "minecraft:note_block") then
- parseNotes(data)
- else
- turtle.dig()
- turtle.forward()
- end
- end
- function turn(dir)
- if(dir == "r")then
- turtle.turnRight()
- elseif(dir == "l")then
- turtle.turnLeft()
- end
- end
- while true do
- checkBlock()
- end
Add Comment
Please, Sign In to add comment