Advertisement
randalthor7

Dreambot - Jug Filling 1

Sep 3rd, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. private void filling() {
  2. if(getInventory().interact("Jug", "Use")) {
  3. currentState = "filling jugs";
  4. GameObject source = getGameObjects().closest(waterObject);
  5. if(source != null) {
  6. fillingJugs = true;
  7. sleepUntil(() -> fillingJugs, 5000);
  8. currentState = "pump not null";
  9. String[] possibleActions = source.getActions();
  10. int i = possibleActions.length;
  11. for(int j = 0; j < i; j++) {
  12. log(possibleActions[j]);
  13. }
  14. if(source.interact("Use")) {
  15. currentState = "startedFilling";
  16. jugsFilled += 28;
  17. sleepUntil(() -> !getInventory().contains("Jug"), 8000);
  18. }
  19. } else {
  20. currentState = "pump is null";
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement