Waddo
07-11-2008, 01:04 PM
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.
http://www.tip.it/runescape/item2/Red_partyhat.png
We're going to make a phat DTM.
Here is one I made earlier.
program New;
Var
PHatDTM : Integer;
Begin
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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)
http://i13.photobucket.com/albums/a260/lumpy-custard/DTm1.jpg
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.
http://i13.photobucket.com/albums/a260/lumpy-custard/dtm2.jpg
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.
program New;
Var
PHatDTM : Integer;
Begin
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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
program New;
{.include srl/srl.scar}
Var
PHatDTM, x, y: Integer;
Begin
setupsrl;
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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]);
program New;
Var
PHatDTM : Integer;
Begin
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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 (http://www.srl-forums.com/forum/showthread.php?t=35301&garpg=4)
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.
http://www.tip.it/runescape/item2/Red_partyhat.png
We're going to make a phat DTM.
Here is one I made earlier.
program New;
Var
PHatDTM : Integer;
Begin
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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)
http://i13.photobucket.com/albums/a260/lumpy-custard/DTm1.jpg
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.
http://i13.photobucket.com/albums/a260/lumpy-custard/dtm2.jpg
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.
program New;
Var
PHatDTM : Integer;
Begin
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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
program New;
{.include srl/srl.scar}
Var
PHatDTM, x, y: Integer;
Begin
setupsrl;
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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]);
program New;
Var
PHatDTM : Integer;
Begin
PHatDTM:=DTMFromString('78DA63BCC8C0C0B08A91011934 097331FC07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'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 (http://www.srl-forums.com/forum/showthread.php?t=35301&garpg=4)