Results 1 to 9 of 9

Thread: DTM doens't work properly

  1. #1
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default DTM doens't work properly

    Ok situation is kinda "mysterious".

    I use two dtms gold ore and gold bar
    Simba Code:
    procedure SetDTM;//DTM Defining procedure.
    begin
      goldOre := DTMFromString('mWAAAAHicY2FgYJjBxMDQB8SzgHgxEAcyMjAEAbEHEHsD8eZ+KYZEPzOGTb2SDJkh1gz8QD3ImBENgwAA4fkIew==');
      goldBar := DTMFromString('mbQAAAHicY2VgYJjPxMCwBIgXA/FsIF4FxAqMDAzyQKwCxKpArAjEC+rFGC4tlwXjSHcehhur5Rj4gfrRMSMWDAYA8jMK5w==');
    end;  

    procedure ReleaseDTM; //DTM Freeing procedure.
    begin
      FreeDTM(goldOre);
      FreeDTM(goldBar);
    end;


    Ok so here is the problem if i use ORE DTM it deposit to bank properly, if I use BAR DTM it do not find it.
    Simba Code:
    Procedure barsFromInventoryToBank;
    var
    x, y: integer;
    Begin
    SetDTM; //Declares dtms
     If (FindDTM(goldBar, x, y, MIX1, MIY1, MIX2, MIY2)) Then  // Ms is the cords of the main screen
        begin
          mouse(x,y,5,5, false);
          WaitOption('t-All', 500);
          Writeln('did banking.');
        end;
    ReleaseDTM; //frees dtms
    end;

    Mysterious part.
    if I use bar or ore work great. in function take from bank
    Simba Code:
    Procedure takeFromBAnk;
    var
    x, y: integer;
    Begin
    SetDTM;
     If (FindDTM(goldOre, x, y, MSX1, MSY1, MSX2, MSY2)) Then  // Ms is the cords of the main screen
        begin
          mouse(x,y,5,5, false);
          WaitOption('w-All', 500);
          Writeln('Taking some ores');
        end;
    ReleaseDTM;
    end;

  2. #2
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    try declaring your variables locally.

  3. #3
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Kasi View Post
    try declaring your variables locally.
    tried, doesn't work as well
    EDIT: PRobably tolerance of middle point of DTM was to low, because after re login it works fine.

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

    Default

    Yeah you have to make sure every point has an appropriate tolerance. I personally prefer bitmap (deformed) over DTM when it comes to inventory objects because any slight distortion of the obj (although that doesn't seem to happen anymore) will fail the DTM. Personal preference though, we have uber DTM fans who find DTM an absolute all-in-one solution to everything too (but i'd say TPA beats it in most cases )

    Also a better practice is to load only the DTM that you will be using in that procedure and not all of them, to prevent unnecessary memory hog and also allows you to declare the DTM locally.

    Also you should fix the standard (i believe i gave you the link on another post), it's something very simple to learn and will be good to master them right at the start.

    Simba Code:
    procedure BarsFromInventoryToBank; //camel case
    var
      x, y, goldBarDTM: Integer; //localized dtm
    begin   //dont need cap for bold words
      goldBarDTM:= DTMFromString(blabla);  //2 space after begin

      if (FindDTM(goldBarDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then  // Ms is the cords of the main screen
      begin  //'begin' dont need a space after 'if'
        mouse(x,y,5,5, false);
        WaitOption('t-All', 500);  //maybe do an if check?
        Writeln('did banking.');
       end;

       FreeDTM(goldBarDTM); //frees dtms
    end;
    Fix them for you but do take note of them in the future. Also post your qns in the correct section next time http://villavu.com/forum/forumdisplay.php?f=70

  5. #5
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Fix them for you but do take note of them in the future. Also post your qns in the correct section next time http://villavu.com/forum/forumdisplay.php?f=70
    Sorry and thank you.

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

    Default

    Quote Originally Posted by Laimonas171 View Post
    tried, doesn't work as well
    EDIT: PRobably tolerance of middle point of DTM was to low, because after re login it works fine.
    If the inventory image gets distorted, bitmaps will get affected just as much as DTMs

    You have two options with DTMs to make them work well:
    a) Give mild tolerance(~25) to any points inside the black outline, and avoid picking outline points on the upper left(if using for bank/stacked item)
    b) Give a tolerance of 255 to the midpoint and pick a ton of points in the border, again avoiding upper left side if needed. Picking 20 or so points at "unique" points in the border should make it very accurate.
    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

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

    Default

    Quote Originally Posted by litoris View Post
    If the inventory image gets distorted, bitmaps will get affected just as much as DTMs

    You have two options with DTMs to make them work well:
    a) Give mild tolerance(~25) to any points inside the black outline, and avoid picking outline points on the upper left(if using for bank/stacked item)
    b) Give a tolerance of 255 to the midpoint and pick a ton of points in the border, again avoiding upper left side if needed. Picking 20 or so points at "unique" points in the border should make it very accurate.
    Nope, in advanced bitmap searching methods, you can check for % deformed, which i usually have it accepting if the accuracy is higher than 50%. (but that should be adjusted depending on the size of bitmap and the potency of similar obj) Whereas for DTM, even a single point mismatch returns false, i've read somewhere that the devs are developing a % match DTM functions though.

    Again, it's up to personal preference, but usually most ppl just stick to the one they first learnt, which i wouldn't encourage as only when you learn both you will know when to apply them in different situations (eg. DTM will be more suitable for walking with the implanted DTM rotation functions)

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

    Default

    Quote Originally Posted by riwu View Post
    Nope, in advanced bitmap searching methods, you can check for % deformed, which i usually have it accepting if the accuracy is higher than 50%. (but that should be adjusted depending on the size of bitmap and the potency of similar obj) Whereas for DTM, even a single point mismatch returns false, i've read somewhere that the devs are developing a % match DTM functions though.

    Again, it's up to personal preference, but usually most ppl just stick to the one they first learnt, which i wouldn't encourage as only when you learn both you will know when to apply them in different situations (eg. DTM will be more suitable for walking with the implanted DTM rotation functions)
    You can do a percent match function yourself with DDTMs. You search for the whole DTM at first, and if it returns false, you search for the whole DTM minus one of the subpoints, and go further until you get a match. You could stop at 3 subpoints left so that you don't get mismatches etc.
    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

  9. #9
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    You're going to need to declare the DTM's as integers and try using less points and play with the tolerance, seems like you used a lot of points
    Current Project: Retired

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
  •