n3ss3s
2007-10-18 04:30:56
I have no idea why would I want to find draynor doors, but someone has ;)
It works pretty much perfect, ignores drop dots etc…
I think the Tol 3 is enough, because when I first picked the color it was 244, logged out, tried again it was 243 - it doesnt change any radically so 3 tol is enough, though feel free to make it higher since it parses out drop dots anyways..
EDIT: Wtf, why would it have to be draynor only, just replace the 244 with FindTheTownDoorColor if you need to..
It works pretty much perfect, ignores drop dots etc…
Function FindDraynorDoors: TPointArray;
Var
TPAA: Array of TPointArray;
Var
TPA, SemiR: TPointArray;
Var
I, CTS: Integer;
Var
TP: TPoint;
Begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 244, MMX1, MMY1, MMX2, MMY2, 3);
TPAA := TPAToATPA(TPA, 4);
SetArrayLength(SemiR, GetArrayLength(TPAA));
For I := 0 To GetArrayLength(TPAA) - 1 Do
Begin
SemiR[i] := MiddleTPA(TPAA[i]);
End;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
For I := 0 To GetArrayLength(SemiR) - 1 Do
Begin
TP := SemiR[i];
FindColorsTolerance(TPA, 255, TP.x - 2, TP.y - 2, TP.x + 2, TP.y + 2, 20);
If(Not(GetArrayLength(TPA) >= 5))Then
Begin
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := TP;
End;
End;
ColorToleranceSpeed(CTS);
End;
I think the Tol 3 is enough, because when I first picked the color it was 244, logged out, tried again it was 243 - it doesnt change any radically so 3 tol is enough, though feel free to make it higher since it parses out drop dots anyways..
EDIT: Wtf, why would it have to be draynor only, just replace the 244 with FindTheTownDoorColor if you need to..