Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Closes the bank interface
- * @return whether the bank is open (or successfully clicks "Close")
- * @author Ampzz
- */
- public boolean close() {
- if(!isOpen()) return true;
- Interface bankIFace = botEnv.interfaces.getInterface(Bank.BANK_INTERFACE_ID);
- if(bankIFace != null && bankIFace.isValid()) {
- IComponent closeButton = botEnv.interfaces.getComponent(Bank.BANK_INTERFACE_ID, Bank.BANK_BUTTON_CLOSE);
- try {
- 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()) ) );
- sleep(10, 20);
- if(botEnv.menu.atMenu("Close"))
- return true;
- } catch (Exception e) { }
- }
- return false;
- }
Add Comment
Please, Sign In to add comment