Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function forward()
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- end
- function downward()
- while not turtle.down() do
- turtle.digDown()
- turtle.attackDown()
- end
- end
- function upward()
- while not turtle.up() do
- turtle.digUp()
- turtle.attackUp()
- end
- end
- function selectItem(item)
- for i=1, 16 do
- local d = turtle.getItemDetail(i)
- if d ~= nil then
- if d.name == "minecraft:"..item then
- turtle.select(i)
- return true
- end
- end
- end
- return false
- end
- function isLog()
- local s,d = turtle.inspect()
- if s then
- if d.name == "minecraft:log" then
- return true
- end
- end
- return false
- end
- function isLogUp()
- local s,d = turtle.inspectUp()
- if s then
- if d.name == "minecraft:log" then
- return true
- end
- end
- return false
- end
- function farmWood()
- print(isLog())
- if isLog() then
- forward()
- while isLogUp() do
- upward()
- end
- while turtle.down() do end
- turtle.back()
- end
- end
- -----------------------------
- while true do
- selectItem("sapling")
- turtle.place()
- selectItem("dye")
- while not isLog() do
- selectItem("dye")
- turtle.place()
- end
- farmWood()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement