Simba Code:
(*
find all the points that contains any of the given colors.
it returns all the points as a single array of TPoint (TPointArray).
*)
function FindColorsTolEx(var TPA:TPointArray; Colors:TIntegerArray; Bounds:TBox; Tol:Int32): Boolean;
var
i:Int32;
TMP:TPointArray;
begin
for i:=0 to High(Colors) do
begin
FindColorsTolerance(TMP, Colors[i], Bounds.x1, Bounds.y1, Bounds.x2, Bounds.y2, Tol);
TPA := CombineTPA(TPA,TMP);
end;
Result := Length(TPA) <> 0;
end;
(*
Tries to find a man, and then move the mouse that man.
If it's successful it will return "True".
*)
function MouseOverMan(): Boolean;
var
TPA,TMP:TPointArray;
ATPA:T2DPointArray;
i,size:Int32;
B:TBox;
begin
SetColorToleranceSpeed(2);
FindColorsTolEx(TPA, [5588036,4741960], TBox([25,25,500,300]), 30);
SetColorToleranceSpeed(1);
ATPA := SplitTPA(TPA,5);
SortATPAFromMidPoint(ATPA, Point(264,179));
for i:=0 to High(ATPA) do
begin
B := GetTPABounds(ATPA[i]);
size := Max(B.x2-B.x1+1, B.y2-B.y1+1);
if not(InRange(size, 20, 50)) then
Continue;
MouseBox(B, MOUSE_MOVE);
Wait(Random(60,130));
if waitUptext('Man', 600) then
Exit(True);
end;
end;
Simba Code:
begin
//we repeat the following actions for all eternity (for now..)
repeat
if MouseOverMan() then //if found a man, and is hovering him..:
FastClick(mouse_Left); //attacked him by doing a single click.
//now at this point you'd wanna check if you are still in a fight, and wait until its over
//once it's over you have to look for a clue-scroll on the ground, this may get tricky, but
//can be done with a similar function to "MouseOverMan", except only search a small area around you.
//temporary i'll just add a 2-4 second Wait, and HOPE that you are done fighting, hehe :P
Wait(Random(2000,4000));
until False;
end;