Class BotBuddy

java.lang.Object
com.esotericpig.jeso.botbuddy.BotBuddy
All Implemented Interfaces:
Duplicable<BotBuddy>, AutoCloseable

public class BotBuddy extends Object implements AutoCloseable, Duplicable<BotBuddy>
 BotBuddy is a simple wrapper around java.awt.Robot.

 Example:
   BotBuddy buddy = BotBuddy.builder().autoDelay(33).autoWaitForIdle(false).build();

   buddy.paste(999,493,"Fish").enter(1427,500,"Sakana");
   buddy.click(1853,1015).delayLong();

 Construct a class:
   BotBuddy.builder().build();

 There's a Safe Mode that throws UserIsActiveException if the user moves the mouse.
 In addition, the pressed keys and pressed mouse buttons are stored internally if
 Release Mode is on (on by default), so that you can release everything currently
 pressed down to alleviate problems for the user when active.
   try {
     buddy.beginSafeMode()
          .enter(1470,131,"Mommy")
          .delay(2000) // Move your mouse during this time
          .enter(1470,131,"Daddy")
          .endSafeMode();
   }
   catch(UserIsActiveException ex) {
     // Release all keys and/or mouse buttons pressed down by our automatic operations
     buddy.releasePressed();

     // If you move your mouse, "Daddy" will not be executed
     System.out.println("User is active! Stopping all automatic operations.");
   }

 If you click into a virtual machine, you can change the OS for Shortcuts:
   buddy.setOSFamily(OSFamily.MACOS);

 See BotBuddyCode for a simple scripting "language" for this class.
 See BotBuddyCodeApp for a simple app that can take in a file that uses BotBuddyCode.
 

Similar Projects:

  • Robot-Utils by Denys Shynkarenko (@Denysss) [GitHub]
  • Automaton by Renato Athaydes (@renatoathaydes) [GitHub]

Getting mouse coordinates:

Author:
Jonathan Bradley Whited
See Also: