Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function up()
- while not turtle.up() do
- sleep(1)
- end
- end
- function down()
- while not turtle.down() do
- sleep(1)
- end
- end
- function drop()
- for i=1,15 do
- turtle.select(i)
- if not turtle.dropUp() then
- return
- end
- end
- end
- function suck()
- for i=1,15 do
- turtle.suck()
- end
- end
- function check()
- turtle.select(16)
- if turtle.compare() then
- if turtle.getItemCount(15) < 1 then
- suck()
- end
- elseif turtle.detectUp() then
- drop()
- end
- end
- while true do
- x=0
- while not turtle.detectUp() do
- check()
- up()
- end
- while x < 1 do
- check()
- if turtle.getItemCount(15) > 0 then
- x=1
- else
- down()
- end
- if turtle.detectDown() then
- x=1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement