PDA

View Full Version : Demise DTM Tutorial



DemiseScythe
03-16-2012, 03:25 PM
Demise's DTM Tutorial

In this tutorial I will cover the basics of DTM's, how to properly create DTM's and explain how we can use DTM's to Find objects, Walk, and even Click Items or NPCs on the main screen.


Chapter 1: DTM basic concepts.

First of all, DTM stands for Deformed Template Model and it is a group of pixels of a certain color which are a set x and y distance from each other. Once we create a DTM and order the client to find it, the client will look for possible matches with our DTM and return the first result found and its location in terms of coordinates.

When it comes to declaring our variables, a DTM is an integer and we will have to define all of our DTM's as integers. We will also need to declare x and y as integers. X and y are just variables in which the coordinates of the DTM get stored so we can use them to detect or see items or locations.

var
DTM, x, y: Integer;

You can name your DTM's anything you want but the more descriptive the name, the better ^.^

Just declaring our DTM's is not enough to properly use them, in order to use DTM's in our scripts, we must first Declare them, then Define them and last Free them. I will talk about the later two further into my tutorial. One last note is that if your DTM will be use regularly in your script, it should be Declared and Defined globally but if you only use the DTM's on certain procedures, then they can be Declared and Defined locally to save on memory usage.


Chapter 2: Making correct DTM's.

In order to make DTM's, we need to learn a few more basics that you probably know but I will go over just in case. To make DTM's we will need to have a RS Client open, either browser or SMART, and be logged in.

First we need to Select our client. In order to look this search for the green sight looking button in the toolbar, click on it and a red square should appear, drag your mouse over to your RS client until the red box surrounds only your client and release to finish selecting. Your client is now selected and I will show why this is important later on. This is how the button looks in case anyone is still wondering.

The next step is opening the DTM Editor. We will have to go into Tools > DTM Editor in order to open it up. The picture below illustrates this step. If you do not find the editor in the Tools menu, you will need to enable it by going into View > Extensions > Select dtm_editor.sex > Check box > Restart Simba. On the right is a picture of the extension box with the DTM Editor enabled.

This is the DTM Editor and I will briefly describe the most important features of the DTM Editor.

A - Load Client Image grabs a new frame from the Selected Client, if you make a modification in RS, this button should bring up a new image of your Client.
B - Show Matching DTM's will show you all possible matches for your DTM, this is useful for debugging DTM's and making sure they are no false positives present.
C - Refresh Image refreshes the Editor to re-enable DTM editing, this is often used after Show Matching DTM's to return the editable template and to enable Load Client Image.
D - DTM From String will open any DTM from its integer form, this can be used for opening up DTM's you have previously made or to open up DTM's from other scripts, just click here and paste anything between the ' ' of the DTM into the pop-up window.
E - Print DTM will print your DTM into a usable format and this DTM will now be found in the Debug box in Simba.
F - This is a zoom box, the pixel you select is the one in the center and you can see nearby pixels in addition to the color of the main pixel.
G - This box keeps track of the points in your DTM and can be used to select a point to delete or to edit its Tolerance.
H - Tolerance allows one to deal with the color changing in RS, it is often time saving to change the Tolerance of the first point made and any point made thereafter should have the same Tolerance by default.

We can make DTM's by simply clicking into the image loaded onto the Editor. The method for creating DTM's that was previously popularized was choosing a central point to set its Tolerance at 255 and then to choose points on the black outlines of the object with 0 Tolerance. I will attempt to make a DTM of a Blood rune using these guidelines to highlight some of the main issues with the current method.

On the left is the DTM I just made and on the right is the possible matches it returns represented by a red "X" If the X's are very think, that means there are a group of possible matches centered around an area.

As you can see, this method not only recognizes different runes and Pure Essence as matches but it also recognizes other Items such as the Giant pouch as shown by the red "X" on it. In addition to this, the top and left side of items tend to change shape if you interact with them.

For my method I recommend making all of the points Tolerance 15. That is enough to deal with the Color Changing but will still be accurate enough to distinguish between similar items. In addition to this, I do not choose points on outlines since those tend to change often. I rather choose points inside the object and make space filling shapes with them. Notice the different shape of the DTM and the better item finding results.

