PDA

View Full Version : How To Make Easy DDTM's!



Naum
05-28-2008, 10:04 AM
How To Make DDTM's Using Nielsie95's DDTM Edit0r!


Table Of Contents

I - What Are DDTM's?

II - Capturing The Client.

III - Getting To Grips with the DDTM Edit0r!

IV - Using the DDTM[s] In Your Script!

V - Links!


LINK TO THE DDTM EDITOR : http://www.villavu.com/forum/showthread.php?t=25312


|||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||



I - What Are DDTM's?

So What the f*ck are DDTM's? DDTM's are related to DTM's, but they have a more user friendly Interface. DDTM's stand for Dynamic Deformable Template Model. They are used mainly for walking to places in runescape using SCAR. Coding a DDTM by hand isn't at all hard, but takes a lot of time.
This Is why Nielsie has made a very easy shortcut for us, this was located in the Delphi Programming Section of the forum and sadly only got 'jack' views. This is a shame really as I think this is one of the best programming helping tools available (ACA 2 :p). It has a very Human friendly interface and is very very easy to use.

A Picture:

http://i29.tinypic.com/sym5jp.jpg




II - Capturing The Client.


Ok So now we need to Get the client picture (Runescape Interface) to plot the DDTM

MainPoints and Subpoints, For this I would use the Screen Captcha that Sumilion sent me:

program RS_ScreenCaptcha;
var
bmpScreen, x, y: Integer;
begin
ActivateClient;
wait(1800+Random(200))
Disguise('Dont touch');
GetClientDimensions(x, y);
bmpScreen := BitmapFromString(x, y, '');
CopyClientToBitmap(bmpScreen, 0, 0, x, x);
SaveBitmap(bmpScreen, ScriptPath + 'RS Screenshot.bmp');
Disguise('Done!');
end.


Not: 'You must save this to your desktop as that is where the picture will be saved aswell

;)'

^ Just Specify the Client to where you want to walk to and it will capture it in a .Bmp

form^

So you ask why do I Need this? You need this becuase Nielsie's DDTM editor goes of co-ords from about 100 pixels to 500, you need to capture the Screen exactally or it won't Find the DDTM when we go to the end.

Ok so we should now have the picture ready on which to Make the DDTM, Now comes the Hard Part j/k....



III - Getting To Grips with the DDTM Edit0r!


Now the DDTM Editor is just like the DTM editor that SCAR has built in, but with a few extra Functions :


Create, edit, view and delete points
Adjustable colors for the lines to the points.
Yellow pointers to see which point you're editing.
Load / save DTM's (supports the SCAR format) :D
Load DTM's from strings.
Load images from a .bmp file.
Load images from clipboard
Show the matching pixels (similar to cts 1).
Generate a DDTM or DTM which you can use in SCAR.


Now we go to Image ( in the taskbar! ) --> Browse Image.
You should now see a screen like this:

http://i32.tinypic.com/15f6f7k.jpg

Go onto the desktop and select this .bmp image called 'RS Screenshot', Open it and proceed.
Now we have the Image Open. My Image Looks Like this:

http://i26.tinypic.com/2yjx8k3.jpg

Now we make the DDTM, just like you would do with the Normal DTM Editor you make a mainpoint and a subpoint. As your plotting the points you should notice these Boxes called Tolerance, Color, Area Size, Area Shape, x and y.
You might want to play about with these values to find the right DDTM for you.

My DDTM Looks like this :

http://i26.tinypic.com/2aa0djb.jpg

As you see my mouse is hovering over the DDTM to Text option you might want to do this after you have made your DDTM.
When you are finished click that Option and a window should pop up with the DDTM:

http://i25.tinypic.com/23hrfgm.jpg

Use this Copy to Clip Board Function and close the DDTM Editor.



IV - Using the DDTM[s] In Your Script!


Open Scar you should see:

program New;
begin
end.

Now This is what my DDTM looks Like and this is How you should Paste it

Program New;


function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 633;
dtmMainPoint.y := 55;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 8355209;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 633;
dtmSubPoints[0].y := 55;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 8355209;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 620;
dtmSubPoints[1].y := 67;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 8355209;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 648;
dtmSubPoints[2].y := 67;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 8355209;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 645;
dtmSubPoints[3].y := 38;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 8355209;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 600;
dtmSubPoints[4].y := 22;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 8355209;
dtmSubPoints[4].Tolerance := 0;

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

Begin



end.

Now as we want scar to Find the DDTM we must specify it as so:


Program New;

Var
DTM1 : Integer;

