Results 1 to 9 of 9

Thread: Checking Location

  1. #1
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default Checking Location

    I want to check if I am at the bank, what is the best way to check I am within a reasonable distance of a bank? 07Scape btw.

    Can I filter the FindSymbol function from the MiniMap Main Points and the set it to return true if it is within a certain distance? If so, how do I do this?

  2. #2
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Do you mean find the nearest booth?

  3. #3
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by RJJ95 View Post
    Do you mean find the nearest booth?
    No, just check that I am within a certain distance of the bank symbol before trying to bank.

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by SRLKing View Post
    No, just check that I am within a certain distance of the bank symbol before trying to bank.
    Oh I guess you could use the distance formula to get the distance between your white square (always (643, 83)) and the dtm of the bank



    Then only bank if you are within that certain area

    So find the distance between 643,83 and find the bank DTM and store in 2 variables and use



    EDIT:

    @

    I came up with this:

    Simba Code:
    {$i srl/srl.simba}
    Var
      MSX,MSY,X1,X2,Y1,Y2,Dist_To_Symbol:Integer;
      DTM_Bank,X,Y:Integer;
    Procedure FreeMem;
    Begin
      FreeDTM(DTM_Bank);
    End;
    Procedure LoadDTM;
    Begin
      DTM_Bank := DTMFromString('mQwAAAHicY2ZgYEhgYmBIAeJwIE4D8jOBOBmI31xMYGBmFAVjfiAfhhmRMBAAANchBNY=');
    End;
    Procedure GetMMDistance;
    Begin
      X1 := X
      Y1 := Y
      X2 := 643
      Y2 := 83
      //Dist_To_Symbol := Sqr((((X2)-(X1))*((X2)-(X1))) + (((Y2)-(Y1))*((Y2)-(Y1))));
      Dist_To_Symbol := Distance(X1,Y1,X2,Y2);
      ClearDebug;
      Writeln('Current Distance from symbol:' + ToStr(Dist_To_Symbol))
      Wait(300);
    End;
    Procedure GetDTM;
    Begin
      if FindDTM(DTM_Bank, x, y, 524, 3, 762, 168)  Then
      Begin
        Writeln('Got Bank DTM')
      End;
    End;


    Begin
      Repeat
      LoadDTM;
      GetDTM;
      GetMMDistance;
      Until False;
      AddOnTerminate('FreeMem');
    End.

    Edit it out to use built in distance works great

  5. #5
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Simba Code:
    function closeTobank: boolean;
    begin
      p := findSymbol('bank');
      result := distance(mmcx, mmcy, p.x, p.y) < 20;
    end;

    something like that?

  6. #6
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Quote Originally Posted by RJJ95 View Post
    Oh I guess you could use the distance formula to get the distance between your white square (always (643, 83)) and the dtm of the bank



    Then only bank if you are within that certain area

    So find the distance between 643,83 and find the bank DTM and store in 2 variables and use



    EDIT:

    @

    I came up with this:

    Simba Code:
    {$i srl/srl.simba}
    Var
      MSX,MSY,X1,X2,Y1,Y2,Dist_To_Symbol:Integer;
      DTM_Bank,X,Y:Integer;
    Procedure FreeMem;
    Begin
      FreeDTM(DTM_Bank);
    End;
    Procedure LoadDTM;
    Begin
      DTM_Bank := DTMFromString('mQwAAAHicY2ZgYEhgYmBIAeJwIE4D8jOBOBmI31xMYGBmFAVjfiAfhhmRMBAAANchBNY=');
    End;
    Procedure GetMMDistance;
    Begin
      X1 := X
      Y1 := Y
      X2 := 643
      Y2 := 83
      //Dist_To_Symbol := Sqr((((X2)-(X1))*((X2)-(X1))) + (((Y2)-(Y1))*((Y2)-(Y1))));
      Dist_To_Symbol := Distance(X1,Y1,X2,Y2);
      ClearDebug;
      Writeln('Current Distance from symbol:' + ToStr(Dist_To_Symbol))
      Wait(300);
    End;
    Procedure GetDTM;
    Begin
      if FindDTM(DTM_Bank, x, y, 524, 3, 762, 168)  Then
      Begin
        Writeln('Got Bank DTM')
      End;
    End;


    Begin
      Repeat
      LoadDTM;
      GetDTM;
      GetMMDistance;
      Until False;
      AddOnTerminate('FreeMem');
    End.

    Edit it out to use built in distance works great

    I like that! Mind if I play around with it? Will credit of course if used.
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  7. #7
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Element17 View Post
    I like that! Mind if I play around with it? Will credit of course if used.
    Sure I guess so i'm having fun with it myself might consider it for walking maybe

    Could use something like If Distance_To_Symbol >= 20 Then
    blah blah blah

  8. #8
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Kinda what I was thinking! Haha.
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  9. #9
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    I like them both, Rjj, work on that! It looks really cool! and olly that is exactly what I was looking for<3

Thread Information

Users Browsing this Thread

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

Posting Permissions

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