Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input, unsort = colors.white, colors.black
- analyzer = peripheral.wrap("top")
- function sendPulse(color)
- local startColor = rs.getBundledOutput("back")
- rs.setBundledOutput("back",color+startColor)
- os.sleep(0.25)
- rs.setBundledOutput("back",startColor)
- end
- function setColor(color)
- rs.setBundledOutput("back",color)
- 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 == "Hill Cherry" ) then setColor(colors.cyan)
- else if ( species == "Silver Lime" ) then setColor(colors.orange)
- else setColor(unsort) end
- end
- while true do
- readySapling()
- processSapling()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement