PDA

View Full Version : LoveAdvancedObjectFinder



Killerdou
07-18-2007, 08:58 AM
This is my object finder, it is pretty advanced.
There are only 2 parameters however, 1 a integer array which contains all the
colors you want it to search for(1 is alright aswell) and the second is a string which contains all the different options you want to use separated by a comma and the last one has a semicolon.
the following commands are available atm:

Settings
dev - prints time it took to find the objects and saves/shows a picture of here it found different groups.
huemod/satmod(e.g. huemod:0.2,) - sets hue or satmod to given value
tol (e.g. tol:10,) - sets tolerance to given value
maxdistance (e.g. maxdistance:10,) - how far away a point can be from the group to still belong to it
AccA/AccB( e.g. AccA:10,) - accurecy, shouldnt really be used unless you find objects that are like 25% of the main screen, AccA will exclude all points that are within the range you specify and AccB will only include every x point, so AccB:10, would only include every tenth point.

Remove
RemoveDensity( e.g. RemoveDensity<0.5,) - this 'draws' a box around the outer points of a group and returns how much of that box is a found point(so if you have a box of 10 pixels and 5 pixels of that were found it would have a density of 0.5) you can use both < and > to specify what you want to remove
RemoveDistance( e.g. RemoveDistance>10,) - does the same as density but then with distance from the middle of the screen
RemoveAmount( e.g. RemoveAmount<10) does the same as density and distance but checks for the size of a group

Rearrange
You can rearrange the array of groups to distance,size,density both from small to large after what you want to rearrange you put true for large to small and false for small to large so DensityTrue would mean rearrange the array from large to small density, this is important in the next step where it will check all the groups(in order) for uptext

TheClicking
you can use clickleft and clickright, both will check all groups for the given uptext(it will click what you specified once it found one with the correct uptext obviously) e.g. ClickRight:mine would move its mouse to the middle of all groups and check for the uptext mine, if that uptext is found it will right click


A good example of a string would be:
'dev,RemoveAmount>100,DistanceTrue,ClickLeft:chop;'



{.include SRL/SRL.scar}
var
MyColorArray : Array of Integer;
AI, BI, Color, TheBitMap: integer;



// from mastaraymond
Function TPointArrayToIntegerArray(ThePoints:TPointArray;Re turnX:Boolean): TIntegerArray;
var
I:integer;
begin;
Try
SetArrayLength(Result,Length(ThePoints));
For I:= 0 to Length(ThePoints)-1 do
If ReturnX then Result[i]:=ThePoints[i].x
else Result[i]:=ThePoints[i].y;
Except
Writeln('There is an error, sorry!');
end;
end;


Function Density(A : TPointArray) : Extended;
var
B, C : Array of Integer;
D, E : Integer;
Begin
B := TPointArrayToIntegerArray(A, True);
C := TPointArrayToIntegerArray(A, False);
BubbleSort(B);
BubbleSort(C);
D := GetArrayLength(A);
E := (B[D - 1] - B[0] + 1)*(C[D - 1] - C[0] + 1)
Result := 1 / (E / D);
end;

Function RemoveSmallDensityGroups(A :TPointArrayArray; WhatDensity: Extended) : TPointArrayArray;
var
RV, I: Integer;
begin
RV := 0;
For I := 0 To Length(A) - 1 do
Begin
If Density(A[i]) > WhatDensity then
begin
RV := RV + 1;
SetLength(Result, RV);
Result[RV - 1] := A[i];
end;
end;
end;

Function RemoveBigDensityGroups(A : TPointArrayArray; WhatDensity: extended) : TPointArrayArray;
var
RV, I: Integer;
begin
RV := 0;
For I := 0 To Length(A) - 1 do
Begin
If Density(A[i]) < WhatDensity then
begin
RV := RV + 1;
SetLength(Result, RV);
Result[RV - 1] := A[i];
end;
end;
end;


Function WhatIsDistance(a :TPointArray) : integer;
var
X, Y : integer;
begin
FindMiddle(X, Y, A);
Result := Distance(X, Y, 259, 144);
end;

//rearrange procedures thanks to wizzup
Procedure SwapA(var a, b :TPointArray);

Var
c: TPointArray;
Begin
c := a;
a := b;
b := c;
End;


Procedure RearrangeArrayByDensity(var a: Array Of TPointArray; Small: Boolean);

Var
B: Boolean;
I: Integer;
L: extended;
Begin
B := True;
L := GetArrayLength(a);
While B Do
Begin
B := False;
For I := 0 To L - 2 Do
If Small Then
Begin
If Density(a[i]) > Density(a[i+1]) then
Begin
SwapA(a[i], a[i + 1]);
B := True;
End
End
Else
Begin
If Density(a[i]) < Density(a[i+1]) then
Begin
SwapA(a[i], a[i + 1]);
B := True;
End
End;
End;
End;

Procedure RearrangeArrayByDistance(var a: Array Of TPointArray; Small: Boolean);

Var
B: Boolean;
L, I: Integer;
Begin
B := True;
L := GetArrayLength(a);
While B Do
Begin
B := False;
For I := 0 To L - 2 Do
If Small Then
Begin
If WhatIsDistance(a[i]) > WhatIsDistance(a[i+1]) then
Begin
SwapA(a[i], a[i + 1]);
B := True;
End
End
Else
Begin
If WhatIsDistance(a[i]) < WhatIsDistance(a[i+1]) then
Begin
SwapA(a[i], a[i + 1]);
B := True;
End
End;
End;
End;

Procedure RearrangeArrayByLength(var a: Array Of TPointArray; Small: Boolean);

Var
B: Boolean;
L, I: Integer;

Begin
B := True;
L := GetArrayLength(a);
While B Do
Begin
B := False;
For I := 0 To L - 2 Do
If Small Then
Begin
If GetArrayLength(a[i]) > GetArrayLength(a[i+1]) then
Begin
SwapA(a[i], a[i + 1]);
B := True;
End
End
Else
Begin
If GetArrayLength(a[i]) < GetArrayLength(a[i+1]) then
Begin
SwapA(a[i], a[i + 1]);
B := True;
End
End;
End;
End;

Function Checkall(A : TPointArrayArray; UpText: String; Left : boolean) : boolean;
var
I, X, Y : integer;
begin
For I := 0 to Length(A) - 1 do
begin
FindMiddle(X, Y, A[i]);
MMouse(X, Y, 0, 0);
Wait(50 + Random(25));
If IsUpText(UpText) then
begin
Mouse(X, Y, 0, 0, Left);
Result := True;
Exit;
end;
end;
end;

