Results 1 to 13 of 13

Thread: DDTM help

  1. #1
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default DDTM help

    Ok i cant understand why this DDTM doesnt work....
    stand in draynor bank and its meant to walk to the trees (willows) but it doesnt find the DDTm why?

    SCAR Code:
    function FindTree: Integer;
    var
      TreeMp: TDTMPointDef;
      TreeSp: Array [0..3] of TDTMPointDef;
      TreeDDTMSkel: TDTM;
    begin
      TreeArea := 0;
      TreeTol := 0;
     
      TreeMp.x := 742;
      TreeMp.y := 299;
      TreeMp.AreaSize := 1;
      TreeMp.AreaShape := 0;
      TreeMp.Color := 2394228;
      TreeMp.Tolerance := 225;

      TreeSp[0].x := 742;
      TreeSp[0].y := 299;
      TreeSp[0].AreaSize := 1;
      TreeSp[0].AreaShape := 0;
      TreeSp[0].Color := 2394228;
      TreeSp[0].Tolerance := 225;

      TreeSp[1].x := 754;
      TreeSp[1].y := 299;
      TreeSp[1].AreaSize := TreeArea;
      TreeSp[1].AreaShape := 0;
      TreeSp[1].Color := 6380376;
      TreeSp[1].Tolerance := TreeTol;

      TreeSp[2].x := 735;
      TreeSp[2].y := 291;
      TreeSp[2].AreaSize := TreeArea;
      TreeSp[2].AreaShape := 0;
      TreeSp[2].Color := 2057009;
      TreeSp[2].Tolerance := TreeTol;

      TreeSp[3].x := 731;
      TreeSp[3].y := 306;
      TreeSp[3].AreaSize := TreeArea;
      TreeSp[3].AreaShape := 0;
      TreeSp[3].Color := 932154;
      TreeSp[3].Tolerance := TreeTol;

      TreeDDTMSkel.MainPoint := TreeMp;
      TreeDDTMSkel.SubPoints := TreeSp;
      TreeDDTM := AddDTM(TreeDDTMSkel);
    end;

    then for finding the ddtm i have
    SCAR Code:
    Procedure toWillows;
    var
      Rx, Ry : Integer;
      FoundItGain : Boolean;
    begin
      FindTree;
      for I := 1 to 10 do
      begin
        TreeTol := TreeTol+5;
        TreeArea:= TreeArea+10;
      If FindDTM(TreeDDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        getmousepos(rx, ry);
        Writeln('yay found the DDTM lets go');
        Mouse(rx, ry, 0, 0, True);
        FoundItGain := True;

    but it never finds it what am i doing wrong?

    ~Spaz

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Use bigger areasize, like 3, get the right colour, they change everytime.
    And use DTMRotated instead of FindDTM.
    I made a new script, check it out!.

  3. #3
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Tried and failed, used area of 3 (+10) and dtmrotated and still didnt find it, just "hung" and logged out

    ~Spaz

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

    Default

    Course i don't see the whole script, but from what you posted, you load the DDTM and then you adjust the areasize and tolerance, you have to do that before you load it in the memory.

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

    Default

    SCAR Code:
    Procedure toWillows;
    var
      Rx, Ry : Integer;
      FoundItGain : Boolean;
    begin
      FindTree;
      for I := 1 to 10 do
      begin
        TreeTol := TreeTol+5;
        TreeArea:= TreeArea+10;
      If FindDTM(TreeDDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        getmousepos(rx, ry);
        Writeln('yay found the DDTM lets go');
        Mouse(rx, ry, 0, 0, True);
        FoundItGain := True;

    Do you even use "I" for anything in that for to do loop? That might be your prob?
    METAL HEAD FOR LIFE!!!

  6. #6
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Psychor is correct.

    In your loop, it says:
    SCAR Code:
    Procedure toWillows;
    var
      Rx, Ry : Integer;
      FoundItGain : Boolean;
    begin
      FindTree; //loads ddtm to memory
      for I := 1 to 10 do
      begin
        TreeTol := TreeTol+5; //changes tol
        TreeArea:= TreeArea+10; //changes area
      If FindDTM(TreeDDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        getmousepos(rx, ry);
        Writeln('yay found the DDTM lets go');
        Mouse(rx, ry, 0, 0, True);
        FoundItGain := True;
    You never reload the DDTM so it just adds to the tolerance and areasize and does nothing.
    Also what you do if you found the DDTM doesn't make sense. If you find it, get where the mouse is now and click there? You'd just click wherever your mouse was when you found the DDTM.

    I would write it like this:

    SCAR Code:
    procedure DDTM;
    var
      x, y, i, DDTM : Integer;
    begin
      FindTree;
      if not DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
      begin
        for i := 1 to 10 do
        begin
          FreeDTM(TreeDDTM);
          TreeTol := TreeTol + 5;
          TreeArea := TreeArea + 5;
          FindTree;
          if DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then Break;
        end;
      end;
      Writeln('Found TreeDDTM with a tolerance of ' + IntToStr(TreeTol) + ' and an area of ' + IntToStr(TreeArea) + '.');
      Mouse(x, y, 2, 2, true);
    end;
    I think that'll work. I've never used a DDTM like that since mine have always used colors that are autocolorable.
    Temporarily inactive.

  7. #7
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OMG!!! im retarded.... everything was fine but i used MSX1 insted of MMX1...
    hence why it never found it LOL

    but i tired your thingducels and its faster than my original pocedure so thanks for that and to everyone that helped

    ~Spaz

  8. #8
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok sorry for double post but now it finds it but does nothing...
    SCAR Code:
    function FindTree: Integer;
    var
      TreeMp: TDTMPointDef;
      TreeSp: Array [0..3] of TDTMPointDef;
      TreeDDTMSkel: TDTM;
    begin
      TreeArea := 3;
      TreeTol := 5;
     
      TreeMp.x := 742;
      TreeMp.y := 299;
      TreeMp.AreaSize := 1;
      TreeMp.AreaShape := 0;
      TreeMp.Color := 2394228;
      TreeMp.Tolerance := 225;

      TreeSp[0].x := 742;
      TreeSp[0].y := 299;
      TreeSp[0].AreaSize := 1;
      TreeSp[0].AreaShape := 0;
      TreeSp[0].Color := 2394228;
      TreeSp[0].Tolerance := 225;

      TreeSp[1].x := 754;
      TreeSp[1].y := 299;
      TreeSp[1].AreaSize := TreeArea;
      TreeSp[1].AreaShape := 0;
      TreeSp[1].Color := 6380376;
      TreeSp[1].Tolerance := TreeTol;

      TreeSp[2].x := 735;
      TreeSp[2].y := 291;
      TreeSp[2].AreaSize := TreeArea;
      TreeSp[2].AreaShape := 0;
      TreeSp[2].Color := 2057009;
      TreeSp[2].Tolerance := TreeTol;

      TreeSp[3].x := 731;
      TreeSp[3].y := 306;
      TreeSp[3].AreaSize := TreeArea;
      TreeSp[3].AreaShape := 0;
      TreeSp[3].Color := 932154;
      TreeSp[3].Tolerance := TreeTol;

      TreeDDTMSkel.MainPoint := TreeMp;
      TreeDDTMSkel.SubPoints := TreeSp;
      TreeDDTM := AddDTM(TreeDDTMSkel);
    end;



    Procedure toWillows;
    var
      looking : Integer;
      FoundItGain : Boolean;
    begin
      MarkTime(looking);
      begin
        FindTree;
        if DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
        MMouse(x, y, 1, 1);
        Writeln('Yay found DDTM');
        Mouse(x, y, 1, 1, True);
        FoundItGain := True;
      end else
      begin
        If FindDTM(WillowMM, x, y, MMX1, MMY1, MMX2, MMY2) then
        MMouse(x, y, 1, 1);
        Writeln('Found MM DTM');
        Mouse(x, y, 1, 1, True);
        FoundItGain := True;
      end else
      begin
        Writeln('Sod it cant find use random coords');
        mouse(650 - random(25), 105 + random(25), 10 - random(10), 10 + random(10), True);
        If FindSymbol(x, y, 'Fishing Spot') then
        FoundItGain := True;
      end;
      if FoundItGain = True then writeln('at trees now');
      GameTab(4);
    end;
    thats the find and walk procedure...
    i get "'Yay found DDTM" in the debug but the mouse doesnt move.. why??

    ~Spaz

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

    Default

    i think that you need a begin after the if then statement...whether it finds it or not it will write that unless you have the begin

    try this:

    SCAR Code:
    Procedure toWillows;
    var
      looking : Integer;
      FoundItGain : Boolean;
    begin
      MarkTime(looking);
      FindTree;
      if DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
      begin
        Writeln('Yay found DDTM');
        Mouse(x, y, 1, 1, True);
        FoundItGain := True;
      end else
      If FindDTM(WillowMM, x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
        Writeln('Found MM DTM');
        Mouse(x, y, 1, 1, True);
        FoundItGain := True;
      end else
      begin
        Writeln('Sod it cant find use random coords');
        mouse(650 - random(25), 105 + random(25), 10 - random(10), 10 + random(10), True);
        If FindSymbol(x, y, 'Fishing Spot') then
          FoundItGain := True;
      end;
      if FoundItGain = True then writeln('at trees now');
        GameTab(4);
    end;
    METAL HEAD FOR LIFE!!!

  10. #10
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ?? im sorry i didnt understand that???

    i knew DDTM's were confusing but this is jsut annoying now.... lol

    ~Spaz

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

    Default

    Need to move the begin from before the if() then to after it otherwise it just does the 1st line after the if. Just in case that isn't clear, need to change it to
    SCAR Code:
    FindTree;
      if DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
      begin
        MMouse(x, y, 1, 1);
        Writeln('Yay found DDTM');
        Mouse(x, y, 1, 1, True);
        FoundItGain := True;
      end else
      begin
        If FindDTM(WillowMM, x, y, MMX1, MMY1, MMX2, MMY2) then
        MMouse(x, y, 1, 1);
        Writeln('Found MM DTM');
        Mouse(x, y, 1, 1, True);
        FoundItGain := True;
      end else
      begin
        Writeln('Sod it cant find use random coords');
        mouse(650 - random(25), 105 + random(25), 10 - random(10), 10 + random(10), True);
        If FindSymbol(x, y, 'Fishing Spot') then
        FoundItGain := True;
      end;

    Edit: >< gerauchert fixed it up after I posted my one and now I look silly
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

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

    Default

    Quote Originally Posted by spaztaz666 View Post
    ?? im sorry i didnt understand that???

    i knew DDTM's were confusing but this is jsut annoying now.... lol

    ~Spaz

    Yeah, but once you get the hang of it its not bad though...

    Oh, and btw I edited my post...fixed your standards and took out the unnecessary mmouse that you had after finding the ddtm
    METAL HEAD FOR LIFE!!!

  13. #13
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yer i had the MMouse in there just to test to see if it would move lol cos i was getting kinda annoyed :P

    ~Spaz

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 problem
    By iroki_ in forum OSR Help
    Replies: 2
    Last Post: 04-14-2008, 07:49 PM
  3. Help with DDTM
    By stampede10343 in forum OSR Help
    Replies: 3
    Last Post: 01-23-2008, 10:53 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
  •