Results 1 to 14 of 14

Thread: having ddtm issues

  1. #1
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default having ddtm issues

    ok it compiles, and sets the compass, but it just cant find the dtm, any reason why? i looked at YoHoJo's tut on ddtms.
    SCAR Code:
    program DDTMLearnt;
    {.include SRL/SRL.scar}

    var x, y, DirtDTM: Integer;
        DirtMP: TDTMPointDef;
        DirtSP: array[0..3] of TDTMPointDef;
        DirtDTMSkel: TDTM;
        DDTMTol, DDTMArea: Integer;

    procedure Load;
    begin
         DDTMTol:=40;
         DDTMArea:=1;

         DirtMP.x:=597;
         DirtMP.y:=79;
         DirtMP.areasize:=1;
         DirtMP.areashape:=0;
         DirtMP.color:=2383202;
         DirtMP.tolerance:=3;
         
         DirtSP[0].x:=630;
         DirtSP[0].y:=78;
         DirtSP[0].areasize:=DDTMArea;
         DirtSP[0].areashape:=0;
         DirtSP[0].color:=2315614;
         DirtSP[0].tolerance:=DDTMTol;
         
         DirtSP[1].x:=626;
         DirtSP[1].y:=78;
         DirtSP[1].areasize:=DDTMArea;
         DirtSP[1].areashape:=0;
         DirtSP[1].color:=1337192;
         DirtSP[1].tolerance:=DDTMTol;
         
         DirtSP[2].x:=622;
         DirtSP[2].y:=74;
         DirtSP[2].areasize:=DDTMArea;
         DirtSP[2].areashape:=0;
         DirtSP[2].color:=2196093;
         DirtSP[2].tolerance:=DDTMTol;
         
         DirtSP[3].x:=624;
         DirtSP[3].y:=74;
         DirtSP[3].areasize:=DDTMArea;
         DirtSP[3].areashape:=0;
         DirtSP[3].color:=1723009 ;
         DirtSP[3].tolerance:=DDTMTol;
         
         DirtDTMSkel.MainPoint:=DirtMP;
         DirtDTMSkel.SubPoints:=DirtSP;
         DirtDTM:=AddDTM(DirtDTMSkel);
    end;

    procedure FindIt;
    begin
      MakeCompass('s');
      if DTMRotated(DirtDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
        Mouse(x, y, 2, 2, true);
        WriteLn('Yay it worked');
      end;
      WriteLn('It didnt work');
    end;

    begin
      SetupSRL;
      Load;
      FindIt;
    end.

  2. #2
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    try putting you mainpoint tolerance at 255. i always do that i read it in a tut somewhere, i think WT-fakawi's tut but either way 3 is a really low tolerance

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  3. #3
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    and also what is the point of using the DDTM when you arent including autocolor functions as the colors of some of your points... ie: roadcolor, rockcolor, watercolor ect.

    You should also make a for to do loop with increasing tolerance for your DTM...

    Like:

    SCAR Code:
    for DDTMTol := 0 to 5 do
      if(DTMRotated(DirtDTM,x,y,mmx1,mmy1,mmx2,mmy2))then
        Mouse(x,y,3,3,True);
    METAL HEAD FOR LIFE!!!

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    It is a generally good idea to increase the tolerance, but not needed (especially if it's just a first draft DDTM).
    I'm sure the function is 'FindDTMRotated' though, not just 'DTMRotated', but that could just be me.
    Also, try taking a print screen of the map then make the DDTM for that and test it on that picture. If it all works, then try transfering it to your script.

  5. #5
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok, thanks guys, I got it to actually find the dtm now, man, i tell you what, this does seem alot more reliable then any other walking function.

  6. #6
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol... i spoke too soon. I'm having a problem with the ddtm clicking completly different objects on the other side of the mm, why is it doing that?

    this is what i got for my ddtm:

    SCAR Code:
    program TreeSwitching;
    {.include SRL/SRL.scar}

    var wx, wy, tx, ty, cx, cy: Integer;
        x, y, DirtDTM: Integer;
        DirtMP: TDTMPointDef;
        DirtSP: array[0..3] of TDTMPointDef;
        DirtDTMSkel: TDTM;
        DDTMTol, DDTMArea: Integer;
       
    procedure LoadDDTMs;
    begin
         DDTMTol:=60;
         DDTMArea:=1;

         DirtMP.x:=597;
         DirtMP.y:=79;
         DirtMP.areasize:=1;
         DirtMP.areashape:=0;
         DirtMP.color:=2196070;
         DirtMP.tolerance:=255;

         DirtSP[0].x:=626;
         DirtSP[0].y:=78;
         DirtSP[0].areasize:=DDTMArea;
         DirtSP[0].areashape:=0;
         DirtSP[0].color:=2315614;
         DirtSP[0].tolerance:=DDTMTol;

         DirtSP[1].x:=624;
         DirtSP[1].y:=78;
         DirtSP[1].areasize:=DDTMArea;
         DirtSP[1].areashape:=0;
         DirtSP[1].color:=1337192;
         DirtSP[1].tolerance:=DDTMTol;

         DirtSP[2].x:=622;
         DirtSP[2].y:=74;
         DirtSP[2].areasize:=DDTMArea;
         DirtSP[2].areashape:=0;
         DirtSP[2].color:=2196093;
         DirtSP[2].tolerance:=DDTMTol;

         DirtSP[3].x:=624;
         DirtSP[3].y:=74;
         DirtSP[3].areasize:=DDTMArea;
         DirtSP[3].areashape:=0;
         DirtSP[3].color:=1723009 ;
         DirtSP[3].tolerance:=DDTMTol;

         DirtDTMSkel.MainPoint:=DirtMP;
         DirtDTMSkel.SubPoints:=DirtSP;
         DirtDTM:=AddDTM(DirtDTMSkel);
    end;

    procedure FindIt;
    begin
      MakeCompass('E');
     // SetRun(true);
      for DDTMTol := 0 to 5 do
       begin
       if (DTMRotated(DirtDTM, x, y, mmx1, mmy1, mmx2, mmy2)) then
        Mouse(x, y, 3, 3, true);
        Exit;
        WriteLn('Yay it worked');
      end;
      WriteLn('It didnt work');
    end;

    procedure SwitchTrees;
    var
    LC: Integer;
    begin
      if (not(LoggedIn)) then
      Exit;
      LC :=FindLadderColor;
      begin
        MakeCompass('E');
        SetRun(true);
        WriteLn('switching trees');
        RadialRoadWalk(LC, 25, 60, 60, -1, 1);
        WriteLn('Walking to rocks');
        repeat
        Wait(1350);
        FindIt;
        WriteLn('looking for craft symbol');
        Until FindSymbol(wx, wy, 'spin');
        Mouse(wx, wy, 2, 2, true);
        Wait(1000);
        MakeCompass('N');
        repeat
        RadialRoadWalk(LC, 0, 20, 60, -1, 1);
        Wait(5000+random(50));
        WriteLn('looking for tree symbol');
        FindSymbol(tx, ty, 'tree')
        Mouse(tx, ty, 2, 2, true);
        WriteLn('at next tree');
        Until FindObjCustom(cx, cy, ['Magic', 'agic', 'agi'],[1385251, 1780264, 3098949], 3)
      end;
    end;

    begin
     SetupSRL;
     LoadDDTMs;
     SwitchTrees;
    end.

  7. #7
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Most likely cause it recognises the dtm there, try to make your ddtm using subpoints that are original.

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Lol it took me 5 montsh to grasp DDTM's even now i have trouble with then

  9. #9
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I got them in like an hour

  10. #10
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    They didn't work for me that what i meant. Until i found neilsies DDtm editor

  11. #11
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Psychor View Post
    Most likely cause it recognises the dtm there, try to make your ddtm using subpoints that are original.
    when you say original, what do you mean?

  12. #12
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Illkillutill View Post
    when you say original, what do you mean?
    Something unique for that ddtm, for example in my nature runecrafter i use ddtm walking to get through the forest, there are no real visual marking, only thing i could use are the trees. But at some point there is a ladder visal on the minimap, so using that one, as there is only one spot that has that color, makes it original and it shouldn't be found anywhere else.
    Lke gerauchert said, try using an autocoloring, it will make your ddtm finding alot more stable

  13. #13
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaq View Post
    They didn't work for me that what i meant. Until i found neilsies DDtm editor
    ohhhh I made my first two without it

  14. #14
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaq View Post
    Lol it took me 5 montsh to grasp DDTM's even now i have trouble with then
    Why? They're easy. The only reason it could cause problems is because the tuts declare them differently.
    Ex.array[0..2]
    array[0..3]
    for a DDTM containing three subpoints =/
    Active only during the Summer...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. If there is a DDTM....
    By Claymore in forum OSR Help
    Replies: 6
    Last Post: 07-07-2008, 03:43 AM
  2. DDTM help
    By [S]paz in forum OSR Help
    Replies: 12
    Last Post: 02-16-2008, 06:18 PM
  3. Hmm DTM issues
    By yorkshireknight in forum OSR Help
    Replies: 7
    Last Post: 03-02-2007, 02:11 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
  •