コード例 #1
0
 /// <summary>
 /// Determines if the given inventory slot contains any item
 /// </summary>
 /// <param name="x">slots away from the leftmost column (0-3) or screen x coordinate</param>
 /// <param name="y">slots away from the topmost column (0-6) or screen y coordinate</param>
 /// <param name="readScreen">set to true to reread the game screen before checking</param>
 /// <param name="safeTab">set to true to switch to the inventory tab even if it already thinks that it is selected</param>
 /// <returns>true if the slot is empty</returns>
 public bool SlotIsEmpty(int xSlot, int ySlot, bool readScreen = false, bool safeTab = false)
 {
     return(SlotMatchesColorFilter(xSlot, ySlot, RGBHSBRangeFactory.EmptyInventorySlot(), 0.95, readScreen, safeTab));
 }
コード例 #2
0
 /// <summary>
 /// Finds the next slot that a new picked up item would go into.
 /// </summary>
 /// <param name="safeTab">set to false to rely on the Inventory's record of whether it is already on the inventory tab</param>
 /// <param name="emptySlotNumber">Set to a number higher than 1 to find the second, third, etc empty slot.</param>
 /// <returns>The first empty inventory slot scanning left to right then top to bottom. Returns null if inventory is full.</returns>
 public Point?FirstEmptySlot(bool safeTab = false, int emptySlotNumber = 1)
 {
     return(FirstColorMatchingSlot(RGBHSBRangeFactory.EmptyInventorySlot(), 0.99, safeTab, emptySlotNumber));
 }