SRL Archive - SRL Archives

FindDraynorDoors by n3ss3s.


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…

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..

HellBoyz

2007-10-18 04:51:39

Cool, you can contribute and contribute non stop but IMO Tol 4 would be much better for some range of color (Based on SRL door profile)

n3ss3s

2007-10-18 05:13:23

-.- Currently the tol is 3, why do you want to make it 4? :p

I know my code

R0b0t1

2007-10-18 19:14:10

Could you explain to me how it parses out drop dots? I'm very interested…

n3ss3s

2007-10-19 02:57:50

This part

If(Not(GetArrayLength(TPA) >= 5))Then
Begin
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := TP;
End;

;) It actually doesnt parse out, it picks only the ones that arent drop dots, or you could say it parses out, up to you..