Not only does it actually find the Item it was meant to find but that red slur is actually hundreds of "X" next to each other. Simba will only find one of those X's but it is very likely that it will find a different X each time it searches thus this adds randomness to the click, my form of in-script Anti-ban but it is accurate enough that no matter which X it chooses, the X will lay on the item you are trying to choose.

I made the X's appear by clicking Show Matching DTM's as explained above and if the X's appear in the wrong Item or on multiple items, I suggest you increase the amount of points on the DTM. The more points on a DTM, the heavier the DTM will be and the longer it will take to find it. However, the more points the DTM has the more precise it will be at finding the right item. When I say longer, the difference in search times is in Ms or fractions of a second so do not be discouraged to use high point DTM's for inventory and bank items since these differences are not really considerable. Never attempt to use Show Matching DTM's on a DTM with 2 or fewer points since this will crash Simba and you will lose all anything you haven't saved.

Before proceeding it is important to talk about another part of the definition of a DTM. The first point you make on a DTM should be the point you intend to click on since the coordinates of this point will be the ones returned to Simba when one calls on a DTM finding function. This first point is known as the mother point. Any additional points of the DTM will be referred to as daughter points.

Now that we know what the mother and daughter points are; we can proceed to the last part of the process of making a DTM. We need to turn the DTM's from a graphical form as seen above into a code form that we can use in our Simba scripts. Simply hit Print DTM in the DTM menu and check the debug box in the Simba you are using and you will find the DTM in there.

Say we Declared our DTM as Bucket and the above code corresponds to the DTM of the bucket, then we would Define our DTM Bucket in the following manner:


Bucket := DTMFromString('mggAAAHicY2NgYJjOxMAwCYj7gXgOEM9jgo hxMTIwMAMxJxItBMQ1UoIM5UWFDMlxcQxdLc0MDdXVDGFBQQz8 QLOwYUYcGAIAoIoLVw==');

A DTM is Defined by having the Declared name of the DTM followed by the := and everything else after the := that the DTM editor prints. In order to search for this DTM, you need to call this before you can search for it.


Chapter 3: Using DTM's to find stationary objects.

The variety of objects we can click or find with DTM's is endless, as long as there is a graphic, there will be pixels and a DTM can thus be made. The most basic function you can use with a DTM is find FindDTM. FindDTM searches for stationary graphics are the pictures of items or certain icons in pop up windows or even emotes. If something has a graphic on it, it can be found through DTM.

We are going to make a script that right-clicks and examines Blood runes using what we have learned so far. The code should be as follows, I will explain each line with comments.


program BloodRune;
{$i SRL\SRL.scar}//We need this in all scripts.
var
x, y, Blood: Integer;// We Declare our DTM, x and y as Integers.
begin//Begins program.
ClearDebug;//Clears debug, keeps it clean.
SetupSRL; //Enables SRL.
Blood := DTMFromString('mggAAAHicY2NgYJjOxMAwCYj7gXgOEM9jgo hxMTIwMAMxJxItBMQ1UoIM5UWFDMlxcQxdLc0MDdXVDGFBQQz8 QLOwYUYcGAIAoIoLVw==');
//With the above, we Defined our DTM with the code the DTM Editor gave us.
if FindDTM(Blood, x, y, MIX1, MIY1, MIX2, MIY2) then
//FindDTM(DTMname, x, y, xs, ys, xe, ys):Boolean;
begin
Mouse(x, y, 4, 4, False);//FindDTM gives (x, y) as the coordinates of the DTM we made it look for.
ChooseOption('xamine');//Choose Examine in the pop-up.
Writeln('We have examined a blood rune!');
end;
end.//Ends program.


Now log into RS, put a blood rune in your inventory, select the RS client and hit play, and it should find the Blood Rune and examine it. If you did it right, it should give you this on the debug box:

Notice that although it worked, we got an error "The following DTM's were not freed: [2]." This is called a memory leak because we loaded something into the memory of our system but forgot to remove it once it was no longer in use. We should avoid mistakes like these while scripting. On Chapter 1 I mentioned that DTM's have 3 procedures to use them properly. They must first be Declared, then Defined and last Free. To Free a DTM we use FreeDTM(DTMname); after we are done with our DTM. A correctly formatted script should look like this:


