Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg = { ... }
- local x = 6
- local y = 6
- function init()
- if not arg[1] == nil then
- x = tonumber(arg[1])
- if x < 1 then
- x = 6
- end
- end
- if not arg[2] == nil then
- y = tonumber(arg[1])
- if x < 1 then
- x = 6
- end
- end
- end
- function clearRow()
- local z = 1
- while x > z do
- if turtle.detectDown then
- turtle.digDown()
- end
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- turtle.digDown()
- end
- function turn(i)
- if i == 0 then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- function harvest()
- turtle.up()
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- local i = 0
- local k = 1
- while k < 6 do
- clearRow()
- turn(i)
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- turn(i)
- k = k + 1
- if i == 1 then
- i = 0
- else
- i = 1
- end
- end
- end
- init()
- harvest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement