Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local check, first, tc
- local waiting = false
- redstone.setBundledOutput("back",0)
- redstone.setAnalogOutput("left",0)
- local t,p = turtle.inspectDown()
- if t == true then
- if p.metadata == 14 or
- p.metadata == 0 then
- first = true
- check = {colors.blue,
- colors.yellow}
- else
- first = false
- check = {colors.red,
- colors.white}
- end
- if p.metadata == 14 then
- tc = colors.red
- elseif p.metadata == 0 then
- tc = colors.white
- elseif p.metadata == 4 then
- tc = colors.yellow
- else
- tc = colors.blue
- end
- end
- while true do
- if first == true then
- print("waiting for others")
- if redstone.getBundledInput
- ("back",check[1])
- and redstone.getBundledInput
- ("back",check[2])
- then
- print("digging")
- turtle.dig()
- redstone.setBundledOutput
- ("back", 0)
- sleep(1)
- print("planting")
- redstone.setAnalogOutput
- ("left",15)
- sleep(1)
- redstone.setAnalogOutput
- ("left",0)
- first = false
- end
- else
- print("waiting for growth")
- local m,j = turtle.inspect()
- if m == true then
- if j.metadata == 7 then
- redstone.setBundledOutput
- ("back", tc)
- end
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement