Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. private void talkTo(String npc){
  2. List<WidgetChild> clickToContinue = getWidgets().getWidgetChildrenContainingText("Click to continue");
  3. if(!clickToContinue.isEmpty()){
  4. WidgetChild wc = clickToContinue.get(0);
  5. if(wc != null && wc.isVisible()){
  6. log("Interacting with widget");
  7. wc.interact();
  8. sleep(900,1200);
  9. }
  10. }
  11. if(!getDialogues().canContinue()){
  12. final NPC guide = getNpcs().closest(npc);
  13. if(guide != null){
  14. if(guide.isOnScreen()){
  15. if(guide.interact("Talk-to")){
  16. walkingSleep();
  17. sleepUntil(new Condition(){
  18. public boolean verify(){
  19. return getDialogues().canContinue();
  20. }
  21. },Calculations.random(1200,1600));
  22. }
  23. }
  24. else{
  25. getWalking().walk(guide);
  26. walkingSleep();
  27. }
  28. }
  29. }
  30. else{
  31. log("Clicking continue");
  32. getDialogues().clickContinue();
  33. sleep(600,900);
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement