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 ().
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.