Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Small wheat farm script
- t = turtle
- sleep = 6000 -- Sets sleep timer
- local function plant() -- cycles through inv. and finds seeds
- for i = 1, 15, 1 do
- t.select(i)
- if t.compareTo(16) == true then
- t.placeDown()
- end
- end
- end
- local function digStep() -- harvests, plants, and moves one
- t.digDown() -- space forward
- plant()
- t.forward()
- end
- local function shortRow()
- digStep()
- digStep()
- digStep()
- end
- local function longRow()
- digStep()
- digStep()
- digStep()
- digStep()
- end
- local function dropOff() -- Unloads inventory
- for i = 1, 15, 1 do
- t.select(i)
- t.dropDown()
- end
- end
- -- Movement path for top-center
- -- chest to start
- local function farm()
- t.turnLeft()
- t.forward()
- t.turnRight()
- t.forward()
- t.digDown()
- plant()
- t.turnLeft()
- t.forward()
- t.turnRight()
- -- start
- shortRow()
- t.digDown()
- plant()
- t.turnRight()
- longRow()
- t.digDown()
- plant()
- t.turnRight()
- t.forward()
- t.turnRight()
- shortRow()
- t.digDown()
- plant()
- t.turnLeft()
- t.forward()
- t.turnLeft()
- shortRow()
- t.digDown()
- plant()
- t.turnRight()
- t.forward()
- t.digDown()
- plant()
- t.turnRight()
- t.forward()
- t.digDown()
- plant()
- t.turnLeft()
- t.forward()
- t.turnRight()
- t.forward()
- t.turnRight()
- dropOff()
- os.sleep(sleep)
- end
- while true do
- farm()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement