n3ss3s
2007-10-18 13:34:21
I apologise for all the object finders with the same template, but I had bday and I drank 1,5 litr of pommac, 1 litr of coke, ate 1/2 chocolate cake, 2 packets of cookies, and too much candy - in less than 24 hours which gives damn hyperactivity (King of Knives and Zeph know about the side effects I told them bout xD) - so if the threads pissed anyone of I can delete them all, but now this is my last object finder post and I promise not to make one atleast in 5 months, only update this one.
I made a general object finder called iSpyWithMyLittleEye.
ObjColors are couple colors from the obj for example "[blabla, lablab, ballab]"
ObjWidth and ObjHeight are the size of the object.
This finds all instances of the object on the screen, tested on cabbage field, trees, and the pinball random, I suggest not using on monsters because they move and then you would just get bunch of useless points.
Soooo -
@ Wizzy: RAaSTPA and ReArrangeandShortenArray have bugs, they dont do anything =/ had to use TPAToATPA and then MiddleTPA.
~thanks.
Sorry.
I made a general object finder called iSpyWithMyLittleEye.
iSpyWithMyLittleEye(ObjColors: TIntegerArray; ObjWidth, ObjHeight: Integer): TPointArray;ObjColors are couple colors from the obj for example "[blabla, lablab, ballab]"
ObjWidth and ObjHeight are the size of the object.
This finds all instances of the object on the screen, tested on cabbage field, trees, and the pinball random, I suggest not using on monsters because they move and then you would just get bunch of useless points.
Soooo -
Function iSpyWithMyLittleEye(ObjColors: TIntegerArray; ObjWidth, ObjHeight: Integer): TPointArray;
Var
TPAA: Array of TPointArray;
Var
CTS, I, C, D, T: Integer;
Var
TPA, TPA2: TPointArray;
Var
FinalTPA: TPointArray;
Var
TP: TPoint;
Var
TB: TBox;
Begin
T := GetSystemTime;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, ObjColors[0], 20, 20, MSX2 - 20, MSY2 - 20, 10);
TPAA := TPAToATPAEx(TPA, ObjWidth, ObjHeight);
SetArrayLength(TPA, Length(TPAA));
For I := 0 To GetArrayLength(TPAA) - 1 Do
Begin
TPA[i] := MiddleTPA(TPAA[i]);
End;
SetArrayLength(TPAA, 0);
If(Not(GetArrayLength(TPA) <= 0))Then
Begin
SetArrayLength(TPAA, GetArrayLength(ObjColors));
For I := 0 To GetArrayLength(TPA) - 1 Do
Begin
TP := TPA[i];
TB.x1 := TP.x - ObjWidth;
TB.y1 := TP.y - ObjHeight;
TB.x2 := TP.x + ObjWidth;
TB.y2 := TP.y + ObjHeight;
For C := 0 To GetArrayLength(ObjColors) - 1 Do
Begin
FindColorsTolerance(TPA2, ObjColors[c], TB.x1, TB.y1, TB.x2, TB.y2, 10);
TPAA[c] := CombineTPA(TPA2, TPAA[c]);
End;
For D := 0 To GetArrayLength(TPAA) - 1 Do
Begin
FinalTPA := CombineTPA(FinalTPA, TPAA[d]);
End;
End;
Result := ReArrangeandShortenArrayEx(FinalTPA, ObjWidth, ObjHeight);
End;
Writeln(IntToStr(GetSystemTime - T));
ColorToleranceSpeed(CTS);
End;
@ Wizzy: RAaSTPA and ReArrangeandShortenArray have bugs, they dont do anything =/ had to use TPAToATPA and then MiddleTPA.
~thanks.
Sorry.