Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rowLength = 20
- local numRows = 16
- local turnRightFirst = true
- local turnRightNext = turnRightFirst
- local currentSlot = 1
- function setActiveSlot(slotNumber)
- slotNumber = tonumber(slotNumber)
- if slotNumber ~= nil then
- currentSlot = slotNumber
- turtle.select(slotNumber)
- end
- end
- function harvest()
- print("Harvesting...")
- setActiveSlot(1)
- turtle.digDown()
- turtle.placeDown()
- end
- function refuelFromLastSlot()
- setActiveSlot(16)
- turtle.refuel()
- end
- function turn(numberOfTimes, goRight)
- if goRight == true then
- for i=0, numberOfTimes do
- turtle.turnRight()
- end
- else
- for i=0, numberOfTimes do
- turtle.turnLeft()
- end
- end
- end
- function returnHome()
- turtle.forward()
- turtle.turnRight()
- for i=0, 30 do
- turtle.forward()
- end
- end
- refuelFromLastSlot()
- for i=0, numRows do
- for j=0, rowLength do
- turtle.forward()
- harvest()
- end
- turn(1, turnRightNext)
- turtle.forward()
- turtle.forward()
- turn(1, turnRightNext)
- turnRightNext = not turnRightNext
- end
- returnHome()
Advertisement
Add Comment
Please, Sign In to add comment