Results 1 to 20 of 20

Thread: Making sure you are in the correct area

  1. #1
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Making sure you are in the correct area

    Is there a way to make sure you are in the correct area, e.g. an area of tree's, and if you arent, move back to the correct area?
    Footy
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    You could use objDTM's, as well as custom TPA's func's. +DDTMs
    Last edited by Le Jingle; 08-06-2012 at 09:43 PM.

  3. #3
    Join Date
    Jul 2012
    Location
    System 32
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Most people use Object DTMs to check if they are in a specified area. A thread on installing it can be found here.

    Alternatively, you could make a simple DTM of a portion on the minimap that will be visible at the location and have it check to see if the rotated DTM exists. Rotated, because likely, the compass won't be set to a perfect north at all times, especially after a 'movecompass' antiban.
    Without chaos... There would be no organization.

  4. #4
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Easiest way would be to use SPS_GetMyPos, and it's much easier to walk back with SPS too.

  5. #5
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Get a box using SPS Points, if SPS_GetMyPos isn't in that box, walk back

  6. #6
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Yes SPS_GetMyPos + PointInBox would work nice. But there might be a "better" way, post a screenshot of it.

  7. #7
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I made and used this in my wildy agi script.

    Simba Code:
    Function InsideArea(x1, y1, x2, y2: Integer): Boolean;
    var
      P: TPoint;
      Box: TBox;
    begin
      P := SPS_GetMyPos;
      Box := IntToBox(x1, y1, x2, y2);
      if PointInBox(P, Box) then
      begin
        Result := True;
      end;
    end;

  8. #8
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for all the replies guys! Im probably going to try this SPS method. Gonna play around with it for a bit, and Ill let you guys know how it goes.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  9. #9
    Join Date
    Jul 2012
    Location
    System 32
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Best of luck.

    Just something to add; I find lodestones to be very useful when walking back to an area. Especially in a case where a failed random event has teleported you away. Of course, this would be irrelevent if the account has not unlocked the specified lodestone.
    Without chaos... There would be no organization.

  10. #10
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Something to add, lets say My character finds himself out the top left section of this area I need him to be in. What if the first SPS point I need him to walk to isnt visable, what will he do? I could do a ring tele, as that would be most relevent in this situation, but It would seem kind of botty if everytime i wander out of the area, I use my ring.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  11. #11
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    post a screenshot of it.
    SPS will not work properly from time to time depending on the circumstances (eg. minimap flooded with players + monsters etc). And when that happens, your script will literally die. SPS will return point (-1, -1). Your script will say "oh, we are not in the box!" so your clever failsafe will try walking back. But you are already there; so SPS will return (-1, -1) over and over again every single time you call your procedure.

    E: Just tell us the circumstances. What are you trying to script? +screenshot.
    Last edited by Nebula; 08-06-2012 at 11:12 PM.

  12. #12
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I assume you mean the area I will be in? its the area around daemonheim containing maple trees in f2p. My account is fletching atm, i can post a screeny of minimap and world map in a few minutes
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  13. #13
    Join Date
    Jul 2012
    Location
    System 32
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Footy View Post
    Something to add, lets say My character finds himself out the top left section of this area I need him to be in. What if the first SPS point I need him to walk to isnt visable, what will he do? I could do a ring tele, as that would be most relevent in this situation, but It would seem kind of botty if everytime i wander out of the area, I use my ring.
    I would say use something along the lines of a simple radial or linear walk, if the distance of SPS_GetMyPos is less than 50 x and y from the first point until it sees that point.

    I haven't looked much into SPS, but a good alternative would be to add a few fail safes to make sure the script doesn't make you wonder too far off track.
    Without chaos... There would be no organization.

  14. #14
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    If you use SPS_BlindWalk you can walk to points not visable on the minimap (it will click multiple times)

  15. #15
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, ill just have to get it to check if its nearing the edge of the area, and If so, move closer to the centre. Im testing out some SPS stuff, never used it before. Im trying to get simba to output my SPS position, thats all, just to see what the format of it is, but I keep getting errors, 3 different errors so far. Can someone tell me why this wont work?
    Simba Code:
    program SPSTesting;
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    begin
      SetupSRL
      sps_getmypos;
    end.

    E:
    Quote Originally Posted by putonajonny View Post
    If you use SPS_BlindWalk you can walk to points not visable on the minimap (it will click multiple times)
    This could be helpful!
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  16. #16
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    You need to call SPS_Setup and writeln(SPS_GetMyPos). Check out mat's SPS tutorial.

    Post the screenshots......

  17. #17
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would post the screenies, but I dont have a sufficient dung. level to get into the resorce dungeon... Ill look up mats SPS guide, thanks!
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  18. #18
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    procedure getmyposition;
    var
      P: TPoint;
    begin
      P := SPS_GetMyPos;
      writeln('Point'+ToStr(P));
    end;

    I used this to check my position, and repeat it in the main loop. Of course you will need to setup SPS first before repeating the loop. And just need to disable and enable SMART to walk to another point. You would just need to copy and paste the TPoints from the debug since it has 'Point' in front of the coordinates already.

  19. #19
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by CephaXz View Post
    Simba Code:
    procedure getmyposition;
    var
      P: TPoint;
    begin
      P := SPS_GetMyPos;
      writeln('Point'+ToStr(P));
    end;

    I used this to check my position, and repeat it in the main loop. Of course you will need to setup SPS first before repeating the loop. And just need to disable and enable SMART to walk to another point. You would just need to copy and paste the TPoints from the debug since it has 'Point' in front of the coordinates already.
    This is useful! Thanks for the help guys! I think i figured it all out, everything seems to be working!
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  20. #20
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    My miner uses DTM's on the minimap to determine if it is at a designated area. Works better than ODTM when there are lots of signs moving around(2 mining icons in my case)
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

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
  •