Function LoveObjectFinder(Colors : Array of Integer; Sort : String) : Boolean;
Var
Dev : Boolean;
I, A,Tol, MaxDist, AccA, AccB, TempI, ColorMarker, FindGroupsMarker: Integer;
HueMod, SatMod : extended;
SplittedText : Array of String;
FoundPoints, FoundPoints2 : TPointArray;
TwoDArrayOfTPoints: array of TPointArray;
Begin
HueMod := 0.2;
SatMod := 0.2;
Tol := 15;
MaxDist := 5;
AccA := 0;
AccB := 1;
SplittedText := SplitText(Sort);
For I := 0 to GetArrayLength(SplittedText) - 1 do
Case LowerCase(GetLetters(SplittedText[i])) of
'huemod' : HueMod := StrToInt(GetNumbers(SplittedText[i])) div IntPow(10,Length(GetNumbers(SplittedText[i])) - 1);
'satmod' : SatMod := StrToInt(GetNumbers(SplittedText[i])) div IntPow(10,Length(GetNumbers(SplittedText[i])) - 1);
'tol' : Tol := StrToInt(GetNumbers(SplittedText[i]));
'maxdist' : MaxDist := StrToInt(GetNumbers(SplittedText[i]));
'acca' : AccA := StrToInt(GetNumbers(SplittedText[i]));
'accb' : AccB := StrToInt(GetNumbers(SplittedText[i]));
'dev' : Dev := True;
end;
If AccA > MaxDist then
begin
TempI := AccA;
AccA := MaxDist;
MaxDist := TempI;
end;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(HueMod, SatMod);
If dev then TheBitmap := BitMapFromString(MSX2 - MSX1, MSY2 - MSY1, '');
If dev then CopyClientToBitmap(TheBitMap, MSX1, MSY1, MSX2, MSY2);
if dev then ColorMarker:= GetTimeRunning;
For A := 0 to GetArrayLength(Colors) - 1 do
begin
FindColorsSpiralTolerance(259, 144, FoundPoints2, Colors[A], MSX1, MSY1, MSX2, MSY2, Tol);
AddTPointArray(FoundPoints, FoundPoints2);
end;
if dev then WriteLn('Colorfinding took: ' + IntToStr(GetTimeRunning - ColorMarker) + 'ms.');
if dev then FindGroupsMarker := GetTimeRunning;
TwoDArrayOfTPoints := FindGroups(FoundPoints, MaxDist, AccA, AccB);
if dev then WriteLn('FindGroups took: ' + IntToStr(GetTimeRunning - FindGroupsMarker) + 'ms.');
If GetArrayLength(TwoDArrayOfTPoints) = 0 then Exit;
For I := 0 to GetArrayLength(SplittedText) - 1 do
begin
If LowerCase(GetLetters(SplittedText[i])) = 'removedensity' then
Begin
If Copy(SplittedText[i], 14, 1) = '<' then
TwoDArrayOfTPoints := RemoveSmallDensityGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])) div IntPow(10,Length(GetNumbers(SplittedText[i])) - 1));
If Copy(SplittedText[i], 14, 1) = '>' then
TwoDArrayOfTPoints := RemoveBigDensityGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])) div IntPow(10,Length(GetNumbers(SplittedText[i])) - 1));
end;
If LowerCase(GetLetters(SplittedText[i])) = 'removeamount' then
Begin
If Copy(SplittedText[i], 13, 1) = '<' then
TwoDArrayOfTPoints := RemoveSmallPointGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])));
If Copy(SplittedText[i], 13, 1) = '>' then
TwoDArrayOfTPoints := RemoveBigPointGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])));
end;
If LowerCase(GetLetters(SplittedText[i])) = 'removedistance' then
Begin
If Copy(SplittedText[i], 15, 1) = '<' then
TwoDArrayOfTPoints := RemoveLowerDistancePointGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])));
If Copy(SplittedText[i], 15, 1) = '>' then
TwoDArrayOfTPoints := RemoveHigherDistancePointGroups(TwoDArrayOfTPoints , StrToInt(GetNumbers(SplittedText[i])));
end;
Case LowerCase(SplittedText[i]) of
'lengthtrue' : RearrangeArrayByLength(TwoDArrayOfTPoints,True);
'distancetrue' : ReArrangeArrayByDistance(TwoDArrayOfTPoints,True);
'densitytrue' : ReArrangeArrayByDensity(TwoDArrayOfTPoints,True);
'lengthfalse' : RearrangeArrayByLength(TwoDArrayOfTPoints,False);
'distancefalse' : ReArrangeArrayByDistance(TwoDArrayOfTPoints,False) ;
'densityfalse' : ReArrangeArrayByDensity(TwoDArrayOfTPoints,False);
end;
end;
For I := 0 to GetArrayLength(SplittedText) - 1 do
begin
If LowerCase(Copy(SplittedText[i], 1, 9)) = 'clickleft' then
begin
Delete(SplittedText[i], 1, 9);
Result := CheckAll(TwoDArrayOfTPoints, LowerCase(GetLetters(SplittedText[i])), True);
end;
If LowerCase(Copy(SplittedText[i], 1, 10)) = 'clickright' then
begin
Delete(SplittedText[i], 1, 10);
Result := CheckAll(TwoDArrayOfTPoints, LowerCase(GetLetters(SplittedText[i])), False);
end;
end;
Result := True;
If dev then
Begin
For AI := 0 To GetArrayLength(TwoDArrayOfTPoints) - 1 do
begin
Color := Round((16581375/GetArrayLength(TwoDArrayOfTPoints)) * (AI + 1));
For BI := 0 to GetArrayLength(TwoDArrayOfTPoints[AI]) - 1 do
FastSetPixel(TheBitMap, TwoDArrayOfTPoints[AI][BI].x - MSX1, TwoDArrayOfTPoints[AI][BI].y - MSY1, Color);
end;
SaveBitmap(TheBitmap, 'c:\TheBitmap.bmp');
DisplayDebugImgWindow(MSX2 - MSX1, MSY2 - MSY1);
SafeDrawBitmap(TheBitmap, GetDebugCanvas, 0, 0);
end;
end;

begin
ActivateClient;
Wait(1000);
SetArrayLength(MyColorArray, 1);
MyColorArray[0] := 1977645;
LoveObjectFinder(MyColorArray, 'dev,ClickRight:ine;');
end.

Rikje
07-18-2007, 09:11 AM
Looks realy nice! ;)

offtopic: gratz on 500 post.

Killerdou
07-18-2007, 10:12 AM
no one else interrested in this stuff?

Ron
07-18-2007, 11:10 AM
Nice functions man! But dude, this needs formatting! Fixed...


// functions by iloveit8
// formatted by Ron

{.include SRL/SRL.scar}

var
MyColorArray : Array of Integer;

procedure FindMiddle(var X, Y : integer; A : Array of Tpoint);
var
I, n : integer;
begin
X := 0;
Y := 0;
for I := 0 to GetArrayLength(A) - 1 do
begin
X := A[i].X + X;
Y := A[i].Y + Y;
end;
X := Round(X / GetArrayLength(A));
Y := Round(Y / GetArrayLength(A));
end;

function ClosestGroup(A : Array of Array of TPoint) : Array of TPoint;
var
B, I, X, Y : Integer;
begin
FindMiddle(X, Y, A[0]);
B := Distance(X, Y, 259, 144);
for I := 1 to GetArrayLength(A) - 1 do
if (Abs(X - 259) < B) and (Abs(Y - 144) < B) then
begin
FindMiddle(X, Y, A[i]);
B := Distance(X, Y, 259, 144);
Result := A[i];
end;
end;

function FurthestGroup(A : Array of Array of TPoint) : Array of TPoint;
var
B, I, X, Y : Integer;
begin
B := 0;
for I := 0 to GetArrayLength(A) - 1 do
if (Abs(X - 259) > B) and (Abs(Y - 144) > B) then
begin
FindMiddle(X, Y, A[i]);
B := Distance(X, Y, 259, 144);
Result := A[i];
end;
end;

function RemoveLowerDistancePointGroups(A : Array of Array of TPoint; Distance: integer) : Array Of Array Of TPoint;
var
RV, I, X, Y: Integer;
begin
RV := 0;
for I := 0 To GetArrayLength(A) do
begin
FindMiddle(X, Y, A[i]);
if (Abs(X - 259) > Distance) and (Abs(Y - 144) > Distance) then
begin
RV := RV + 1;
SetArrayLength(Result, RV);
Result[RV - 1] := A[i];
end;
end;
end;

function RemoveHigherDistancePointGroups(A : Array of Array of TPoint; Distance: integer) : Array Of Array Of TPoint;
var
RV, I, X, Y: Integer;
begin
RV := 0;
for I := 0 To GetArrayLength(A) do
begin
FindMiddle(X, Y, A[i]);
if (Abs(X - 259) < Distance) and (Abs(Y - 144) < Distance) then
begin
RV := RV + 1;
SetArrayLength(Result, RV);
Result[RV - 1] := A[i];
end;
end;
end;

function SplitText(A : String) : Array of String;
var
LastLetter, I : Integer;
begin
LastLetter := 1;
SetArrayLength(Result, 0);
for I := 1 to Length(A) do
if (A[i] = ',') or (A[i] = ';') then
begin
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := Copy(A, LastLetter, I - LastLetter);
LastLetter := I + 1;
end;
end;

procedure ClickGroup(A : Array of TPoint; Left : boolean);
var
X, Y: integer;
begin
FindMiddle(X, Y, A);
Mouse(X, Y, 2, 2, Left);
end;

function BiggestGroup(A : Array of Array of TPoint) : Array of TPoint;
var
B, I : Integer;
begin
B := 0
for I := 0 to GetArrayLength(A) - 1 do
if GetArrayLength(A[i]) > B then
begin
B := GetArrayLength(A[i]);
Result := A[i];
end;
end;

function SmallestGroup(A : Array of Array of TPoint) : Array of TPoint;
var
B, I : Integer;
begin
B := GetArrayLength(A[0]);
for I := 1 to GetArrayLength(A) - 1 do
if GetArrayLength(A[i]) < B then
begin
B := GetArrayLength(A[i]);
Result := A[i];
end;
end;

function RemoveBigPointGroups(A : Array of Array of TPoint; HowBig : integer): Array of Array of TPoint;
var
RV, I : Integer;
begin
RV := 0;
for I := 0 to GetArrayLength(A) - 1 do
if GetArrayLength(A[i]) <= HowBig then
begin
RV := RV + 1;
SetArrayLength(Result, RV);
Result[RV - 1] := A[i];
end;
end;

function RemoveSmallPointGroups(A : Array of Array of TPoint; HowSmall : integer): Array of Array of TPoint;
var
RV, I : Integer;
begin
RV := 0;
for I := 0 to GetArrayLength(A) - 1 do
if GetArrayLength(A[i]) >= HowSmall then
begin
RV := RV + 1;
SetArrayLength(Result, RV);
Result[RV - 1] := A[i];
end;
end;

procedure AddTPointArray(var Array1 : Array Of TPoint; Array2 : array of TPoint );
var
I, I2 : Integer;
begin
I2 := GetArrayLength(Array1);
SetArrayLength(Array1, GetArrayLength(Array1) + GetArrayLength(Array2));
if GetArrayLength(Array2) <> 0 then
for I := 0 to GetArrayLength(Array2) - 1 do
Array1[I + I2] := Array2[i];
end;

function IsWithinRangeTPointArray(A : array of TPoint; ALength: integer; D : Integer; B: TPoint) : boolean;
var
I : integer;
begin
for I := ALength - 1 downto 0 do
if (Abs(B.x - A[i].x) <= D) And (Abs(B.y - A[i].y) <= D) then //Wizzup? ty:)
begin
Result := True;
exit;
end;
end;

function IsTPointInArray(A : Array of TPoint; B : TPoint; ALength : integer): Boolean;
var
I : integer;
begin
for I := 0 To ALength - 1 do
if (A[i].X = B.X) and (A[i].Y = B.Y) then
begin
Result := True;
Exit;
end;
end;

function SubstractTPointArray(var ALength : integer; A, B: Array of TPoint; BLength: integer) : Array of TPoint;//A - B
var
I, Resultvariable : Integer;
begin
Resultvariable := 0;
SetArrayLength(Result, 0);
for I := 0 To ALength - 1 do
if Not IsTPointInArray(B, A[i], BLength) then
begin
Resultvariable := Resultvariable + 1;
SetArrayLength(Result, Resultvariable);
Result[Resultvariable - 1] := A[i];
end;
ALength := Resultvariable;
end;

procedure SpeedItUpWithAccuracy(var A : Array Of TPoint; Acc, Acc2: integer);
var
Tempvariable, I : integer;
Temp: Array of TPoint;
begin
Tempvariable := 0;
SetArrayLength(Temp, 0);
for I := 0 to GetArrayLength(A) - 1 do
if I mod Acc2 = 0 then
if not IsWithinRangeTPointArray(Temp, Tempvariable, Acc, A[i]) then
begin
Tempvariable := Tempvariable + 1;
SetArrayLength(Temp, Tempvariable);
Temp[Tempvariable - 1] := A[i];
end;
A := Temp;
end;

function FindGroups(WhichPoints : Array Of TPoint; MaxDistance, Accuracy, Accuracy2 : Integer) : Array of Array of TPoint;
var
I, Resultvariable, TempResultvariable, WhichPointsvariable: Integer;
begin
SetArrayLength(Result, 0);
Resultvariable := 0;
SpeedItUpWithAccuracy(WhichPoints, Accuracy, Accuracy2);
if GetArrayLength(WhichPoints) = 0 then exit;
repeat
WhichPointsvariable := GetArrayLength(WhichPoints);
Resultvariable := Resultvariable + 1;
SetArrayLength(Result, Resultvariable);
TempResultvariable := 1;
SetArrayLength(Result[Resultvariable - 1], 1);
Result[Resultvariable - 1][0] := WhichPoints[0];
for I := 1 to WhichPointsvariable - 1 do
begin
if IsWithinRangeTPointArray(Result[Resultvariable - 1], TempResultvariable, MaxDistance, WhichPoints[i]) then
begin
TempResultvariable := TempResultvariable + 1;
SetArrayLength(Result[Resultvariable - 1], TempResultvariable);
Result[Resultvariable - 1][TempResultvariable - 1] := WhichPoints[i];
end;
end;
WhichPoints := SubstractTPointArray(WhichPointsvariable, WhichPoints, Result[Resultvariable - 1], TempResultvariable);
until(GetArrayLength(WhichPoints) = 0);
end;

function LoveObjectFinder(Colors : Array of Integer; Sort : String) : Boolean;
var
WWC, WWC2, Dev : Boolean;
I, A,Tol, MaxDist, AccA, AccB, TempI, ColorMarker, FindGroupsMarker : Integer;
HueMod, SatMod : extended;
SplittedText : Array of String;
FoundPoints, FoundPoints2 ,FinalGroup : array of TPoint;
TwoDArrayOfTPoints: array of array of TPoint;
begin
HueMod := 0.2;
SatMod := 0.2;
Tol := 10;
MaxDist := 10;
AccA := 5;
AccB := 50;
SplittedText := SplitText(Sort);
for I := 0 To GetArrayLength(SplittedText) - 1 do
if (LowerCase(GetLetters(SplittedText[i])) = 'biggest') or (LowerCase(GetLetters(SplittedText[i])) = 'smallest') or (LowerCase(GetLetters(SplittedText[i])) = 'closest') or (LowerCase(GetLetters(SplittedText[i])) = 'furthest') then
WWC := True;
if not WWC then
Exit;
for I := 0 To GetArrayLength(SplittedText) - 1 do
if (LowerCase(GetLetters(SplittedText[i])) = 'clickleft') or (LowerCase(GetLetters(SplittedText[i])) = 'clickright') then
WWC2 := True;
if not WWC2 then
Exit;
for I := 0 to GetArrayLength(SplittedText) - 1 do
Case LowerCase(GetLetters(SplittedText[i])) of
'huemod' : HueMod := StrToInt(GetNumbers(SplittedText[i])) div IntPow(10,Length(GetNumbers(SplittedText[i])) - 1);
'satmod' : SatMod := StrToInt(GetNumbers(SplittedText[i])) div IntPow(10,Length(GetNumbers(SplittedText[i])) - 1);
'tol' : Tol := StrToInt(GetNumbers(SplittedText[i]));
'maxdist' : MaxDist := StrToInt(GetNumbers(SplittedText[i]));
'acca' : AccA := StrToInt(GetNumbers(SplittedText[i]));
'accb' : AccB := StrToInt(GetNumbers(SplittedText[i]));
'dev' : Dev := True;
end;
if AccA > MaxDist then
begin
TempI := AccA;
AccA := MaxDist;
MaxDist := TempI;
end;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(HueMod, SatMod);
if dev then
CopyClientToBitmap(TheBitMap, MSX1, MSY1, MSX2, MSY2);
if dev then
ColorMarker:= GetTimeRunning;
for A := 0 to GetArrayLength(Colors) - 1 do
begin
FindColorsSpiralTolerance(259, 144, FoundPoints2, Colors[A], MSX1, MSY1, MSX2, MSY2, 15);
AddTPointArray(FoundPoints, FoundPoints2);
end;
if dev then
WriteLn('Colorfinding took: ' + IntToStr(GetTimeRunning - ColorMarker) + 'ms.');
if dev then
FindGroupsMarker := GetTimeRunning;
TwoDArrayOfTPoints := FindGroups(FoundPoints, MaxDist, AccA, AccB);
if dev then
WriteLn('FindGroups took: ' + IntToStr(GetTimeRunning - FindGroupsMarker) + 'ms.');
if GetArrayLength(TwoDArrayOfTPoints) = 0 then
Exit;
for I := 0 to GetArrayLength(SplittedText) - 1 do
begin
if GetArrayLength(TwoDArrayOfTPoints) = 0 then
Exit;
if GetArrayLength(FinalGroup) = 0 then
Exit;
if LowerCase(GetLetters(SplittedText[i])) = 'removeamount' then
begin
if GetOthers(SplittedText[i]) = '<' then
RemoveSmallPointGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])));
if GetOthers(SplittedText[i]) = '>' then
RemoveBigPointGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])));
end;
if LowerCase(GetLetters(SplittedText[i])) = 'removedistance' then
begin
if GetOthers(SplittedText[i]) = '<' then
RemoveLowerDistancePointGroups(TwoDArrayOfTPoints, StrToInt(GetNumbers(SplittedText[i])));
if GetOthers(SplittedText[i]) = '>' then
RemoveHigherDistancePointGroups(TwoDArrayOfTPoints , StrToInt(GetNumbers(SplittedText[i])));
end;
Case LowerCase(SplittedText[i]) of
'biggest' : FinalGroup := BiggestGroup(TwoDArrayOfTPoints);
'smallest' : FinalGroup := SmallestGroup(TwoDArrayOfTPoints);
'closest' : FinalGroup := ClosestGroup(TwoDArrayOfTPoints);
'furthest' : FinalGroup := FurthestGroup(TwoDArrayOfTPoints);
'clickleft' : ClickGroup(FinalGroup, True);
'clickright' : ClickGroup(FinalGroup, False);
end;
end;
Result := True;
if dev then
begin
for AI := 0 To GetArrayLength(TwoDArrayOfTPoints) - 1 do
begin
Color := Round((16581375/GetArrayLength(TwoDArrayOfTPoints)) * (I + 1));
for BI := 0 to GetArrayLength(TwoDArrayOfTPoints[AI]) - 1 do
FastSetPixel(TheBitMap, TwoDArrayOfTPoints[AI][BI].x - MSX1, TwoDArrayOfTPoints[AI][BI].y - MSY1, Color);
end;
SaveBitMap(TheBitMap,'C:/TheBitMap.bmp');
end;
end;

begin
ActivateClient;
Wait(1000);
SetArrayLength(MyColorArray, 4);
MyColorArray[0] := 0;
MyColorArray[1] := 0;
MyColorArray[2] := 0;
MyColorArray[3] := 0;
LoveObjectFinder(MyColorArray, 'HueMod:0.2,SatMod:0.2,Tol:2,MaxDist:10,AccA:9,Acc B:10,RemoveAmount<3,Biggest,ClickRight;');
end.


~Ron :)

Killerdou
07-18-2007, 11:24 AM
thanks dude:)

rkroxpunk
07-18-2007, 02:04 PM
looking nice ;) gratz on 500 :D

Killerdou
07-18-2007, 03:49 PM
has anyone tried using it yet?, ive tried it with furnace(advicable to put accb at 500 or something like that), trees and with new/old rocks

n3ss3s
07-18-2007, 04:13 PM
Uhber leet scar ;D But I dont kinda know what to/how to use them?

Killerdou
07-18-2007, 04:41 PM
if i find some time ill write a tut on it, in the mean time ill explain it on msn^^ paul.spiering@euronet.nl

SKy Scripter
07-19-2007, 07:42 PM
This looks really nice :), good job ;)...

WhiteShadow
07-19-2007, 09:41 PM
Find Middle, looks exactly like the last lines of Wizzup's mining function.

He's the only one that I've seen that uses average coord, instead of midpoint.

Sorry if you didn't. <3 They look great. :)

Pyro
07-19-2007, 11:17 PM
Find Middle, looks exactly like the last lines of Wizzup's mining function.

He's the only one that I've seen that uses average coord, instead of midpoint.

Sorry if you didn't. <3 They look great. :)

Lies lots of people use it :p look at my find portal things that i posted. Just cause i was bored. I was using them when me and kane (remmeber him :p) were making a air crafter together. Averages are just the way of the future.

Mind you interquartile average is much much better. Which at a quick glance you did here?

SKy Scripter
07-20-2007, 06:38 AM
Find Middle, looks exactly like the last lines of Wizzup's mining function.

He's the only one that I've seen that uses average coord, instead of midpoint.

Sorry if you didn't. <3 They look great. :)

yeah lol i have used that so much.... but now i order them for least to greatest and then get the middle...

Killerdou
07-20-2007, 07:18 AM
i changed most stuff and it is speedy now, check it out;)

the scar noob
07-23-2007, 02:14 PM
looks great but is confusing ;)

Killerdou
07-23-2007, 02:39 PM
MyColorArray[0] := 3487034;
LoveObjectFinder(MyColorArray,'AccA:1,dev,Distance True,RemoveAmount<1000,ClickRight:urnace;');

this finds the furnace:)

Stevee
07-27-2007, 01:47 AM
lol, that kinda clears it up alot =/

Killerdou
09-07-2007, 05:24 PM
ok, updated some stuff, now you know how to us it:)

pwnaz0r
09-07-2007, 09:37 PM
nice, i like the idea of adding things and seperating by commas;

Infantry001
09-08-2007, 10:08 PM
Wow thats really cool! I think most people (including me :P) would need a tut on how to use it, though.

Wizzup?
09-09-2007, 02:21 PM
yeah lol i have used that so much.... but now i order them for least to greatest and then get the middle...

I think it's a bit slower though, SCAR can handle alot of math's quickly.
Since you have those colors, why not just use all? :)

BTW: You don't need round() Ron/iloveit8...

marzey
12-03-2007, 01:54 PM
Have you made a tut yet ? wouldnt mind using it in my scripts with credit ofcourse.

Sir R. M8gic1an
12-21-2007, 05:29 PM
i just saw the picture you posted in tara's smart color thread, it looked amazing! waiting for a tut too, it is sort of confusing :p

~RM