diff --git a/lib/interfaces/gametabs/backpack.simba b/lib/interfaces/gametabs/backpack.simba index 5d3f00d..be52768 100644 --- a/lib/interfaces/gametabs/backpack.simba +++ b/lib/interfaces/gametabs/backpack.simba @@ -647,7 +647,7 @@ Example: writeln('We moved the mouse to Backpack slot 1'); *) -function TRSTabBackpack.mouseSlot(slot, mouseAction: integer = MOUSE_MOVE): boolean; +function TRSTabBackpack.mouseSlot(slot: integer; mouseAction: integer = MOUSE_MOVE): boolean; begin if (not self.open()) or (not self.isSlotValid(slot)) then exit(false); @@ -656,6 +656,47 @@ begin mouseBox(self.getSlotBox(slot), mouseAction); end; +(* +mouseSlot +--------- + +.. code-block:: pascal + + function TRSTabBackpack.mouseSlot(slot, waitTime: integer; mouseAction: integer = MOUSE_MOVE; uptext: TStringArray): boolean; overload; + +Overload function, additional parameters **waitTime** and **upText**. +Returns true if it finds the correct **upText** at the desired backpack **slot**. +The **upText** parameter is a TStringArray, and uses both the text in top left +corner or the mouseOver popup, while the **waitTime** parameter is used to wait +after the **mouseAction** + +.. note:: + + - by Thomas + - Last Updated: 13 November 2016 by Thomas + +Example: + +.. code-block:: pascal + + if tabBackpack.mouseSlot(1, randomRange(100, 200), MOUSE_LEFT, ['Dragon bones', 'Big bones']) then + writeln('We clicked the bones in Backpack slot 1'); + +*) + +function TRSTabBackpack.mouseSlot(slot, waitTime: integer; mouseAction: integer = MOUSE_MOVE; upText: TStringArray): boolean; overload; +begin + if (not self.open()) or (not self.isSlotValid(slot)) then + exit(false); + + mouseBox(self.getSlotBox(slot), MOUSE_MOVE); + result := (isUpText(upText) or isMouseOverText(upText)); + + if result then + mouseBox(self.getSlotBox(slot), mouseAction); + wait(waitTime); +end; + (* isSlotActivated ---------------