Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inventorycheckslot = 1
- bonemealslot = 2
- bonemeallowlimit = 10
- seedslot = 3
- seedlowlimit = 10
- dumpslotbegin = 4
- dumpslotend = 16
- runbeforeempy = 32
- function resetPosition()
- turtle.select(inventorycheckslot)
- c = turtle.compare()
- print("Resetting position.")
- while c==false do
- c = turtle.compare()
- if (c==false) then
- turtle.turnRight()
- sleep(1)
- end
- end
- sleep(1)
- turtle.turnRight()
- sleep(1)
- turtle.turnRight()
- sleep(1)
- end
- function refill()
- print("Refilling bonemeal.")
- turtle.select(bonemealslot)
- turtle.dropUp()
- turtle.suckUp()
- if (turtle.getItemCount(seedslot) < seedslot) then
- print("Refilling seeds.")
- turtle.turnRight()
- sleep(1)
- turtle.turnRight()
- sleep(1)
- turtle.select(seedslot)
- turtle.drop()
- sleep(1)
- turtle.suck()
- sleep(1)
- turtle.turnRight()
- sleep(1)
- turtle.turnRight()
- sleep(1)
- end
- end
- function boneMeal()
- if (turtle.getItemCount(bonemealslot) < bonemeallowlimit) then
- refill()
- end
- b = true
- while b==true do
- turtle.select(bonemealslot)
- b = turtle.place()
- end
- end
- function placeSeed ()
- if (turtle.getItemCount(seedslot) < seedlowlimit) then
- refill()
- end
- turtle.select(seedslot)
- turtle.place()
- end
- function emptySlots()
- for i=dumpslotbegin,dumpslotend do
- turtle.select(i)
- turtle.dropUp()
- end
- end
- resetPosition()
- while true do
- if(redstone.getInput("bottom")==true) then
- for i=1,runbeforeempy do
- print("Farming run: ".. i .." of ".. runbeforeempy)
- turtle.dig()
- sleep(1)
- turtle.suck()
- sleep(1)
- placeSeed()
- sleep(1)
- boneMeal()
- sleep(1)
- turtle.dig()
- sleep(1)
- turtle.suck()
- sleep(1)
- turtle.suck()
- end
- emptySlots()
- else
- turtle.suck()
- print("No Redstone signal")
- print("Sleeping for 60 seconds")
- sleep(30)
- turtle.suck()
- print("Sleeping for 30 seconds")
- sleep(20)
- turtle.suck()
- print("Sleeping for 10 seconds")
- sleep(10)
- turtle.suck()
- emptySlots()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment