Using and Creating DTM's for begginers by Mad Cow What is a DTM? The term DTM stands for Deformable template model. A DTM is like a FindColor command only in order for the DTM to be found, SCAR will look for multiple colors with a specified tolerance in areas of your choice. How do I open the DTM editor? Easy. Open SCAR and click Tools -> DTM Editor Is a DTM better than a bitmap? What's the difference? Bitmap = Searches for a picture file DTM = Searches for multiple colours in various locations So in my opinion, DTM's generally are better than bitmaps though in some areas bitmaps are more effective. For instance, loading a big bitmap may lag your computer whilst DTM's are usually fairly small in size. Making a DTM 1) Creating a DTM Open Runescape or whatever you are creating the DTM for then open the DTM editor. Now lets create out first point. In the DTM editor click on the item you wish give the x, y cords to when the DTM is found. Eg. Note that I increased the tolerance to 20? Well this is just incase we can’t find the Log; we will look for the closest colour to it. We do not need to increase the area as this is the first point. 2) Adding points to a DTM Now to create some points. Click on another area such as the Inventory Bag and once again, increase the tolerance. Now increase the area by lets say 10 just to make it so if the colour moves slightly, it will look in that area box for the specified colour. Eg. 3) Testing your DTM Now add some more points if you wish. Don't add any more than 5 or it may not be able to find the image. Save the DTM and now its time to test it . Click on Test -> Find DTM and if it found it. You have successfully created a DTM! If not, go back to step one and start all over. 4) Implementing a DTM into a script Now we have our DTM, we have to add it into our script. Go File -> DTM to Text. You should get a random bunch of letters and numbers. Now lets create a new procedure. Code (Text): program DTM_Tutorial; procedure LoadDTM; begin end; begin end. Now lets copy that piece of code into our procedure and rename it to whatever you want. We also have to declare the variable. You should now have something like this: Code (Text): program DTM_Tutorial; var TutorialDTM : Integer; procedure LoadDTM; begin TutorialDTM := DTMFromString('78DA63F464666038CDC8800C2202141844803' + '448F43F10307603D52C80A8E182AAF977D60BAE06040059550957' + ''); end; begin end. Now that we have done all of it. The last part is to call upon the procedure in our main begin. You should now have: Code (Text): program DTM_Tutorial; var TutorialDTM : Integer; procedure LoadDTM; begin TutorialDTM := DTMFromString('78DA63F464666038CDC8800C2202141844803' + '448F43F10307603D52C80A8E182AAF977D60BAE06040059550957' + ''); end; begin LoadDTM; end. Now lets test that there are no errors. Try running the script and hopefully you should get: Code (Text): Successfully compiled Successfully executed 5) Finding the DTM Now you have all of the code lets attempt to find the DTM. Lets see what we need to do. function FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Integer; Now let me explain. DTM : Integer = The name of the DTM. Eg. TutorialDTM x, y : Integer = Where to save the cords when/if the DTM is found. x1, y1, x2, y2: Integer = The area to find the DTM in. Now we need to declare x and y as integers. Once you've done that we will add UNDER the procedure "LoadDTMâ" a simple Code (Text): if(FindDTM(TutorialDTM, x, y, 545, 10, 746, 223)) then WriteLn('The DTM was found'); Essentially, we would replace the ‘WriteLn('The DTM was found');’ with something like "ClickMouse(x, y, true);" or a Mouse procedure from an include. Now your final code should be something like this: Code (Text): program DTM_Tutorial; var TutorialDTM, x, y : Integer; procedure LoadDTM; begin TutorialDTM := DTMFromString('78DA63F464666038CDC8800C2202141844803' + '448F43F10307603D52C80A8E182AAF977D60BAE06040059550957' + ''); end; begin LoadDTM; if(FindDTM(TutorialDTM, x, y, 545, 10, 746, 223)) then WriteLn('The DTM was found'); end. Congratulations! You have successfully created a DTM! If you enjoyed this tutorial please post good or bad feedback.
this looks great i have had a little experiance with these before but not much i think for my next version of t/u i will use these instead as it is a bit slow in searching for all of the cards