Guest User

Untitled

a guest
Jul 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. /**
  2. * Closes the bank interface
  3. * @return whether the bank is open (or successfully clicks "Close")
  4. * @author Ampzz
  5. */
  6. public boolean close() {
  7. if(!isOpen()) return true;
  8.  
  9. Interface bankIFace = botEnv.interfaces.getInterface(Bank.BANK_INTERFACE_ID);
  10.  
  11. if(bankIFace != null && bankIFace.isValid()) {
  12. IComponent closeButton = botEnv.interfaces.getComponent(Bank.BANK_INTERFACE_ID, Bank.BANK_BUTTON_CLOSE);
  13. try {
  14. botEnv.mouse.moveMouse( new Point( (int)closeButton.getUpperLeftScreenPos().getX()+random(0, (int)closeButton.getBounds().getWidth()), (int)closeButton.getUpperLeftScreenPos().getY()+random(0, (int)closeButton.getBounds().getHeight()) ) );
  15. sleep(10, 20);
  16. if(botEnv.menu.atMenu("Close"))
  17. return true;
  18. } catch (Exception e) { }
  19. }
  20.  
  21. return false;
  22. }
Add Comment
Please, Sign In to add comment