function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 633;
dtmMainPoint.y := 55;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 8355209;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 633;
dtmSubPoints[0].y := 55;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 8355209;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 620;
dtmSubPoints[1].y := 67;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 8355209;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 648;
dtmSubPoints[2].y := 67;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 8355209;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 645;
dtmSubPoints[3].y := 38;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 8355209;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 600;
dtmSubPoints[4].y := 22;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 8355209;
dtmSubPoints[4].Tolerance := 0;

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

Begin



end.

^ As you can see I have added an Integer called 'DTM1' I want my script to walk to this place so what I must now do is to Make scar associate that DTM1 with the SetDDTM :

Program New;
{.include srl/srl.scar}
Var
DTM1, x, y : Integer;



function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 633;
dtmMainPoint.y := 55;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 8355209;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 633;
dtmSubPoints[0].y := 55;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 8355209;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 620;
dtmSubPoints[1].y := 67;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 8355209;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 648;
dtmSubPoints[2].y := 67;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 8355209;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 645;
dtmSubPoints[3].y := 38;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 8355209;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 600;
dtmSubPoints[4].y := 22;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 8355209;
dtmSubPoints[4].Tolerance := 0;

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

Begin
DTM1 := SetDDTM;
If DTMRotated(DTM1, X, Y, MMX1, MMY1, MMX2, MMY2) Then
WriteLn('Found DTM1');
end.

What I have done is used the Procedure DTMROtated to search for the DTM1 in the Minimap, If it finds it then it will write in the DebugBox : Found DTM1.
This is just a glimpse of How smex-eh the DDTM Editor is.

Good Night!


[Note Some of the Example Might'nt Work]



V - LINKS!

http://www.villavu.com/forum/showthread.php?t=26968?t=29398&highlight=ddtm+tuts

http://www.villavu.com/forum/showthread.php?t=19162?t=20941&highlight=ddtm+tuts

http://www.villavu.com/forum/showthread.php?t=12584

Use the search Button to Find More!



Credits:
Nielsie
Sumilion




THANKS FOR READING!!!







:garfield:

nielsie95
05-28-2008, 11:37 AM
Looks good :)
Thank you for making this.

PvH
05-28-2008, 12:52 PM
nice tut nauman:)
good job:D
tough i prefer making them by my own:p
rep+;)

kor
05-28-2008, 01:07 PM
another great tut by a great scripter ;) Nauman, you rock. you're my scripting idol xD. you're friendly, helpful and all you could imagine. good job!

Naum
05-28-2008, 01:16 PM
Thanks for all the replies Guys :)

kor
05-28-2008, 02:32 PM
i have a quick question, when making a bank DDTM, whats a good tolerance? i tried around 25 on the main point, and about 0-5 on the sub points. i just want to know what you guys are using ;)

ShowerThoughts
05-28-2008, 02:37 PM
Nub.

good resfreshment of ddtm's lol, good job.

kor
05-28-2008, 02:57 PM
Nub.


Haha Hermpie, are you begin sarcastic again? i told you not to :p anyways, i think this thread should be stickified xD contains alot of good info, easy to understand too.
Yeah, i did actually see the white text. i wonder if anyone sees this?

ShowerThoughts
05-28-2008, 03:26 PM
another great tut by a great scripter ;) Nauman, you rock. you're my scripting idol xD. you're friendly, helpful and all you could imagine. good job!

Just wait till he begs for a rep every 10 times in a sec ;)

Naum
05-28-2008, 07:03 PM
Here's My Script To Beg for Rep:

Program New;
var
i : Integer;
Begin
For i:=0 to 10 Do
SendKeys(' REP ME NOW!');
end.

I dunno It might do it in one second or maybe less ;)

Laur€ns
06-03-2008, 05:29 PM
Maybe TypeSend cuz that knows enter too, but thats kinda like.. slow ;P

Macho Man67
06-07-2008, 05:26 PM
Great tutorial! Helped me a lot. Rep +

itSchRis917
06-07-2008, 05:29 PM
It does it in 47 msec. :P

Naum
06-11-2008, 04:20 PM
Lol ;). Thx for the comments guys

kor
06-11-2008, 05:35 PM
Nauman, you didnt answer my question

*cough*

i have a quick question, when making a bank DDTM, whats a good tolerance? i tried around 25 on the main point, and about 0-5 on the sub points. i just want to know what you guys are using ;)*cough*

itSchRis917
06-11-2008, 06:29 PM
@ kor: The beauty of DDTM's is that you can change the tolerance.. So start it off lower maybe and increase the tolerance by 5 or 10 each time using a loop. And then maybe for debugging purposes if you want, make it writeln what the tolerance was when it found the DTM.

Naum
07-02-2008, 03:46 PM
Yeah. Added New Parts.

Bionicle
09-11-2009, 06:40 AM
smex-eh tut m8. really cleared a few things up for me, may have even finished my script to get into SRL membs with help from this tut :p