Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input, unsort, left, back = colors.white, colors.black, colors.red, colors.yellow
- leftSapling = "Silver Lime"
- backSapling = "Hill Cherry"
- analyzer = peripheral.wrap("top")
- function sendPulse(color)
- rs.setBundledOutput("back",color)
- os.sleep(0.25)
- rs.setBundledOutput("back",0)
- end
- function readySapling()
- while ( not analyzer.isTree() ) do
- sendPulse(input)
- os.sleep(5)
- end
- end
- function processSapling()
- if ( not analyzer.isTree() ) then return end
- local treeData = analyzer.analyze()
- local species = treeData["speciesPrimary"]
- if ( species == leftSapling ) then sendPulse(left)
- else if ( species == backSapling ) then sendPulse(back)
- else sendPulse(unsort) end
- end
- while true do
- readySapling()
- processSapling()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement