Results 1 to 15 of 15

Thread: A Waddo style DTM tut

  1. #1
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default A Waddo style DTM tut

    Hi recently ive been making a few tutorials one of which is my beginners handbook, I am writing this to supplement my beginners hand book.

    DTM's are a brilliant way to find items and once you have made one you will find out how easy they really are.

    It takes me about 30 seconds to make a DTM and here 99.99% accurate if done properly.

    How are WE going to do this.

    Simple.


    We're going to make a phat DTM.

    Here is one I made earlier.

    SCAR Code:
    program New;
    Var
      PHatDTM : Integer;
    Begin
      PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934097331FC07D' +
           '220D1FF40C0781EC85888AA06220B2381F47520B188809A7B4062' +
           '2501355780C416026A0E0389D5F8D500005F980E93');
    end.

    see that big long gobledegook forget about it scar will do that for you so don't get scared =].

    Open scar

    Use the cross hair to select the window in which the item is (we will be selecting SRL-forums).

    Click Tools-->DTM Editor
    and you will see a window with you client(thing you picked with cross-hair) in

    What do we do


    you set the PARENT point by clicking somewhere in the center of the PHat

    on the options at the left set the tolerance to 255 (255 tol means this DTM will find all the party hats not just red if you want it to find just the red one set it at about 20 tol)



    What now

    Well as Jagex are such idiots they made our life easy by putting a black outline around items so create about 5 sub points by clicking on the black outline.

    it should now look something like this.



    now hit file-->DTM To Text

    close the window.

    In scars debug box you will have something like

    DTM := DTMFromString('78DA63BCC8C0C0B08A91011934097331FC0 7D' +
    '220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
    '2501355780C416026A0E0389D5F8D500005F980E93');

    There's you DTM its called DTM but we will rename it PHatDTM.

    Declare your DTM as an integer like below
    and paste your DTM into your program.

    SCAR Code:
    program New;
    Var
      PHatDTM : Integer;
    Begin
      PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934097331FC07D' +
           '220D1FF40C0781EC85888AA06220B2381F47520B188809A7B4062' +
           '2501355780C416026A0E0389D5F8D500005F980E93');
    end.

    Done.

    Using a DTM

    The 2 main uses are

    1.Finding an item


    To do this use the function
    FindDTM(DTMName,x,y,x1,y1,x2,y2);

    DTMName is PHatDTM

    x,y is the co-ords where the PARENT point is found

    x1,y1,x2,y2 is the location to search

    so if we want to find a PHat in our inventory we would use

    MIX1,MIY1,MIX2,MIY2 as these are the constants for the inventory co-ords.


    So
    FindDTM(PHatDTM,x,y,MIX1,MIY1,MIX2,MIY2)

    WARNING IF YOU HAPPEN TO HAVE A PHAT IN YOUR INVENT THIS WILL DROP IT YOU HAVE BEEN WARNED

    SCAR Code:
    program New;
    {.include srl/srl.scar}
    Var
      PHatDTM, x, y: Integer;
    Begin
      setupsrl;
      PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934097331FC07D' +
           '220D1FF40C0781EC85888AA06220B2381F47520B188809A7B4062' +
           '2501355780C416026A0E0389D5F8D500005F980E93');
      If FindDTM(PHatDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      Begin
        Mouse(x,y,0,0,False);
        ChooseOption('Drop');
      end;
    end.
    {.include srl/srl.scar} is needed to use the invent co-ords as these are part of srl.
    if you use SRL you must use SetupSRL;
    That will right click and drop your PHat.

    Done.

    2. Counting items in your inv


    CountItems(DTMName,Type,Tolerance);
    DTMName is PHatDTM.
    Count items can be used for Bitmap's or DTM's where using DTM's so Type is 'DTM' (as a string)
    the tolerance is only used in bitmaps so we want to do [0,0]

    So
    CountItems(PHatDTM,'DTM',[0,0]);


    SCAR Code:
    program New;
    Var
      PHatDTM : Integer;
    Begin
      PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934097331FC07D' +
           '220D1FF40C0781EC85888AA06220B2381F47520B188809A7B4062' +
           '2501355780C416026A0E0389D5F8D500005F980E93');
      Writeln(IntToStr(CountItems(PHatDTM,'DTM',[0,0]));
    end.

    This will Writeln how many PHats are in you invent.

    Done.

    Now one last thing

    at the end of you script put

    FreeDTM(DTMName);
    Eg.FreeDTM(PHatDTM);

    Do it for al you DTM's
    if you don't you will get memory leaks which will slow down you pc


    Excercise

    Make a script that will find and click on a sapphire but not on any other gem.
    Hint:Tolerance of PARENT point.

    Answer
    Blank!

  2. #2
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    nice tut im using it now for my first script!
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  3. #3
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Blank!

  4. #4
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    noooooooooo
    it dropped my white phat!!!!
    lol jk

    nice tut waddo, it has everything needed i think. going to check The Beginners HandBook =)

  5. #5
    Join Date
    May 2008
    Location
    127.0.0.1
    Posts
    705
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    excellent tut, still think you should get a godly uber rank for your tolerence with my noobiness :P
    <Wizzup> And he's a Christian
    <Wizzup> So he MUST be trusted
    ___________________________________________
    <Wizzup> she sounds like a dumb bitch

  6. #6
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    nice tut!
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  7. #7
    Join Date
    Jul 2007
    Location
    Mo-Town
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Awesome Tut and Tyvm. I was having troubles with my DTMs working after I reloaded RS (cuz colors changing) no matter what I set the Tolerance to. But Now I got them down and they still work after I reload RS. This has helped me a lot and I'm going to use this tut while writing my first script (fletching script about 50% done).
    Quote Originally Posted by Napolean
    In Politics, Stupidity is Not a Handicap
    Quote Originally Posted by Unknown
    Marriage is like a bank. You put it in, Pull it out, then lose interest.

  8. #8
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Good luck I hope you do well.
    Blank!

  9. #9
    Join Date
    Jul 2008
    Posts
    907
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i don't get this...i've set the tolerance to 20 and everything yet when i set it up to click the dtm it doesn't find it and i have chosen all five subpoints on the black edge of the item and the mainpoint in the center


  10. #10
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Paste what you are using atm and i will see if i can figure out why
    Blank!

  11. #11
    Join Date
    Jul 2007
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Waddo.

    This thread learnt me about DTM's
    Rep ++

  12. #12
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    335
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I try use dtm and:
    Line 8: [Error] (8:18): Unknown identifier 'CountItemsDTM' in script

    SCAR Code:
    program New;
    Var
      OreDTM : Integer;
    Begin
      OreDTM:=DTMFromString('78DA63F4666260906164400653FCE41944803' +
           '448F43F1030FA62AA3992AE095703028CC1986A40B2286A40E6C8' +
           'A3AA399689668E3F508D30AA9AB9C18A286A00E7980B46');
      Writeln(IntToStr(CountItemsDTM('Inv',OreDTM)));
    end.

  13. #13
    Join Date
    Jun 2009
    Location
    New Jersey
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice tut.
    I tried to figure out DTMs by myself and failed, horribly.. =[
    But with this tut, I figured them out.

    Going to make a log burner now ^.^ or attempt to.

  14. #14
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by ConneX View Post
    I try use dtm and:
    Line 8: [Error] (8:18): Unknown identifier 'CountItemsDTM' in script

    SCAR Code:
    program New;
    Var
      OreDTM : Integer;
    Begin
      OreDTM:=DTMFromString('78DA63F4666260906164400653FCE41944803' +
           '448F43F1030FA62AA3992AE095703028CC1986A40B2286A40E6C8' +
           'A3AA399689668E3F508D30AA9AB9C18A286A00E7980B46');
      Writeln(IntToStr(CountItemsDTM('Inv',OreDTM)));
    end.
    That's because the function doesn't exist.

    SCAR Code:
    function CountDTMs(dtm:integer):integer;
    var i, x, y : Integer;
        item : TBox;
    Begin
      Result := 0;
      gametab(4);
      For i := 1 to 28 do
      Begin
        Item := InvBox(i);
        If FindDTM(DTM, x, y, Item.x1-5, Item.y1-5, Item.x2+5, Item.y2+5) then
          Result := Result + 1;
      end;
    end;

  15. #15
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This tut is outdated countDTM's was an old function I will adjust accordingly.
    Blank!

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
  •