program BloodRune;
{$i SRL\SRL.scar}//We need this in all scripts.
var
x, y, Blood: Integer;// We Declare our DTM, x and y as Integers.
begin//Begins program.
ClearDebug;//Clears debug, keeps it clean.
SetupSRL; //Enables SRL.
Blood := DTMFromString('mggAAAHicY2NgYJjOxMAwCYj7gXgOEM9jgo hxMTIwMAMxJxItBMQ1UoIM5UWFDMlxcQxdLc0MDdXVDGFBQQz8 QLOwYUYcGAIAoIoLVw==');
//With the above, we Defined our DTM with the code the DTM Editor gave us.
if FindDTM(Blood, x, y, MIX1, MIY1, MIX2, MIY2) then
//FindDTM(Name(DTM), x, y, xs, ys, xe, ys):Boolean;
begin
Mouse(x, y, 4, 4, False);//FindDTM gives (x, y) as the coordinates of the DTM we made it look for.
ChooseOption('xamine');//Choose Examine in the pop-up.
Writeln('We have examined a blood rune!');
end;
FreeDTM(Blood);//Free the DTM named Blood.
end.//Ends program.


As you can now see, the error is gone ^.^

As long as you know SRL you will be able to do many amazing things with these basic DTM's. You do not need to necessarily use the coordinates a DTM returns to do things, they could be used to check you are wearing something or to check that you have a hatchet or a net in the inventory before attempting to cut a tree or fish. In the later cases, you used the FindDTM to check the if the items were there since FindDTM returns true if it finds the item and false if it doesn't find the item. Thus you can now check if there is a certain item either in your inventory or in your equipment tab depending which tab you got enabled. I've used this to select spells regardless of position or to click on a certain emote. The MIX1, MIY1, MIX2, MIY2 are special coordinates made for our advantage. Say our search box is made from 2 points. Top left point and bottom right point. The coordinates of the top point is (a, b) and the coordinates of the bottom point is (c, d) so in FindDTM, we would list those as a, b, c, d and have FindDTM(DTMname, x, y, a, b, c, d); and thus you can make the search box as large as you want or as small as needed. Smaller search area will return faster searches ^.^

Special coordinates that are good to know and I will use for future on the next few chapters are:
MSX1, MSY1, MSX2, MSY2 - MainScreen, basically the 3D part of the game window.
MIX1, MIY1, MIX2, MIY2 - MainInventory, the inventory, also works for same area regardless of tab opened so you can search for a spell using this.
MMX1, MMY1, MMX2, MMY2 - MiniMap, this is the minimap, mostly used for walking.

There are other but these are the most relevant ones for DTM's and my tutorial ^.^

I will use FindDTM more further as I progress through my tutorial, for now I believe we know enough to proceed into the next chapter.


Chapter 4: Map Walking with DTM's.

This is probably the chapter most of you have been waiting for but I suggest not skipping over the first 3 chapters as there is important concepts reviewed in them that I will expect you to know from now on. Map walking is something most beginner and even experienced scripters have trouble with but one should not let walking intimidate us or stop us from making the scripts we want to make.

DTM walking resembles the more famous Web-walking from the reflection era. The points should be close enough so that they can be seen from the previous point thus creating a chain of points that can lead us to our goal.

I am going to make a DTM Walk path from Varrock West Bank to the Varrock Garden and I suggest you to try making this path to master DTM Walking which is not only extremely accurate but very realistic.

Whenever we are walking with DTM's, instead of having say DTM's 1 to 20, we should use an array of integers to Declare our DTM path and save time. The array should be Declared as follows:


var
x, y, i: Integer;
Q: Array [0..10] of Integer;
aFound: Extended;


I will explain aFound and i later on, for now I will focus on explaining our array of Q integers from 0 to 10. You can replace the 10 for any number depending on how many points you need, Q can also be any Letter or Word but you must start from 0 and use this format. To use them, we would do Q[number] := DTMFromStr... and replace number with an integer from 0 to 10 inclusive on this case. To make things simple for yourself, use MakeCompass('direction'); and keep a standard direction you want your MiniMap to be facing to, for this example I will use n for North.

