Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this = turtle
- function harvest()
- local success, t = this.inspectDown()
- if success
- then
- print("inspect = true")
- if t.name == "AgriCraft:crops"
- then
- print("name = true")
- if t.metadata == 7
- then
- print("metadata = true")
- this.digDown()
- return true
- end
- end
- end
- return false
- end
- function getItemLocation(itemName)
- for i=1,16,1
- do
- local item = this.getItemDetail()
- if item.name == itemName
- then
- return i
- end
- end
- return -1
- end
- function getCropSticksInventoryLocation()
- return getItemLocation("AgriCraft:cropsItem")
- end
- function getSeedInventoryLocation(seedType)
- return getItemLocation(seedType)
- end
- function placeInventory(slot)
- this.select(slot)
- this.placeDown()
- end
- function harvestCrop(seedType)
- local harvested = harvest()
- if harvested
- then
- local stick = getCropSticksInventoryLocation()
- local seed = getSeedInventoryLocation(seedType)
- if stick > 0
- then
- placeInventory(stick)
- end
- if seed > 0
- then
- placeInventory(seed)
- end
- end
- end
- function advance(x,y,turn)
- if y == 7
- then
- turn()
- this.forward()
- turn()
- else
- this.forward()
- end
- end
- function harvestEnderGrid()
- for i=1,7,1
- do
- for j=1,7,1
- do
- harvestCrop("magicalcrops:EndermanSeeds")
- if i % 2 == 0
- then
- advance(i,j,this.turnRight())
- else
- advance(i,j,this.turnLeft())
- end
- end
- end
- end
- harvestEnderGrid()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement