Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local i = 1
- local x = 1
- local y = 1
- local z = 0
- local function empty()
- for x=1,15 do
- turtle.select(x)
- turtle.dropUp()
- end
- end
- local function turnAround(y)
- if y%2 == 0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- end
- if y%2 == 1 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.dig()
- end
- end
- local function goHome(y)
- turtle.up()
- if y%2 == 1 then
- turtle.turnRight()
- turtle.turnRight()
- end
- repeat turtle.forward()
- until turtle.forward()== false
- turtle.turnRight()
- repeat turtle.forward()
- y = y - 1
- until y == 1
- turtle.turnRight()
- end
- local function till()
- repeat
- turtle.dig()
- turtle.forward()
- turtle.select(16)
- until turtle.compareDown()
- turnAround(y)
- end
- local function endOfPlotCheck()
- turtle.select(16)
- if turtle.compareDown() == true then
- turtle.forward()
- if turtle.compareDown() == true then
- turtle.forward()
- if turtle.compareDown() == true then
- return true
- end
- end
- end
- end
- while true do
- turtle.select(1)
- rednet.open("right")
- local senderId, msg = rednet.receive()
- if msg == "harvest" then
- turtle.forward()
- turtle.digDown()
- turtle.down()
- repeat
- till()
- y = y + 1
- until endOfPlotCheck()
- goHome(y)
- empty()
- os.reboot()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement