Well the other function got moved to snippets so here's some of the others I was thinking of 
MouseDTM
Simba Code:
{ MouseDTM
~~~~~~~~~~~
.. code-block:: pascal
function MouseDTM(DTM: Integer; Text: TIntegerArray; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
Searches for the DTM within the area xs, ys, xe, ye.
If found, checks the uptext and performs the clicktype
.. note::
by abu_jwka
Example:
.. if MouseDTM(LogsDTM, ['orm', ogs'], x, y, MIX1, MIY1, MIX2, MIY2, True) then
ClickFire;
}
function MouseDTM(DTM: Integer; Text: TStringArray; var x, y: Integer; xs, ys, xe, ye: Integer; WhichClick: Variant): Boolean;
begin
if FindDTM(DTM, x, y, xs, ys, xe, ye) then
begin
GetMousePos(x, y);
if (Length(Text) > 0) then // if searching for uptext
begin
MMouse(x, y, 0, 0);
if WaitUptextMulti(Text, 2000) then
begin
ClickMouse2(WhichClick);
Wait(20 + Random(60));
Result := True;
Exit;
end;
end;
end;
end;
FindDTMMulti
Simba Code:
{ FindDTMMulti
~~~~~~~~~~~
.. code-block:: pascal
function FindDTMMulti: TIntegerArray; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
Searches for Multiple DTMs within the area xs, ys, xe, ye.
Results true if found, returns the x and y co-ordinates of the first found DTM
.. note::
by abu_jwka
Example:
.. if FindDTMMulti([OakDTM, WillowDTM], x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Logs not burned yet! Clicking Tinderbox');
MouseTBox(InvBox(1),1);
end;
}
function FindDTMMulti(DTMs: TIntegerArray; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
var
b: Integer;
begin
for b := 0 to High(DTMs) do
begin
if (FindDTM(DTMs[b], x, y, xs, ys, xe, ye)) then
begin
GetMousePos(x, y);
Result := True;
Exit;
end;
end;
end;
WaitFindDTMMulti
Simba Code:
{ WaitFindDTMMulti
~~~~~~~~~~~
.. code-block:: pascal
function WaitFindDTMMulti: TIntegerArray; var x, y: Integer; xs, ys, xe, ye, WaitPerLoop, Maxtime: Integer): Boolean;
Searches for Multiple DTMs within the area xs, ys, xe, ye every WaitPerLoop seconds
for a maximum time defined by MaxTime
Results true if found and returns the x and y co-ordinates of the first found DTM
.. note::
by abu_jwka
Example:
.. if WaitFindDTMMulti([Oak, Willow], x, y, MIX1, MIY1, MIX2, MIY2, 5000) then
begin
Writeln('Logs not burned yet! Clicking Tinderbox');
MouseTBox(InvBox(1),1);
end;
}
function WaitFindDTMMulti(DTMs: TIntegerArray; var x, y: Integer; xs, ys, xe, ye, WaitPerLoop, Maxtime: Integer): Boolean;
var
t: Integer;
begin
t := GetSystemTime + Maxtime;
while (GetSystemTime < t) do
begin
if FindMultiDTM(DTMs, x, y, xs, ys, xe, ye) then
begin
GetMousePos(x, y);
Result := True;
Exit;
end;
Wait(WaitPerLoop);
end;
end;
FindDTMsRotated
Simba Code:
(*
FindDTMsRotated
~~~~~~~~~~~
.. code-block:: pascal
function FindDTMsRotated(DTMs: TIntegerArray; var x, y: Integer;xs, ys, xe, ye: Integer;
sAngle, eAngle, aStep: Extended;
var aFound: Extended): Boolean;
Finds Multiple DTMs within the area xs, ys, xe, ye
Starts searching from the angle 'sAngle'
Stops searching once it reaches the angle 'eAngle'
It will rotate every 'aStep' angle from sAngle to eAngle
Results True if found and returns the x and y co-ordinates
.. note::
Author: abu_jwka
Example:
.. code-block:: pascal
if FindDTMsRotated([BankerDTM,CounterDTM], x, y, MSX1, MSX2, MSY1, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 0, 0, False);
WaitOption('ank', 200);
end;
*)
function FindDTMMultiRotated(DTMs: TIntegerArray; var x, y: Integer;xs, ys, xe, ye: Integer;
sAngle, eAngle, aStep: Extended;
var aFound: Extended): Boolean;
var
i: Integer;
begin
for i := 0 to High(DTMs) do
if FindDTMRotated(DTMs[i], x, y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound) then
begin
GetMousePos(x, y);
Result := True;
end;
end;