SRL Archive - SRL Archives

DoorOpen - Door open on MM?


n3ss3s

2007-11-24 04:07:00

Thanks to Wizzy and everyone else who helped me with ArcTan etc.

Some doors on minimap show it if they are open, some don't.

Anyways, I made a function to check if the ones that show if open, are open.


DoorMid X and Y - Coords of the doors end on MM

VerticalHorizontal - If you are dealing with a door that's line on MM is vertical, True, Else, False.


Function DoorOpen(DoorMidX, DoorMidY: Integer; VerticalHorizontal: Boolean): Boolean;
Var
TPA: TPointArray;
C, X, Y, Dx, Dy, Sx, Sy: Integer;
A2: Extended;
Slope: TPoint;
//* Thanks to Wizzy and everybody else for teaching about ArcTan =)
//* Credits to Wizzy for the 90 - (A2 * -1)...
Begin
C := GetColor(DoorMidX, DoorMidY);
X := DoorMidX;
Y := DoorMidY;
FindColorsSpiralTolerance(X, Y, TPA, C, X - 4, Y - 4, X + 4, Y + 4, 5);
Dx := TPA[High(TPA)].x;
Dy := TPA[High(TPA)].y;
FindColorsSpiralTolerance(DX, DY, TPA, C, X - 4, Y - 4, X + 4, Y + 4, 5);
Sx := TPA[High(TPA)].x;
Sy := TPA[High(TPA)].y;
Slope.x := iAbs(Dx - Sx);
Slope.y := iAbs(Dy - Sy);
A2 := Degrees(ArcTan2(Slope.x, Slope.y));
Writeln(FloatToStr(A2));
If A2 < 0 Then
A2 := A2 + 360;
Case VerticalHorizontal Of
True: Result := InRange(Round(A2), 85, 95);
False: Result := (Round(A2) = 0);
End;
End;

Wizzup?

2007-11-24 05:27:26

If A2 < 0 Then
A2 := 90 - (A2 * -1) + 270;

Can also be
If A2 < 0 Then
A2 := A2 + 360;

I never knew that the doors could be open or closed on the minimap? Is that a new update?

n3ss3s

2007-11-24 05:30:33

I noticed it about a month ago, though not all doors show it, but its nothing static that which doors show open and which don't.

Thanks for the tip, changing it :)

Hey now I know, I have this strange feeling that the doors that were open when you logged in show that if they are open or not, because I opened couple doors and they didn't change on MM and they were closed when I logged in, but one door was open when I logged in, when I closed it, it stayed open on MM.

EDIT: Hey, people who see this can you also go check my UpdateIn? I'd appreciate all tips and improvements. (Updated it so that it doesn't need user input Tol)

ZephyrsFury

2007-11-24 05:35:00

The MM lines don't change depending on if the door is open or not. I tried something like this before but it didn't work.

n3ss3s

2007-11-24 06:39:39

Okay, so this works, but there isn't anything it would work on? :p

I guess we'll just have to check ms for open/closed doors :(

Boreas

2007-11-24 08:33:26

Maybe they are showing default positions?

n3ss3s

2007-11-24 08:49:05

Good thinking, but why would some doors' default position be open and some's closed? Closed would be some more logic answer IMO…