Now on the DTM Editor, we are going to focus on the minimap. We want to place the mother point where we want to walk to, then we are going to place the other points on the main colors of certain areas, see my DTM below for a more clear view of what I mean here. Some don'ts with both the mother and daughter points is to pick pixels of the boundaries of buildings as points, pick anything close to white, and any point near a Symbol as those 3 things can severely hinder your DTM's accuracy, non moving NPC's are great points to pick in the contrary because they are unique and their position shouldn't change. Once you make a point, do Show Matching DTM's and check that there are not false positives and that your X's are close to each other. Then Print DTM and copy the code into the first integer in your array of Q. Then on the RS client, click to where the X was found, on the editor Refresh Image and Load Client Image to get a new updated Minimap, keep in mind the minimap should be facing the way you defined it with Makecompass, so make sure it is always facing North in our case. Repeat this process until you got all the points from Beginning to End; If you need additional points, you can always enlarge your array and shrink it to required size once you are done adding points. Remember to make every single point 15 Tolerance, if you did not, you will have to either Load DTM from String and edit the Tolerance of all points to 15 and re-Print to replace or do the DTM all over if you prefer that option.

This is what some of your points should sort of look like:

Keep in mind that I use excess points to show possible "good" places to put a daughter point. Your DTM's should have 5 to 6 points total each.

You should know have prepared the Declaring, Defining, and Freeing procedures for this DTM array. We have now done the hardest part of DTM walking, the rest is just a matter of using code. I designed the following procedure to be use for DTM walking, feel free to tweak it if you please.


