Page 1 of 2 12 LastLast
Results 1 to 25 of 29

Thread: DTM Tutorial Basics

  1. #1
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default DTM Tutorial Basics

    DTM Tutorial - Basics

    Last Updated: Sunday 13th of May 2012.

    First of all, What is a DTM?
    A DTM is a Deformable Template Model, which is used to find objects and other static items in the Runescape Client, by recorded points of colours and size.

    Making a DTM.

    Firstly, have the item you wish to make the DTM of ready, next go into Simba Tools > DTM Editor.
    A window should show up with the Runescape screen on it. Ill be using a yew log for my example.

    Now click the centre of the item you are creating the DTM for (Yew Log for example) and a dot should appear, now go to the tolerance on the right and make it 30 (because items dont have static colours, except for the outline)

    Now click the edges of the Item your making the DTM like:


    No need for tolerance for the edges is needed.

    NOTE* All outlines of ITEMS are constant, meaning you dont need tolerance, this will make your DTM alot more accurate.

    Now go DTM > Print DTM to text. You will see letters and numbers in your debug, example:

    SCAR Code:
    DTM := DTMFromString('78DA636C6462609064644006C1F65C601A26C' +
             'A580954A382AA06260B57D30354234F404D17508D2001350D4035' +
             'FC04D49411A1A600A84602BF1A00FCF004DF');

    Make a Integer of the name you want to call your DTM. I named mine YewLog.

    Using DTM's
    SCAR Code:
    Program DTM;
      {.include SRL/SRL.simba}
    Var
      Yewlog:integer; //The Name of the DTM
      X,y:integer; // The X and the Y to store the cords for the DTM.

    Procedure LoadDTM;
    Begin
      Yewlog := DTMFromString('78DA636C6462609064644006C1F65C601A26C' +
             'A580954A382AA06260B57D30354234F404D17508D2001350D4035' +
             'FC04D49411A1A600A84602BF1A00FCF004DF');
    end;

    Procedure FindItem;
    Begin
     if FindDTM(Yewlog, x, y, MIX1, MIY1, MIX2, MIY2) then // MI is the cords of the Invent
     begin
       MMouse(x,y,5,5); // Hovers over log
       If Isuptext('Yew Log')then // If text up yew log it will click it
       begin
         mouse(x,y,5,5,true);
       end else
      Writeln('No DTM found'); // If cant find DTM it will say this.
      end;
    end;

    Begin
      SetupSRL; // MAIN LOOP
      ActivateClient;
      LoadDTM; // CALL the loading first
      FindItem;
    end.
    Freeing DTM's
    Why to free DTM's?
    Without freeing your DTM's it will clog up your computer thus slowing its performance down, if you miss FreeDTM's the only way to restore your computer to full performance again is to restart your computer, but to prevent this just use FreeDTM after using the DTM and calling the DTM when you wish to use it again.

    Heres an example of how to use it. (Just put the name of the DTM you wish to free, mine was Yewlog, so i would yewlog in between the ().
    SCAR Code:
    FreeDTM(DTMNAMEHERE);

    Make sure you re-call the loadDTM; before you search a DTM again, or you could just have the DTM seperate before the function of finding and object using DTM.

    There you have it.
    Last edited by BobboHobbo; 05-13-2012 at 06:02 AM.

  2. #2
    Join Date
    Dec 2006
    Location
    Boss central
    Posts
    811
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    awesome tut another thing closer to havin all requirments for srl member
    Being A Boss

  3. #3
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Isn't here in SRL-Forums 1 already?
    Because i learned it already from here. But awsome and easy to learn TUT.
    Eerik.

  4. #4
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    I usually have my computer running in size 800 x 600. Does this mean that Scar wont be able to recognize DTMs taken at 1024 x 768, even if theyre the exact same items? If this is the case i would need to change my size to 1024 x 768.

    Great Tutorial By the Way

    I also found that when when the mouse is about to hightlight the item the Item name may lag, even for a mili second, causing the DTM not to be found. When i added wait(100) just before the If isuptext, it worked 100% of the time. Is this a good idea or a waste of time.

    Thanks, Anoobis

  5. #5
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

  6. #6
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice tutorial, very understandable, at least for me.
    1 Note.
    If you use mouse(x,y,5,5) then the area is(may be) like this
    :::::::
    ::oo
    ::oo
    if you do Mouse(x-5,y-5,10,10) or you make centrepoint to top-left corner then the area is like this
    ........
    ooo:
    ooo:
    ''''''''''''''
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  7. #7
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by Negaal View Post
    Nice tutorial, very understandable, at least for me.
    1 Note.
    If you use mouse(x,y,5,5) then the area is(may be) like this

    if you do Mouse(x-5,y-5,10,10) or you make centrepoint to top-left corner then the area is like this
    Yup, i added randomness forgot about it -.-

  8. #8
    Join Date
    Jan 2008
    Location
    Mianus [Ye thats right xD]
    Posts
    97
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ty.. this was well needed, gona use this very soon

    Edit: rep ++

  9. #9
    Join Date
    Mar 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is it essential that you always make your start point the middle? What would happen if you made all the outside points go towards the same direction? The reason I say this is because Ive tried making DTMs and have been successful with finding them in the inventory but not on the minimap. Actually I managed to get one on the minimap but that was by luck. Im using the rotate DTM function also just for the record. Anyway great job.

  10. #10
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Shouldnt use DTM's on main screen anyway really unreliable.

  11. #11
    Join Date
    Aug 2008
    Location
    Serdia, Isla Prima
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanx for the tut, help fill in the gaps I still had about DTMs

  12. #12
    Join Date
    Nov 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Shouldnt use DTM's on main screen anyway really unreliable.
    What should be used to locate things on the main screen? I only ask here because I haven't found it elsewhere yet and I am trying to figure out if my script idea is workable or not.

  13. #13
    Join Date
    Feb 2009
    Location
    RP
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great Tut! One of the best. keep it up.

  14. #14
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

  15. #15
    Join Date
    May 2012
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very helpful guide,
    Thanks a bunch!


  16. #16
    Join Date
    Aug 2012
    Posts
    159
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default

    Easy read and easy to understand. Thank you very much for the help.

  17. #17
    Join Date
    Nov 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If MIX1, MIY1, MIX2, MIY2 is used for inventory and MIS1, MIS1, MIS2, MIS2 for the main screen. How about the mini-map portion?

    thanks.

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

    Default

    Quote Originally Posted by elmostreet View Post
    if mix1, miy1, mix2, miy2 is used for inventory and mis1, mis1, mis2, mis2 for the main screen. How about the mini-map portion?

    Thanks.
    mmx1, mmy1,....

  19. #19
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    Quote Originally Posted by elmostreet View Post
    If MIX1, MIY1, MIX2, MIY2 is used for inventory and MIS1, MIS1, MIS2, MIS2 for the main screen. How about the mini-map portion?

    thanks.
    Main Screen: MSX1, MSY1, MSX2, MSY2

    Inventory: MIX1, MIY1, MIX2, MIY2

    Minimap: MMX1, MMY1, MMX2, MMY2

    Chatbox: MCX1, MCY1, MCX2, MCY2
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

  20. #20
    Join Date
    Nov 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the quick response. I copied your script and compiled it but it brings this error out. 'Duplicate identifier 'FINDITEM' at line 14 Compiling failed.'

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

    Default

    Quote Originally Posted by elmostreet View Post
    Thanks for the quick response. I copied your script and compiled it but it brings this error out. 'Duplicate identifier 'FINDITEM' at line 14 Compiling failed.'
    Rename it to something else, FindItem2 or anything that doesn't already exist in the include.

  22. #22
    Join Date
    Nov 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks it worked.

  23. #23
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    err what if your simba does not have a dtm editer? mine is up to date

  24. #24
    Join Date
    Feb 2010
    Location
    Somewhere on earth
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need to enable the extension for the dtm editor to show ( View-> Extensions->dtm_editor ) click it and select enable then you will find the dtm editor it in the tools menu

  25. #25
    Join Date
    Nov 2008
    Location
    UK
    Posts
    153
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice tut. I love DTMs, they are so easy to make and use (and in my case overuse).

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. The Basics Tutorial
    By Richard in forum Outdated Tutorials
    Replies: 12
    Last Post: 03-15-2008, 07:22 PM
  2. back to basics!
    By fucker in forum OSR Help
    Replies: 1
    Last Post: 12-08-2007, 08:42 PM
  3. Scar Basics - (Old Tutorial).
    By XxKanexX in forum Outdated Tutorials
    Replies: 6
    Last Post: 11-05-2007, 09:55 PM
  4. I know the basics of scripting ~Help~
    By Gwallunit in forum OSR Help
    Replies: 4
    Last Post: 03-01-2007, 04:28 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
  •