Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start = vector.new(1097,47,1092)
- pos = vector.new(gps.locate(5))
- args = {...}
- ud = args[0]
- lr = args[1]
- crops = {}
- crops["magicalcrops:MinicioCrop"] = "magicalcrops:MinicioSeeds"
- crops["magicalcrops:CoalCrop"] = "magicalcrops:CoalSeeds"
- face = "s"
- --Default
- ud = 12
- lr = 24
- function goHome()
- print("x: ",pos.x)
- print("z: ",pos.z)
- if face == 's' then
- turtle.turnRight()
- turtle.turnRight()
- end
- for i=0,pos.z do
- turtle.forward()
- end
- turtle.down();
- end
- function nextRow()
- if face == "s" then
- turtle.turnRight()
- turtle.forward()
- pos.z = pos.z + 1
- turtle.turnRight()
- face = "n"
- else
- turtle.turnLeft()
- turtle.forward()
- pos.z = pos.z + 1
- turtle.turnLeft()
- face = "s"
- end
- end
- function checkCrop()
- local success, data = turtle.inspectDown()
- if success then
- if data.metadata == 7 then
- print("Grown Crop")
- turtle.digDown()
- for i=1,16 do
- seed = crops[data.name]
- print("i: ",i)
- if turtle.getItemDetail(i) ~= nil then
- if(seed == turtle.getItemDetail(i).name) then
- print("Found Seed")
- turtle.select(i)
- turtle.placeDown()
- end
- end
- end
- else
- print("Crop Still Growing: ",data.metadata)
- end
- end
- return 0
- end
- --Start
- turtle.up()
- for d=0,lr do
- for i=0,ud do
- turtle.forward()
- if face == "s" then
- pos.x = pos.x + 1
- else
- pos.x = pos.x - 1
- end
- checkCrop()
- end
- nextRow()
- checkCrop()
- end
- goHome()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement