Class MouseKeys


  • public class MouseKeys
    extends java.lang.Object
    Created by Chris on 1/25/2015.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean clickAndSkipItem()
      Clicks 5, sleeps, pushes 8 then 2 twice
      static boolean dropAllItems()  
      static boolean dropAllItemsExcept​(int[] excludedItems)  
      static boolean dropAllItemsExceptInSlots​(int[] excludedItems, int[] slots)  
      static boolean dropAllItemsInSlots​(int[] slots)  
      static boolean dropAllSpecificItems​(int[] items)  
      static boolean dropAllSpecificItemsInSlots​(int[] items, int[] slots)  
      static boolean dropColumn​(int column, Filter<Item> dropFilter)
      Drops all the items in a given column that match the given filter
      static boolean dropItem​(Item item, Filter<Item> dropFilter)
      Checks the item against the given filter, if the item is null or dropFilter doesn't match, it skips it otherwise calls mouseKeyCombo
      static boolean dropItems​(Filter<Item> dropFilter)
      Drops all items in all rows that match the dropFilter
      static int getJumpDistance()
      Gets the mouse jump distance in pixels
      static boolean initialColumnMouseCheck​(int column, Filter<Item> dropFilter)
      Moves mouse to the top item in the column and right clicks, returns if menu is visible
      static boolean mouseKeyCombo()
      Pushes 5, sleeps, pushes 2, sleeps
      static boolean pushEight()
      Jumps up by the jump distance
      static boolean pushFive()
      Left clicks and then right clicks with no delay between
      static boolean pushFour()
      Jumps left by the jump distance
      static boolean pushNine()
      Jumps up and right by the jump distance
      static boolean pushOne()
      Jumps down and to the left by the jump distance
      static boolean pushSeven()
      Jumps up and left by the jump distance
      static boolean pushSix()
      Jumps right by the jump distance
      static boolean pushThree()
      Jumps down and right by the jump distance
      static boolean pushTwo()
      Jumps down by the jump distance
      static boolean setKeySleeps​(int min, int max)
      Sets the min and max values for the sleep between key presses Will throw exceptions if you give negative values or if min is greater than or equal to max
      static void setYJumpDistance​(int jump)
      Sets the jump distance in pixels
      static boolean skipItem()
      if menu is visible, clicks and skips next item, otherwise pushes 2
      static boolean tabCheck()
      Checks if the inventory tab is open, if it isn't it opens it
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setYJumpDistance

        public static void setYJumpDistance​(int jump)
        Sets the jump distance in pixels
        Parameters:
        jump - pixel distance to mouse jump
      • getJumpDistance

        public static int getJumpDistance()
        Gets the mouse jump distance in pixels
        Returns:
      • setKeySleeps

        public static boolean setKeySleeps​(int min,
                                           int max)
        Sets the min and max values for the sleep between key presses Will throw exceptions if you give negative values or if min is greater than or equal to max
        Parameters:
        min - min time to sleep (in ms)
        max - max time to sleep (in ms)
        Returns:
        true if successfully sets sleep
      • dropAllItems

        public static boolean dropAllItems()
      • dropAllItemsExcept

        public static boolean dropAllItemsExcept​(int[] excludedItems)
      • dropAllSpecificItems

        public static boolean dropAllSpecificItems​(int[] items)
      • dropAllItemsInSlots

        public static boolean dropAllItemsInSlots​(int[] slots)
      • dropAllItemsExceptInSlots

        public static boolean dropAllItemsExceptInSlots​(int[] excludedItems,
                                                        int[] slots)
      • dropAllSpecificItemsInSlots

        public static boolean dropAllSpecificItemsInSlots​(int[] items,
                                                          int[] slots)
      • dropItems

        public static boolean dropItems​(Filter<Item> dropFilter)
        Drops all items in all rows that match the dropFilter
        Parameters:
        dropFilter - dropFilter
        Returns:
        true if there are no items that match the dropFilter after running this method
      • dropColumn

        public static boolean dropColumn​(int column,
                                         Filter<Item> dropFilter)
        Drops all the items in a given column that match the given filter
        Parameters:
        column - column 0-3 (inclusive)
        dropFilter - dropFilter
        Returns:
        True if there are no items that match dropFilter after running this method (note it does check items in other columns in this check)
      • initialColumnMouseCheck

        public static boolean initialColumnMouseCheck​(int column,
                                                      Filter<Item> dropFilter)
        Moves mouse to the top item in the column and right clicks, returns if menu is visible
        Parameters:
        column - columns 0-3 (inclusive)
        dropFilter - dropFilter
        Returns:
        True if menu is visible, else False
      • dropItem

        public static boolean dropItem​(Item item,
                                       Filter<Item> dropFilter)
        Checks the item against the given filter, if the item is null or dropFilter doesn't match, it skips it otherwise calls mouseKeyCombo
        Parameters:
        item - Item to drop
        dropFilter - dropFilter
        Returns:
        True if successfully calls mouseKeyCombo or skips
      • tabCheck

        public static boolean tabCheck()
        Checks if the inventory tab is open, if it isn't it opens it
        Returns:
        result of getTabs.isOpen(inventory)
      • skipItem

        public static boolean skipItem()
        if menu is visible, clicks and skips next item, otherwise pushes 2
        Returns:
        result of clickAndSkipItem if menu is visible, else result of pushTwo
      • clickAndSkipItem

        public static boolean clickAndSkipItem()
        Clicks 5, sleeps, pushes 8 then 2 twice
        Returns:
        true if all calls complete successfully, else false
      • mouseKeyCombo

        public static boolean mouseKeyCombo()
        Pushes 5, sleeps, pushes 2, sleeps
        Returns:
        result of pushing 5 and pushing 2
      • pushOne

        public static boolean pushOne()
        Jumps down and to the left by the jump distance
        Returns:
        result of mouse.hop
      • pushTwo

        public static boolean pushTwo()
        Jumps down by the jump distance
        Returns:
        result of mouse.hop
      • pushThree

        public static boolean pushThree()
        Jumps down and right by the jump distance
        Returns:
        result of mouse.hop
      • pushFour

        public static boolean pushFour()
        Jumps left by the jump distance
        Returns:
        result of mouse.hop
      • pushFive

        public static boolean pushFive()
        Left clicks and then right clicks with no delay between
        Returns:
        result of both clicks
      • pushSix

        public static boolean pushSix()
        Jumps right by the jump distance
        Returns:
        result of mouse.hop
      • pushSeven

        public static boolean pushSeven()
        Jumps up and left by the jump distance
        Returns:
        result of mouse.hop
      • pushEight

        public static boolean pushEight()
        Jumps up by the jump distance
        Returns:
        result of mouse.hop
      • pushNine

        public static boolean pushNine()
        Jumps up and right by the jump distance
        Returns:
        result of mouse.hop