if FindDTMRotated(Q[A], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[B], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;


A = B - 1 in the above example, this pretty much walks until it finds the next point thus being a more efficient flag procedure. After weaving all of your points together and we now got a walking script. Note the last point doesn't have a ending loop and this is because there is no point after it in the array.

Our finished script should look something like this:

program VarrockWalk;
{$i srl/srl/misc/smart.scar}
{$i srl/srl.scar}
var
x, y, i: Integer;
Q: Array [0..7] of Integer;//DTM Declaring procedure.
aFound: Extended;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

procedure SetDTM;//DTM Defining procedure.
begin
Q[0] := DTMFromString('mwQAAAHic42RgYNjAxMAwE4hXAHE9EPsCcS QQJwCxORBPAOJcoLoEIPYDYmkg9gHiOiCeAsShQNwFwh2tDLFB pgz2jmoM6XFuDJbm6gw2VppgNkguJ96WgR+ojhBmJALDAQB6Nx Fo');
Q[1] := DTMFromString('mrAAAAHic42BgYFjMxMBQC8QJQNwExOFA3A DEEUBcCMQaQDVqQKwPxGZAnArE9UDcDMTxQGyoo87g6KLOkBhm weDrosOQE2/LYG6sxqCnpcDQ1dHKwA9Ugw8zEsAwAAC81Q03');
Q[2] := DTMFromString('mlwAAAHicY2dgYPBiYmDIAOI0IPYD4mYgLg TiGUAsDZRXAmJbII4F4kggjgBiYyD2djFmCPKyAGNvJ22GxIQ4 MPZ1M2XgB8rjwox4MBQAAD3lC1s=');
Q[3] := DTMFromString('mlwAAAHicY2dgYMhlYmDIAeJyIHYHYlsg9g DieiAWAMobArEPEFsBsQUQOwOxOhAHeVnAsZevMkNiQhwc8wPl cWFGPBgKABKQCx0=');
Q[4] := DTMFromString('mlwAAAHicY2dgYGhkYmDoZYLQ1UAcAsTeQF wPxJJA+RQgtgfiWCBuBeIaIG4C4iAvC4bEhDgwDWPD+PxAeVyY EQ+GAgDnMwz3');
Q[5] := DTMFromString('mggAAAHicY2NgYFjDxMDQDsTlUBwFxJOAWA 8opwDEhkCcAcQxQKwNxKH+KgwRfhZwnJ4Sx1BSkMXAD5TDhhlx YAgAAIBGCsc=');
Q[6] := DTMFromString('mlwAAAHicY2dgYNjGxMDQB8QLgTgGiK2BuA OIvYA4HijvAcR2QBwExAZAPAmI04E4ws+CwctRjyE9JY4hOyOJ IShYhSHUA4j9VRj4gfK4MCMeDAUAzz4Mew==');
Q[7] := DTMFromString('mrAAAAHic42BgYOhgYmDoB+IgIPYE4gggjg XiZUC8FIgnA9X4A3EnEBcCsQcQGwJxBBCXALG7qxrD7O5UhlAP FYb01DiGCD8LhvSUOAZzQyUGe2tdBn6gGnyYkQCGAQB9rw7M') ;
end;

procedure FrDTM;//DTM Freeing procedure.
begin
FreeDTM(Q[0]);
FreeDTM(Q[1]);
FreeDTM(Q[2]);
FreeDTM(Q[3]);
FreeDTM(Q[4]);
FreeDTM(Q[5]);
FreeDTM(Q[6]);
FreeDTM(Q[7]);
end;

begin
Smart_Server := 64;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetDTM; //Set DTM's before code.
MouseSpeed := 18;//This makes it move faster but still undetectable, it makes DTM walking even more human-like.
MakeCompass('n');//We agreed we'd have camera facing North.
SetAngle(True);//Does not matter but it looks cooler from above.
if FindDTMRotated(Q[0], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[1], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(Q[1], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[2], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(Q[2], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[3], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(Q[3], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[4], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(Q[4], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[5], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(Q[5], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse((x-5), y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[6], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(Q[6], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTMRotated(Q[7], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(Q[7], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
end;
// No loop for the last point in the walk.
FrDTM; //Free DTM's after Code.
end.


I remade the DTM's using fewer points but now I have a working walk that is fast, accurate and human. Debugging this walks becomes extremely easy when you get the hang of it ^.^ This was a walk of considerable distance and was all achieved with a few clicks. If you made your walk, debugged it and it works, congratulations, you now know how to DTM Walk, the rest is practice and experience, I can make it walk accurately to the right spot with only 5 points, you will gain my expertise by playing around with this.

Some of you might have noticed by now that Instead of using FindDTM, I used FindDTMRotated and that there are a few extra parameters in them. Since you should know what the first 7 parameters are, I will discuss the last 4 parameters.
-Pi/4 and Pi/4 are angle measurements in Radians, one tells the Client which angle to start looking from and the other tells which angle to end, usually I leave the first as the negative version of the second value. Pi/60 is an angle step which means it will search for the DTM every 60th of Pi angle. The greater this number is, the longer it will take but the greater the chance of finding the DTM we are looking for. aFound returns the angle at which the DTM was found, this doesn't have a use for my method but we need it there to make FindDTMRotated work, this needs to be Declared as an Extended the way I did at the stop of the above script. Why should we rotate the DTM's? Well the Mini Map is not always facing perfectly at the North and if we just used FindDTM there is a good chance that we would not be able to find the DTM we are looking for unless they DTM's angle is exactly the same as the RS Client Mini Map angle thus it is important to use FindDTMRotated instead. This concludes Chapter 4.


Chapter 5: 3D DTM's and Object/NPC identification.

Clicking on objects in the screen is actually quite easy using DTM's. For example, we want to examine an Imp in Varrock. We are going to first Define a compass direction and angle which will be our standard point of view. So we choose MakeCompass('n'); and SetAngle(True); On the DTM Editor, we are going to make a 3-Point DTM on the bear and test Show Matching DTM's with different Client images to see that we find an Imp regardless of where it is walking towards. It is important to make the points close to each other and either in a straight line or with a 90 degrees bent on the angle. Look at the picture below to see how this works. The picture on the right is how the X's should appear. Note that the X's are only on the Imp and not anywhere else on the Main Screen.

Now if we refresh the Image and run the test again, it should still find the Imp as long as it is inside the screen. Remember that where you place the mother point is where the Mouse will actually click on, so it is important to have this in the center of the Object/NPC.

Even if at some angles it appears that it will not find the object, FindDTMRotated should allow the client to have a greater chance at finding the DTM of the Object or NPC. This is the procedure I use to click on objects in the 3D screen:


procedure ClickOn(PX:Integer; Click: Boolean);
begin
if FindDTMRotated(PX, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, Click);
end;
end;


This procedure has two parameters, first is DTMname and the second is True for left-click and False for right-click. It is that simple ^.^

Below is a short script that right-clicks an Imp and examines it.


program ImpExamine;
{$i srl/srl/misc/smart.scar}
{$i srl/srl.scar}
var
x, y, Imp: Integer;
aFound: Extended;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

procedure SetDTM;//DTM Defining procedure.
begin
Imp := DTMFromString('mQwAAAHicY2ZgYFjCyMCwEojnAvFPIP8zEH 8HYk9tBYZ4Cy0Gd2VRBn4gH4YZkTAQAAA9wAbY');
end;

procedure FrDTM;//DTM Freeing procedure.
begin
FreeDTM(Imp);
end;

procedure ClickOn(PX:Integer; Click: Boolean);
begin
if FindDTMRotated(PX, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, Click);
end;
end;

begin
Smart_Server := 64;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetDTM; //Set DTM's before code.
MouseSpeed := 18;//This makes it move faster but still undetectable, it makes DTM walking even more human-like.
MakeCompass('n');//We agreed we'd have camera facing North.
SetAngle(True);//Does not matter but it looks cooler from above.
ClickOn(Imp, False);//Right-clicks on an Imp.
ChooseOption('xamine');//Selects Examine.
FrDTM; //Free DTM's after Code.
end.


This should be the result both on the debug box and in the RS Client ^.^

It is that simple to find 3D objects and to click on them. It doesn't matter if we are left-clicking a DTM to attack for example a monster or to activate and object such as for example a stairwell or an entrance into a cave. If we are right-clicking, we can use this to right-click bank booths, chests, or even moving banks like there are found at many locations. The possibilities are endless and you can use this to click anything you want, accurately within seconds.

It is not searching for the time it doesn't move, it just only searches one I hit the play button ^.^ Most of the time I was actually waiting for the Imp to move to prove that it works from any angle but you probably discover with your script or mine that this is indeed truth =) This concludes Chapter 5.



This is what I could rescue from my DTM tutorial, Chapter 6 and the pictures and videos are gone but the code is still there and the instructions should still be clear. This is for reference for those who want to learn about DTMs.

Mr Stoj
03-16-2012, 03:42 PM
nice guide, i think i read part of the original

is it bad practice that i do set procedure for freefree dtm?
does it affect cpu?

how i normally do it is

If FindDTM(derp derp, X, Y, MIX1, MIY1, MIX2, MIY2) Then
begin
//Writeln('doing the derp.');
Mouse (x, y, 0, 0, true);
FreeDTM(derp derp);
Wait(100);
end;
end;

or just type Freedtm(Derp derp) when its no longer needed.

Paradoxium
03-16-2012, 04:28 PM
So it got erased?...

Nemesis3X
03-16-2012, 05:41 PM
Happy to see you put it back, Your tutorial is DTM did help me a lot learning on how to use it correctly :-)

rice
03-17-2012, 02:09 AM
YAY, I'm excited to see your topic back. what happen to the original?

RightClick
03-17-2012, 08:37 PM
What happen with the one with picture ? :o

Joe
03-30-2012, 11:22 PM
Thanks so very very much! I didn't know there was a DTM editor in simba. Also, I didn't know about 3d DTMs... This by far has been the most comprehensible DTM tutorial. Great job!

sfs
05-15-2012, 06:27 PM
It seems to work well until the stepping stones -- and then after successfully completing them, it runs back and does them again. I'm not quite sure what the problem is.

Very nice script, it seems you've definitely put a lot of work into it. Thank you. :)

Subliment
05-16-2012, 08:22 PM
I'm still doubtful about this being human when clicking 3D objects.. don't you think?
But nevertheless, I will try it, because I'm in dire need of a method to surely click a moving object/NPC
Thanks for your efforts!

blother
05-27-2012, 07:27 PM
Love the guide, but are there supposed to be pictures? I feel as though it is written with pictures involved, but I don't see any. Am I just not seeing them or am I just wrong about it?

Etrnl Fear
07-29-2012, 10:25 PM
Fully working Oak cutter/burner, thanks to you. :)

Nebula
07-31-2012, 05:35 PM
Great tutorial for teaching people how to use DTMs.

You'd save like 200 lines if you use a for..to..do loop while DTM walking though.

[F]aceless
09-16-2012, 01:29 PM
where are the pictures?

Solar
09-16-2012, 01:34 PM
aceless;1100334']where are the pictures?

If you read the whole tutorial, at the bottom it saids that it's basically what he could save from a previous tutorial.

Athylus
08-15-2013, 07:38 PM
I got the hang of it finally.

I... I FEEL AMAZING! THIS is how I feel right now (http://www.youtube.com/watch?v=o2AlmwGxDRI)

I love you demise, for real.

Aaaaand it's not working anymore. I'm beginning to give up on this. It won't be long before I buy VIP and go back to powerbot, lol. Seriously how is not working anymore when I changed NOTHING in the script. Now it will just stop the script immediately and say succesfuly executed. Lol...