Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- turtle bucket filler
- -- slot1 : sample backet (oil, lava, etc)
- rs.setOutput("back", true);
- while true do
- print("turtle bucket filler");
- for i=2, 16 do
- turtle.suck();
- end
- local foundIdx = -1;
- for i=2, 16 do
- turtle.select(i);
- if -1 == foundIdx then
- cnt = turtle.getItemCount(i);
- if 0 < cnt then
- if true == turtle.compareTo(1) then
- turtle.drop();
- else
- foundIdx = i;
- turtle.drop(cnt - 1);
- end
- end
- else
- turtle.drop();
- end
- end
- if -1 ~= foundIdx then
- rs.setOutput("back", false);
- while true do
- turtle.select(foundIdx);
- turtle.placeDown();
- if true == turtle.compareTo(1) then
- rs.setOutput("back", true);
- turtle.drop();
- print("filled one bucket.");
- break;
- end
- sleep(1);
- print("no liquid. retry.");
- end
- else
- print("no empty bucket.");
- end
- sleep(1);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement