Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local xSize = 2
- local ySize = 2
- local seedSlot = 1
- local _TURN = false
- function checkPlant()
- sleep(.1)
- local is, plant = turtle.inspectDown()
- sleep(.1)
- if plant.metadata ~= nil then
- if plant.metadata > 6 then
- turtle.digDown()
- turtle.select(seedSlot)
- turtle.placeDown()
- end
- end
- end
- function goChest()
- for i=1,xSize do
- turtle.forward()
- end
- turtle.turnRight()
- for i=1,ySize do
- turtle.forward()
- end
- turtle.down()
- turtle.turnLeft()
- dropChest()
- turtle.turnRight()
- turtle.turnRight()
- end
- function dropChest()
- for i=1,16 do
- if i ~= seed then
- turtle.select(i)
- turtle.drop()
- end
- end
- end
- function checkAll()
- for ii=1,ySize do
- for i=1,xSize - 1 do
- checkPlant()
- turtle.forward()
- end
- checkPlant()
- if _TURN == false then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- _TURN = not _TURN
- end
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Yakit kontrolu yapiliyor.")
- if turtle.getFuelLevel() > xSize * ySize then
- print("Yakit yeterli.")
- print("Isleme baslamak icin herhangi tusa basin.")
- read()
- turtle.up()
- turtle.forward()
- checkAll()
- if (number % 2 == 0) then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight
- end
- goChest()
- else
- print("Yetersiz yakit. Lutfen en son slota yakit koyun.")
- print("Yakit koyduktan sonra herhangi tusa basin.")
- read()
- turtle.select(16)
- turtle.refuel()
- sleep(.5)
- end
- end
- print("Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement