Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Blocks = {}
- Blocks["minecraft:lapis_block"] = {}
- Blocks["minecraft:lapis_block"][0] = "front"
- Blocks["minecraft:wool"] = {}
- --laine orange
- Blocks["minecraft:wool"][1] = "carrot"
- --laine bleue claire
- Blocks["minecraft:wool"][3] = "right"
- --laine marron
- Blocks["minecraft:wool"][12] = "left"
- --laine noire
- Blocks["minecraft:wool"][15] = "drop"
- --laine blanche
- Blocks["minecraft:wool"][0] = "load"
- Blocks["minecraft:coal_block"] = {}
- Blocks["minecraft:coal_block"][0] = "refuel"
- function treatDirection(chain)
- if chain == "left" then
- turtle.turnLeft()
- elseif chain == "right" then
- turtle.turnRight()
- elseif chain == "carrot" then
- cropsAction()
- turtle.turnLeft()
- cropsAction()
- elseif chain == "refuel" then
- refuelAction()
- turtle.turnLeft()
- turtle.turnLeft()
- elseif chain == "drop" then
- turtle.select(2)
- turtle.drop(64)
- turtle.turnLeft()
- turtle.turnLeft()
- elseif chain == "load" then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- turtle.forward()
- end
- function refuelAction()
- turtle.select(1)
- turtle.suck(1)
- turtle.refuel()
- end
- function checkDirection()
- find, res = turtle.inspectDown()
- print(find)
- print(Blocks[res.name])
- print(Blocks[res.name][res.metadata])
- if find and Blocks[res.name] and Blocks[res.name][res.metadata] then
- treatDirection(Blocks[res.name][res.metadata])
- else
- exit()
- end
- end
- function cropsAction(type)
- turtle.turnLeft()
- test, datas = turtle.inspect()
- if datas.name == type and datas.metadata == 7 then
- turtle.select(2)
- turtle.dig()
- turtle.place()
- end
- end
- while true do
- checkDirection()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement