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 l = 1
- while x > l do
- if turtle.detectDown then
- turtle.digDown()
- end
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- l = l + 1
- end
- turtle.digDown()
- end
- function turn(d)
- if d == 0 then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- function harvest()
- turtle.up()
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- -- turtle is now in position
- local d = 0
- local w = 1
- while w < y do
- clearRow()
- turn(d)
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- turn(d)
- w = w + 1
- if d == 1 then
- d = 0
- else
- d = 1
- end
- end
- end
- init()
- harvest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement