Results 1 to 8 of 8

Thread: The best method to check for location.

  1. #1
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default The best method to check for location.

    Hey guys, I'm new to this forum and have just started learning the basics to script with Simba. At the moment however I'm struggling to find any info on the best method to check that the player is in the correct location.

    The location I want to check for has a few non interactive objects like ferns which could be used to determine the location, as long as the compass and angle are set correctly. I'm sure its relatively easy to do this by checking for a bitmap in the relevant location, I'm just wondering if this is in fact the best way to do this check.

    Any feedback would be much appreciated, I'm looking forward to learning more

    Thanks,

    Willy Jenkins.

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There really is not "best" way when it comes to checking if you are at the good position or not, because it greatly depends that where you are.

    If the area you should be in(and you don't have to tell accurately where you are) has much of a certain color on the mm then just do a CountColor on the mm.

    DTMs, DDTMs, ObjectDTMs are all good for accurate position check if you do it right.

    You can also(it seems you are trying this?) use the main screen if the location has unique objects/colors in general there. Use TPAs in that case then you can do distance/length/whatever checks on them.

    There are a dozen more method which will be told by others(hopefully), but these are that comes to my mind right now.

    tl;dr: Be creative .
    Last edited by Sabzi; 01-09-2012 at 07:44 PM.

  3. #3
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for your reply Sabzi.

    I started looking at using DTMs, at first I decided to make a DTM of the main game screen however when I search for the DTM using FindDTM() it always returns false. I then tried making a DTM of the minimap which also just returns false everytime.

    I've followed a few tutorials, they seem to generally be for walking however, am I doing the right thing to just check the location and return true or false?

    if FindDTM(ChinAreaDTM, x, y, MMX1, MMY1, MMX2, MMY2) Then
    Result := True
    else
    Result := False;
    Thats the code I used to check for the DTM on the minimap.

    Cheers.

  4. #4
    Join Date
    Dec 2011
    Posts
    353
    Mentioned
    3 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by WillyJenkins View Post
    Thanks for your reply Sabzi.

    I started looking at using DTMs, at first I decided to make a DTM of the main game screen however when I search for the DTM using FindDTM() it always returns false. I then tried making a DTM of the minimap which also just returns false everytime.

    I've followed a few tutorials, they seem to generally be for walking however, am I doing the right thing to just check the location and return true or false?



    Thats the code I used to check for the DTM on the minimap.

    Cheers.
    U should use DTMRotated.

  5. #5
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NexPB View Post
    U should use DTMRotated.
    What he says.

    Reason: Your minimap(mm) is always rotating a bit randomly(thanks to jagex), so you have to use DTMRotated or FindDTMRotated so the same dtm will be searched at different angles.
    Making a good DTM is not that easy, but there are great tutorials about them.

  6. #6
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I actually did try rotated aswell, but it didnt work.

    However when I changed and used DDTM instead and put the tolerance up a bit, it seems to find it correctly, then return false when its not there. I'll use FindDTMRotated though, I didn't realise Jagex randomly rotates stuff, good to know!

    Also is there a general amount of rotation you would normally use? Would you make it check all 360 degrees of rotation, or just a few degrees either side of the current DTMs rotation?

    Thanks for the help guys.

  7. #7
    Join Date
    Dec 2011
    Posts
    353
    Mentioned
    3 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by WillyJenkins View Post
    I actually did try rotated aswell, but it didnt work.

    However when I changed and used DDTM instead and put the tolerance up a bit, it seems to find it correctly, then return false when its not there. I'll use FindDTMRotated though, I didn't realise Jagex randomly rotates stuff, good to know!

    Also is there a general amount of rotation you would normally use? Would you make it check all 360 degrees of rotation, or just a few degrees either side of the current DTMs rotation?

    Thanks for the help guys.
    If I'm not wrong DTMRotated will rotate until it found the dtm and FindDTMRotated will search in the angle you have given up.

  8. #8
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default

    Could you post a minimap pic of the area? I'm f2p only and unfamiliar with it :P. If there are any trees (alive or dead), ladders, or rocks or anything like that on the minimap you could definitely use objDTM, I use it for my location finding and relocation in my crafting guild miner.
    Example code:
    Simba Code:
    Procedure RelocateToCenter;
    begin
    if ObjDTMWalk('585:65:4:1:7:635:76:1:7:643:102:1:7:639:56:1:7:659:90', 0, 100, 80, True) then
        begin
          wait(500 + random(250));
          MakeCompass('n');
          WriteLn('location is now guild centre');
          RestUntil(RandomRange(90,100));
          //RestUp;
        end
      else
        begin
          WriteLn('could not relocate to centre');
          Terminator;
        end;
    end;

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
  •