Advertisement
FALSkills

Untitled

Mar 4th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. private boolean hoverMenuOption(String option){
  2. if(!ChooseOption.isOpen())
  3. Mouse.click(3);
  4. if(isHoveringOption(option)){
  5. return true;
  6. }
  7. if(Timing.waitCondition(EzConditions.chooseOptionIsOpen(), 750)){
  8. RSMenuNode[] nodes = ChooseOption.getMenuNodes();
  9. if(nodes == null)
  10. return false;
  11. for(RSMenuNode node:nodes){
  12. if(node.containsAction(option)){
  13. Rectangle r = node.getArea();
  14. if(!r.contains(Mouse.getPos())){
  15. Mouse.moveBox(r);
  16. }
  17. return true;
  18. }
  19. }
  20. }
  21. return false;
  22. }
  23.  
  24. private boolean isHoveringOption(String option){
  25. RSMenuNode[] nodes = ChooseOption.getMenuNodes();
  26. if(nodes == null)
  27. return false;
  28. boolean value = false;
  29. for(RSMenuNode node:nodes){
  30. if(node.containsAction(option)){
  31. Rectangle area = node.getArea();
  32. if(area != null && area.contains(Mouse.getPos())){
  33. value = true;
  34. }
  35. }
  36. }
  37. return value;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement