Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- row = 0
- function switch()
- print("Met a wall, switching row")
- if row % 2 == 0 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- row = row + 1
- end
- function move()
- turtle.forward()
- local success, data = turtle.inspectDown()
- if success then
- if data.name == "JABBA:barrel" then
- unload()
- return true
- elseif not data.name == "TConstruct:ore.berries.two" then
- turtle.back()
- switch()
- return false
- end
- end
- end
- function harvest()
- turtle.attackUp()
- turtle.attackDown()
- end
- function unload()
- for i = 1,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- if row % 2 == 0 then
- turtle.turnRight()
- turtle.turnRight()
- end
- row = 0
- end
- ---------Main-----------
- while true do
- if move() then
- sleep(st)
- end
- harvest()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement