Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Pillage the lands")
- print("Rape the Earth")
- t = turtle
- kills = 0
- function forceForward()
- if t.forward() == false then
- t.attack()
- t.dig()
- forrceForward()
- end
- end
- function killTree()
- t.dig()
- t.forward()
- local above = false
- if t.detectUp() then
- above = true
- end
- while above do
- t.digUp()
- t.up()
- above = t.detectUp()
- end
- while t.detectDown() == false do
- t.down()
- end
- kills = kills + 1
- end
- local allowed = {"minecraft:leaves", "minecraft:tallgrass", "minecraft:vine", "minecraft:red_flower", "minecraft:yellow_flower", "minecraft:melon_block"}
- function breakable(data)
- for key, value in pairs(allowed) do
- if value == data.name then return true end
- end
- return false
- end
- function step()
- local succF, dF = t.inspect()
- local succU, dU = t.inspectUp()
- local succD, dD = t.inspectDown()
- if succF == false then
- forceForward()
- while t.detectDown() == false do
- t.down()
- end
- else
- if breakable(dF) then
- t.dig()
- forceForward()
- while t.detectDown() == false do
- t.down()
- end
- elseif dF.name == "minecraft:log" then
- killTree()
- else
- if succU == false then
- t.up()
- step()
- else
- if breakable(dU) then
- t.dig()
- t.up()
- step()
- end
- end
- end
- end
- end
- function roam()
- local x = 1
- while x < 50 do
- local i = 0
- while i < 2 do
- t.turnRight()
- local k = 0
- while k < x do
- step()
- k = k + 1
- end
- i = i + 1
- end
- x = x + 1
- end
- end
- roam()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement