Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x, y, z = gps.locate()
- row = {514, 518, 521, 525, 528, 532}
- local row_Count = 1
- drop = {520, 527}
- local drop_Count = 1
- function reverse()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function up_Line()
- reverse()
- for i = 1, 5 do
- turtle.forward()
- end
- turtle.up()
- for j = 1, 7 do
- turtle.forward()
- end
- turtle.up()
- for k = 1, 7 do
- turtle.forward()
- end
- row_Count = 1
- drop_Count = 1
- reverse()
- end
- function clear()
- if turtle.detect() == true then
- turtle.dig()
- end
- end
- function check()
- turtle.select(2)
- if turtle.compare() then
- while turtle.detect() == true do
- turtle.dig()
- end
- turtle.select(1)
- turtle.place()
- end
- end
- function check_Row()
- turtle.turnLeft()
- check()
- reverse()
- check()
- turtle.turnLeft()
- end
- function at_Row()
- x, y, z = gps.locate()
- if z == row[row_Count] then
- print("I am at row "..row_Count.."")
- check_Row()
- row_Count = row_Count + 1
- end
- end
- function at_Drop()
- x, y, z = gps.locate()
- if z == drop[drop_Count] then
- print("I am at drop "..drop_Count.."")
- turtle.down()
- drop_Count = drop_Count + 1
- end
- end
- function down_Line()
- for i = 1, 19 do
- clear()
- at_Row()
- at_Drop()
- turtle.forward()
- end
- end
- -- Main Func --
- while true do
- local time = os.time()
- if time == 12.000 then
- down_Line()
- up_Line()
- end
- sleep(0.05)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement