SRL Archive - Help and Support

Commit please


Rich

2012-12-13 17:11:14

Got bored and thought I'd have a go at something I haven't done in a while, and ended up opening Simba.

Anyway, I'm having trouble with Git and it'd be appreciated if someone could push this for me.

(*
IsActionBarOpen
~~~~~~~~~~~~~~~

.. code-block:: pascal

function IsActionBarOpen(): Boolean;

Results True if the Action Bar is showing.

.. note::

by euphemism

*)
function IsActionBarOpen(): Boolean;
var
Color: Integer;
begin
Color := GetColor(45, 283);
Result := ((Color = 2697663) or (Color = 15790330) or (Color = 2763456));
end;

Above is just with an extra colour, as it wasn't working for me and that colour was present at the point.
Below are two new functions I decided to write for the funsies.

(*
DoActionBySlot
~~~~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function DoActionBySlot(Slot : Integer; Action : TStringArray) : Boolean;

Performs an action on the item in desired Action Bar slot.


.. note::

by Rich

Example:

.. code-block:: pascal

DoActionBySlot(2, ["Drop", "rop]);

*)

function DoActionBySlot(Slot : Integer; Action : TStringArray) : Boolean;
begin
ToggleActionBar(True);
if (not IsActionBarOpen) then
Exit;
MouseBox((47 + ((Slot - 1) * 36)), 297, (76 + ((Slot - 1) * 36)), 326, mouse_Move);
Result:= WaitUpTextMulti(Action, 350 + Random(250));
if Result then
ClickMouse2(mouse_Left)
else
begin
ClickMouse2(mouse_Right);
Result:= WaitOptionMulti(Action, 450 + Random(250));
end;
end;

(*
DoActionByDTM
~~~~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function DoActionByDTM(DTM : Integer; Action : TStringArray) : Boolean;

Performs an action on the DTM of desired item in desired Action Bar slot


.. note::

by Rich

Example:

.. code-block:: pascal

DoActionByDTM(WillowLogDTM, ["Drop", "rop]);

*)

function DoActionByDTM(DTM : Integer; Action : TStringArray) : Boolean;
var
X, Y : Integer;

begin
ToggleActionBar(True);
if ((not IsActionBarOpen) or (not FindDTM(DTM, X, Y, 40, 290, 480, 380))) then
Exit;
MMouse(X, Y, 10, 10);
Result:= WaitUpTextMulti(Action, 350 + Random(250));
if Result then
ClickMouse2(mouse_Left)
else
begin
ClickMouse2(mouse_Right);
Result:= WaitOptionMulti(Action, 450 + Random(250));
end;
end;

Cheers guys.
Toodles.