Results 1 to 7 of 7

Thread: DoorOpen - Door open on MM?

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default DoorOpen - Door open on MM?

    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.

    SCAR Code:
    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;

  2. #2
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    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?



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  3. #3
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    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)

  4. #4
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    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.

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

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

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

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Maybe they are showing default positions?

  7. #7
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Check if door is open
    By itSchRis917 in forum OSR Help
    Replies: 10
    Last Post: 05-26-2008, 04:15 AM
  2. find door and open
    By plaxlord in forum OSR Help
    Replies: 1
    Last Post: 03-28-2008, 04:39 AM
  3. Door check/open
    By Boreas in forum OSR Help
    Replies: 14
    Last Post: 11-25-2006, 11:30 PM
  4. how to open a door only if its closed?
    By XcanadamanX in forum OSR Help
    Replies: 9
    Last Post: 11-10-2006, 11:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •