Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function empty()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=2, 16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function plant()
- turtle.select(1)
- turtle.place()
- end
- function cut()
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- turtle.back()
- end
- function test()
- for i=1, 12 do
- j = turtle.getItemCount(1)
- if j>1 then
- return 1
- else
- if i==1 then
- print("Nedovoljno saplinga (stavi saplinge u slot 1).")
- end
- sleep(5)
- end
- end
- print("Nisu umetnuti potrebni resursi, obustavljam program...")
- end
- --GLAVNI PROGRAM
- k = 0
- k = test()
- while k do
- plant()
- turtle.up()
- while not turtle.detect() do
- sleep(2)
- end
- turtle.down()
- cut()
- empty()
- k = test()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement