Results 1 to 19 of 19

Thread: Help me out family.

  1. #1
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Help me out family.

    I gotta be Honest, I have been more then willing, able, and excited about learning all about scripting. But after seeing that I have to incorporate my only 2 problems.... Casing and DDTM's ..... Im really afraid to learn map walking. It seems like if I copy it down in my noteboook, i definetly be able to understand it as thats how I understood all of the tutorials so far. Im just scared, i know if i put the time and effort into it I'll get it... its just so much concentration.

    Help me family, give me some tips when you were learning how to script. How did you concentrate when doing this, How did you feel, am i just being a coward? as i do feel i am. Or am I just being lazy, cuz thats the last thing that id ever want to be when scripting.... I need some advice.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

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

    Default

    When I learned to walk, I used radical walk helper, it was so easy with that. Not sure if its around now though...

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

    Default

    I'll take you through it .
    Add me
    Last edited by Naum; 09-19-2012 at 11:38 AM.

  4. #4
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Sorry bout that Naum, I had to leave for the day unexpectedly, Im really sorry for taking of like that, Im gonna have to leave again at around 7 till 10. =[ Ill add ya, Add me 2, Heavenguard@Live.com
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  5. #5
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ugh, haven't heard back from ya Naum. Everything ok?
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

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

    Default

    Quote Originally Posted by Heavenguard View Post
    Ugh, haven't heard back from ya Naum. Everything ok?
    Are you even on?:



    I'm on literally, 24/7.

  7. #7
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    :O my first time using this thing lmao. Let me see, Im online just sent you an email not too longz ago
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  8. #8
    Join Date
    Oct 2006
    Location
    MI USA
    Posts
    3,166
    Mentioned
    6 Post(s)
    Quoted
    11 Post(s)

    Default

    Hey There,

    I know it all seems daunting at first, I struggled with walking also... go to your SRL Folder..Scripting tools and look for "Radial Walking Aid by Yakman" , give that a try, I haven't used it in awhile, but considering it's still included, I hope it still works . I found the best way to learn is by example, take a fairly easy script and comment every procedure and Function with...

    Code:
    debug('Name of Procedure/Function');
     Disguise('Name of Procedure/Function');
    at the beginning of each....now when you let the script run, you are able to see exactly what the script is doing while you are watching your character on screen....you can also add this into each "step" of your walking procedure, and it helps to let you know where any problems might be....

    I like your positive attitude and you have a good message in your signature...so, as long as you don't double post any more, I think you will do fine

    Best Regards,


  9. #9
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks RAM Promise i wont do that double post thingy anymore. gotta concentrate on learning walking. I think radial walking will be easier then DDTM's, But I still want to learn DDTM, as they say its more accurate, and then to me its worth learning. As for the debug disguise thing, I dont really know how that works, will that help me understand it more? Thanks again man.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

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

    Default

    Quote Originally Posted by Heavenguard View Post
    Thanks RAM Promise i wont do that double post thingy anymore. gotta concentrate on learning walking. I think radial walking will be easier then DDTM's, But I still want to learn DDTM, as they say its more accurate, and then to me its worth learning. As for the debug disguise thing, I dont really know how that works, will that help me understand it more? Thanks again man.
    Well, what it does is it tells you what procedure is running, so you can watch the script run and know what procedure is running when you chop a tree or somthing.

  11. #11
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    DDTMs are simple, you're just thinking that its harder than it is. They're DTMs, but you're able to edit them during runtime. Does your problem concern using DTMs, or editing them, that's the question.

  12. #12
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ya I am being a bit too cautious with this, the problem I guess is that im too scared lol. Cases are not 100% clear to me, I know how they work, I probably could make one without problem, but there just not clinging to me like everything else I learned. My problem could be both, using and editing them at this point, since I'm taking baby steps with it I will understand it in a while.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  13. #13
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ugh, Can you tell me whats wrong with this script. Im telling scar to walk out of the bank and click on the road at a certain point(s). But it just clickes the compass and sets the direction north, and tells me that it DID click the road.

    program LearningDDTM;
    {.include SRL/SRL.scar}

    var
    DDTMTolerance : Integer; // We declare DDTMTolerance globally as we want to use it in more then function;

    function SetDDTM: Integer;// We declare the function SetDDTM which returns an Integer.
    var
    dtmMainPoint: TDTMPointDef; // TDTMPointDef is just words for Main Point.
    dtmSubPoints: Array [0..4] of TDTMPointDef; // These are the subpoints of the Main Point.
    TempTDTM: TDTM; // TDTM is the DDTM.
    RoadColor : Integer; // This is going to be the roadcolor for Varrock's Road.
    begin
    RoadColor := FindVarrockRoadColor; // Here is were we introduce the autocolor include. FindVarrockRoadColor is a handy function which automatically finds the Color of the road in Varrock.
    dtmMainPoint.x := 891; // The MainPoint X coordinate.
    dtmMainPoint.y := 247; // The MainPoint Y coordinate.
    dtmMainPoint.AreaSize := 1; // The MainPoint AreaSize, the bigger the number, the bigger the area it searches.
    dtmMainPoint.AreaShape := 0; // The MainPoint AreaShape, 0 means X. 1 Means Square.
    dtmMainPoint.Color := RoadColor; // The MainPoint Color, This is what makes this function Dynamic, as RoadColor makes the color change.
    dtmMainPoint.Tolerance := DDTMTolerance; // The Tolerance of finding that MainPoint Color, The higher this number, the more it searches.

    dtmSubPoints[0].x := 891; // The Subpoint of [0], X coordinate.
    dtmSubPoints[0].y := 247; // The Subpoint of [0], Y coordinate.
    dtmSubPoints[0].AreaSize := 1; // The Subpoint of [0], The AreaSize.
    dtmSubPoints[0].AreaShape := 0;// The Subpoint of [0], The AreaShape.
    dtmSubPoints[0].Color := RoadColor;// The Subpoint of [0], The Color.
    dtmSubPoints[0].Tolerance := DDTMTolerance;// The Subpoint of [0], The Tolerance.

    dtmSubPoints[1].x := 888;
    dtmSubPoints[1].y := 239;
    dtmSubPoints[1].AreaSize := 1;
    dtmSubPoints[1].AreaShape := 0;
    dtmSubPoints[1].Color := RoadColor;
    dtmSubPoints[1].Tolerance := DDTMTolerance;

    dtmSubPoints[2].x := 889;
    dtmSubPoints[2].y := 227;
    dtmSubPoints[2].AreaSize := 1;
    dtmSubPoints[2].AreaShape := 0;
    dtmSubPoints[2].Color := RoadColor;
    dtmSubPoints[2].Tolerance := DDTMTolerance;

    dtmSubPoints[3].x := 892;
    dtmSubPoints[3].y := 258;
    dtmSubPoints[3].AreaSize := 1;
    dtmSubPoints[3].AreaShape := 0;
    dtmSubPoints[3].Color := RoadColor;
    dtmSubPoints[3].Tolerance := DDTMTolerance;

    dtmSubPoints[4].x := 895;
    dtmSubPoints[4].y := 257;
    dtmSubPoints[4].AreaSize := 1;
    dtmSubPoints[4].AreaShape := 0;
    dtmSubPoints[4].Color := RoadColor;
    dtmSubPoints[4].Tolerance := DDTMTolerance;

    TempTDTM.MainPoint := dtmMainPoint;
    TempTDTM.SubPoints := dtmSubPoints;
    Result := AddDTM(TempTDTM);
    end;

    Function WalkOutOfBank : Boolean;
    var
    TheDDTM, x, y : Integer; // The DDTM is an Integer because SetDDTM returns an Integer.
    begin
    if not LoggedIn then Exit; // if your not logged in, Scar will automatically stop the script there.
    SetRun(True);// This enables Running in Runescape.
    DDTMTolerance := 5;// Remember the DDTM Tolerance we declared globally? well here we use it.
    TheDDTM := SetDDTM;// Here we say that TheDDTM is actually the function SetDDTM.
    repeat // This thing repeats until its told to end.
    if not DTMRotated(TheDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then // DTMRotated just tells scar that if the minimap is not adjusted correctly to see the coordinates of TheDDTM then..
    begin
    Writeln('DDTM not Found, Adjusting Tolerance (Increasing)');
    IncEx(DDTMTolerance, 5);// IncEx increases the integer by the number specified.
    FreeDTM(TheDDTM); // Frees the DDTM, It is IMPORTANT that you do this. It drops the DDTM and all of its settings after this.
    TheDDTM := SetDDTM ; // we declare it again since FreeDTM(TheDDTM) Resets it.
    end else
    begin
    Writeln('Found Varrock Road!!');
    Mouse(x, y, 4, 4, true);// Moves mouse to X, Y and left clicks it.
    Result := True; // The Result is true after clicking.
    Break;// Breaks the LOOP! it stops it right here! If you do not break this loop, Line 71's if not will continue to increase the tolerence. Until 50.
    end;
    until((DDTMTolerance >=50) or not LoggedIn);//it will repeatedly try to find the DDTM until the tolerance is greater or equal to 50, or your account has logged out, or it the DDTM has been found.
    DDTMTolerance := 5;// We reset the DDTMTolerance to 5. So we can use it again if needed.
    FreeDTM(TheDDTM);// We free it again anyways. since this is the end of the function.
    end;

    begin
    SetupSRL;
    ClearDebug;
    ActivateClient;
    if WalkOutOfBank then
    Writeln('We have walked out of the Bank!')
    else
    Writeln('We have not Walked out of the Bank!');
    end.

    Are my colors just screwed up?
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  14. #14
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Heavenguard View Post
    Ugh, Can you tell me whats wrong with this script. Im telling scar to walk out of the bank and click on the road at a certain point(s). But it just clickes the compass and sets the direction north, and tells me that it DID click the road.

    program LearningDDTM;
    {.include SRL/SRL.scar}

    var
    DDTMTolerance : Integer; // We declare DDTMTolerance globally as we want to use it in more then function;

    function SetDDTM: Integer;// We declare the function SetDDTM which returns an Integer.
    var
    dtmMainPoint: TDTMPointDef; // TDTMPointDef is just words for Main Point.
    dtmSubPoints: Array [0..4] of TDTMPointDef; // These are the subpoints of the Main Point.
    TempTDTM: TDTM; // TDTM is the DDTM.
    RoadColor : Integer; // This is going to be the roadcolor for Varrock's Road.
    begin
    RoadColor := FindVarrockRoadColor; // Here is were we introduce the autocolor include. FindVarrockRoadColor is a handy function which automatically finds the Color of the road in Varrock.
    dtmMainPoint.x := 891; // The MainPoint X coordinate.
    dtmMainPoint.y := 247; // The MainPoint Y coordinate.
    dtmMainPoint.AreaSize := 1; // The MainPoint AreaSize, the bigger the number, the bigger the area it searches.
    dtmMainPoint.AreaShape := 0; // The MainPoint AreaShape, 0 means X. 1 Means Square.
    dtmMainPoint.Color := RoadColor; // The MainPoint Color, This is what makes this function Dynamic, as RoadColor makes the color change.
    dtmMainPoint.Tolerance := DDTMTolerance; // The Tolerance of finding that MainPoint Color, The higher this number, the more it searches.

    dtmSubPoints[0].x := 891; // The Subpoint of [0], X coordinate.
    dtmSubPoints[0].y := 247; // The Subpoint of [0], Y coordinate.
    dtmSubPoints[0].AreaSize := 1; // The Subpoint of [0], The AreaSize.
    dtmSubPoints[0].AreaShape := 0;// The Subpoint of [0], The AreaShape.
    dtmSubPoints[0].Color := RoadColor;// The Subpoint of [0], The Color.
    dtmSubPoints[0].Tolerance := DDTMTolerance;// The Subpoint of [0], The Tolerance.

    dtmSubPoints[1].x := 888;
    dtmSubPoints[1].y := 239;
    dtmSubPoints[1].AreaSize := 1;
    dtmSubPoints[1].AreaShape := 0;
    dtmSubPoints[1].Color := RoadColor;
    dtmSubPoints[1].Tolerance := DDTMTolerance;

    dtmSubPoints[2].x := 889;
    dtmSubPoints[2].y := 227;
    dtmSubPoints[2].AreaSize := 1;
    dtmSubPoints[2].AreaShape := 0;
    dtmSubPoints[2].Color := RoadColor;
    dtmSubPoints[2].Tolerance := DDTMTolerance;

    dtmSubPoints[3].x := 892;
    dtmSubPoints[3].y := 258;
    dtmSubPoints[3].AreaSize := 1;
    dtmSubPoints[3].AreaShape := 0;
    dtmSubPoints[3].Color := RoadColor;
    dtmSubPoints[3].Tolerance := DDTMTolerance;

    dtmSubPoints[4].x := 895;
    dtmSubPoints[4].y := 257;
    dtmSubPoints[4].AreaSize := 1;
    dtmSubPoints[4].AreaShape := 0;
    dtmSubPoints[4].Color := RoadColor;
    dtmSubPoints[4].Tolerance := DDTMTolerance;

    TempTDTM.MainPoint := dtmMainPoint;
    TempTDTM.SubPoints := dtmSubPoints;
    Result := AddDTM(TempTDTM);
    end;

    Function WalkOutOfBank : Boolean;
    var
    TheDDTM, x, y : Integer; // The DDTM is an Integer because SetDDTM returns an Integer.
    begin
    if not LoggedIn then Exit; // if your not logged in, Scar will automatically stop the script there.
    SetRun(True);// This enables Running in Runescape.
    DDTMTolerance := 5;// Remember the DDTM Tolerance we declared globally? well here we use it.
    TheDDTM := SetDDTM;// Here we say that TheDDTM is actually the function SetDDTM.
    repeat // This thing repeats until its told to end.
    if not DTMRotated(TheDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then // DTMRotated just tells scar that if the minimap is not adjusted correctly to see the coordinates of TheDDTM then..
    begin
    Writeln('DDTM not Found, Adjusting Tolerance (Increasing)');
    IncEx(DDTMTolerance, 5);// IncEx increases the integer by the number specified.
    FreeDTM(TheDDTM); // Frees the DDTM, It is IMPORTANT that you do this. It drops the DDTM and all of its settings after this.
    TheDDTM := SetDDTM ; // we declare it again since FreeDTM(TheDDTM) Resets it.
    end else
    begin
    Writeln('Found Varrock Road!!');
    Mouse(x, y, 4, 4, true);// Moves mouse to X, Y and left clicks it.
    Result := True; // The Result is true after clicking.
    Break;// Breaks the LOOP! it stops it right here! If you do not break this loop, Line 71's if not will continue to increase the tolerence. Until 50.
    end;
    until((DDTMTolerance >=50) or not LoggedIn);//it will repeatedly try to find the DDTM until the tolerance is greater or equal to 50, or your account has logged out, or it the DDTM has been found.
    DDTMTolerance := 5;// We reset the DDTMTolerance to 5. So we can use it again if needed.
    FreeDTM(TheDDTM);// We free it again anyways. since this is the end of the function.
    end;

    begin
    SetupSRL;
    ClearDebug;
    ActivateClient;
    if WalkOutOfBank then
    Writeln('We have walked out of the Bank!')
    else
    Writeln('We have not Walked out of the Bank!');
    end.

    Are my colors just screwed up?
    Use scar tags bud.
    SCAR Code:
    program LearningDDTM;
    {.include SRL/SRL.scar}

    var
      DDTMTolerance : Integer; // We declare DDTMTolerance globally as we want to use it in more then function;

    function SetDDTM: Integer;// We declare the function SetDDTM which returns an Integer.
    var
      dtmMainPoint: TDTMPointDef; // TDTMPointDef is just words for Main Point.
      dtmSubPoints: Array [0..4] of TDTMPointDef; // These are the subpoints of the Main Point.
      TempTDTM: TDTM; // TDTM is the DDTM.
      RoadColor : Integer; // This is going to be the roadcolor for Varrock's Road.
    begin
      RoadColor := FindVarrockRoadColor; // Here is were we introduce the autocolor include. FindVarrockRoadColor is a handy function which automatically finds the Color of the road in Varrock.
      dtmMainPoint.x := 891; // The MainPoint X coordinate.
      dtmMainPoint.y := 247; // The MainPoint Y coordinate.
      dtmMainPoint.AreaSize := 1; // The MainPoint AreaSize, the bigger the number, the bigger the area it searches.
      dtmMainPoint.AreaShape := 0; // The MainPoint AreaShape, 0 means X. 1 Means Square.
      dtmMainPoint.Color := RoadColor; // The MainPoint Color, This is what makes this function Dynamic, as RoadColor makes the color change.
      dtmMainPoint.Tolerance := DDTMTolerance; // The Tolerance of finding that MainPoint Color, The higher this number, the more it searches.

      dtmSubPoints[0].x := 891; // The Subpoint of [0], X coordinate.
      dtmSubPoints[0].y := 247; // The Subpoint of [0], Y coordinate.
      dtmSubPoints[0].AreaSize := 1; // The Subpoint of [0], The AreaSize.
      dtmSubPoints[0].AreaShape := 0;// The Subpoint of [0], The AreaShape.
      dtmSubPoints[0].Color := RoadColor;// The Subpoint of [0], The Color.
      dtmSubPoints[0].Tolerance := DDTMTolerance;// The Subpoint of [0], The Tolerance.

      dtmSubPoints[1].x := 888;
      dtmSubPoints[1].y := 239;
      dtmSubPoints[1].AreaSize := 1;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := RoadColor;
      dtmSubPoints[1].Tolerance := DDTMTolerance;

      dtmSubPoints[2].x := 889;
      dtmSubPoints[2].y := 227;
      dtmSubPoints[2].AreaSize := 1;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := RoadColor;
      dtmSubPoints[2].Tolerance := DDTMTolerance;

      dtmSubPoints[3].x := 892;
      dtmSubPoints[3].y := 258;
      dtmSubPoints[3].AreaSize := 1;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := RoadColor;
      dtmSubPoints[3].Tolerance := DDTMTolerance;

      dtmSubPoints[4].x := 895;
      dtmSubPoints[4].y := 257;
      dtmSubPoints[4].AreaSize := 1;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := RoadColor;
      dtmSubPoints[4].Tolerance := DDTMTolerance;

      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
      Result := AddDTM(TempTDTM);
    end;

    Function WalkOutOfBank : Boolean;
    var
      TheDDTM, x, y : Integer; // The DDTM is an Integer because SetDDTM returns an Integer.
    begin
      if not LoggedIn then Exit; // if your not logged in, Scar will automatically stop the script there.
      SetRun(True);// This enables Running in Runescape.
      DDTMTolerance := 5;// Remember the DDTM Tolerance we declared globally? well here we use it.
      TheDDTM := SetDDTM;// Here we say that TheDDTM is actually the function SetDDTM.
      repeat // This thing repeats until its told to end.
        if not DTMRotated(TheDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then // DTMRotated just tells scar that if the minimap is not adjusted correctly to see the coordinates of TheDDTM then..
        begin
          Writeln('DDTM not Found, Adjusting Tolerance (Increasing)');
          IncEx(DDTMTolerance, 5);// IncEx increases the integer by the number specified.
          FreeDTM(TheDDTM);  // Frees the DDTM, It is IMPORTANT that you do this. It drops the DDTM and all of its settings after this.
          TheDDTM := SetDDTM ; // we declare it again since FreeDTM(TheDDTM) Resets it.
        end else
        begin
          Writeln('Found Varrock Road!!');
          Mouse(x, y, 4, 4, true);// Moves mouse to X, Y and left clicks it.
          Result := True; // The Result is true after clicking.
          Break;// Breaks the LOOP! it stops it right here! If you do not break this loop, Line 71's if not will continue to increase the tolerence. Until 50.
        end;
      until((DDTMTolerance >=50) or not LoggedIn);//it will repeatedly try to find the DDTM until the tolerance is greater or equal to 50, or your account has logged out, or it the DDTM has been found.
      DDTMTolerance := 5;// We reset the DDTMTolerance to 5. So we can use it again if needed.
      FreeDTM(TheDDTM);// We free it again anyways. since this is the end of the function.
    end;

    begin
      SetupSRL;
      ClearDebug;
      ActivateClient;
      if WalkOutOfBank then
        Writeln('We have walked out of the Bank!')
      else
        Writeln('We have not Walked out of the Bank!');
    end.

  15. #15
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Raggy? roobi doobi doo. Mind explaining.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  16. #16
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Heavenguard View Post
    Raggy? roobi doobi doo. Mind explaining.
    Instead of just posting your script here, post your script inside these tags [/scar][/scar] so that its actually readable.

  17. #17
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    God bless you.

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

    var
      DDTMTolerance : Integer; // We declare DDTMTolerance globally as we want to use it in more then function;

    function SetDDTM: Integer;// We declare the function SetDDTM which returns an Integer.
    var
      dtmMainPoint: TDTMPointDef; // TDTMPointDef is just words for Main Point.
      dtmSubPoints: Array [0..4] of TDTMPointDef; // These are the subpoints of the Main Point.
      TempTDTM: TDTM; // TDTM is the DDTM.
      RoadColor : Integer; // This is going to be the roadcolor for Varrock's Road.
    begin
      RoadColor := FindVarrockRoadColor; // Here is were we introduce the autocolor include. FindVarrockRoadColor is a handy function which automatically finds the Color of the road in Varrock.
      dtmMainPoint.x := 891; // The MainPoint X coordinate.
      dtmMainPoint.y := 247; // The MainPoint Y coordinate.
      dtmMainPoint.AreaSize := 1; // The MainPoint AreaSize, the bigger the number, the bigger the area it searches.
      dtmMainPoint.AreaShape := 0; // The MainPoint AreaShape, 0 means X. 1 Means Square.
      dtmMainPoint.Color := RoadColor; // The MainPoint Color, This is what makes this function Dynamic, as RoadColor makes the color change.
      dtmMainPoint.Tolerance := DDTMTolerance; // The Tolerance of finding that MainPoint Color, The higher this number, the more it searches.

      dtmSubPoints[0].x := 891; // The Subpoint of [0], X coordinate.
      dtmSubPoints[0].y := 247; // The Subpoint of [0], Y coordinate.
      dtmSubPoints[0].AreaSize := 1; // The Subpoint of [0], The AreaSize.
      dtmSubPoints[0].AreaShape := 0;// The Subpoint of [0], The AreaShape.
      dtmSubPoints[0].Color := RoadColor;// The Subpoint of [0], The Color.
      dtmSubPoints[0].Tolerance := DDTMTolerance;// The Subpoint of [0], The Tolerance.

      dtmSubPoints[1].x := 888;
      dtmSubPoints[1].y := 239;
      dtmSubPoints[1].AreaSize := 1;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := RoadColor;
      dtmSubPoints[1].Tolerance := DDTMTolerance;

      dtmSubPoints[2].x := 889;
      dtmSubPoints[2].y := 227;
      dtmSubPoints[2].AreaSize := 1;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := RoadColor;
      dtmSubPoints[2].Tolerance := DDTMTolerance;

      dtmSubPoints[3].x := 892;
      dtmSubPoints[3].y := 258;
      dtmSubPoints[3].AreaSize := 1;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := RoadColor;
      dtmSubPoints[3].Tolerance := DDTMTolerance;

      dtmSubPoints[4].x := 895;
      dtmSubPoints[4].y := 257;
      dtmSubPoints[4].AreaSize := 1;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := RoadColor;
      dtmSubPoints[4].Tolerance := DDTMTolerance;

      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
      Result := AddDTM(TempTDTM);
    end;

    Function WalkOutOfBank : Boolean;
    var
      TheDDTM, x, y : Integer; // The DDTM is an Integer because SetDDTM returns an Integer.
    begin
      if not LoggedIn then Exit; // if your not logged in, Scar will automatically stop the script there.
      SetRun(True);// This enables Running in Runescape.
      DDTMTolerance := 5;// Remember the DDTM Tolerance we declared globally? well here we use it.
      TheDDTM := SetDDTM;// Here we say that TheDDTM is actually the function SetDDTM.
      repeat // This thing repeats until its told to end.
        if not DTMRotated(TheDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then // DTMRotated just tells scar that if the minimap is not adjusted correctly to see the coordinates of TheDDTM then..
        begin
          Writeln('DDTM not Found, Adjusting Tolerance (Increasing)');
          IncEx(DDTMTolerance, 5);// IncEx increases the integer by the number specified.
          FreeDTM(TheDDTM);  // Frees the DDTM, It is IMPORTANT that you do this. It drops the DDTM and all of its settings after this.
          TheDDTM := SetDDTM ; // we declare it again since FreeDTM(TheDDTM) Resets it.
        end else
        begin
          Writeln('Found Varrock Road!!');
          Mouse(x, y, 4, 4, true);// Moves mouse to X, Y and left clicks it.
          Result := True; // The Result is true after clicking.
          Break;// Breaks the LOOP! it stops it right here! If you do not break this loop, Line 71's if not will continue to increase the tolerence. Until 50.
        end;
      until((DDTMTolerance >=50) or not LoggedIn);//it will repeatedly try to find the DDTM until the tolerance is greater or equal to 50, or your account has logged out, or it the DDTM has been found.
      DDTMTolerance := 5;// We reset the DDTMTolerance to 5. So we can use it again if needed.
      FreeDTM(TheDDTM);// We free it again anyways. since this is the end of the function.
    end;

    begin
      SetupSRL;
      ClearDebug;
      ActivateClient;
      if WalkOutOfBank then
        Writeln('We have walked out of the Bank!')
      else
        Writeln('We have not Walked out of the Bank!');
    end.

    Hope I did it right. thanks
    Any one see what was wrong with this script? maybe its my coordinates?
    Last edited by Heavenguard; 11-30-2009 at 04:46 PM.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  18. #18
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ugh, Since no one is answering Im just going to skip DDTM for now. Ill head for radial walking first, the last walking I will learn will be DDTM then.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  19. #19
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use Coh3n's new function RadialWalkTolerance 100% accurate and hasn't failed me yet If you feel DDTMs are better, make RadialWalkTolerance a backup or the other way round if you feel RadialWalkTolerance is better... For me DDTM doesn't work after logging out so I made walking with RadialWalkTolerance and maybe will use DDTMs as back up...


    Good Luck!

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
  •