PDA

View Full Version : dtms?



shadowblade
12-05-2006, 08:41 AM
what esactly are dtms and how do they work iv read the scar.exe tut but still kinda confused could soemone explain how this could be used to find auto color finding funstions like finding the colour of ur pik
heres a line of dtms i dont understand could someone please explain it to me?

if(finddtm(pick,x,y,invx1,invy1,invx2,invy2))then
pickcolor := getcolour(x,y);

if this can find a pik can it be used to find anything else?

Bramble
12-05-2006, 11:27 AM
dtm means deformable template model

ok from the amount that i understand dtm's is,

if you were to use a dtm to auto find color, for example your pickhead, first youd have to make a dtm, to do this you have to go into runescape get the item you want to make a dtm of and put it in your inventory, take a screenshot, open up paint program,paste the screenshot into paint, now go back to scar and target the paint window, then go to the tool tab and click dtm editor, now a window should popup with the picture that u pasted into paint, select your parent dot(the parent dot should be the color that you are trying to find) from there every click you do sets the perimeter of the item(this is how it finds your dtm) i suggest clicking on the black outline so that in the zoomed in window u see black in the very center. i suggest making 4 lines to the perimeter of the item, now inside the dtm window there is something called tolerance, tolerance means how much do you want your color to vary, for this project you will set the parent dots tolerance because that is the color that changes, since its automatically on the parent dot raise the tolerance to 25. then go to file>save, and save it as something u can remember ex.pick.
now go to file, and click dtm to string, now close the dtm window out, in scars information box below where u put your script in you should see something like

DTM := DTMFromString('78DA63CC636260886464400697CF9E65100 1D' +
'220D1FF40C0980654138CAA06220B23817406504D2C013515 4035' +
'A104D49403D5F8E2570300734A0A71');

copy this code(do not copy mine as that is a dtm of a tuna) and paste it into your procedure or function in your script, change the VAR, DTM to something like Pickaxe or Pickhead.

now what you did earlier, finddtmin(blah blah blah), it actually means findtmin(your dtm name,x result coord, y result coord, most left x coord, top most y coord, most right x coord, lowest most y coord) ex finddtmin(Pickaxe,x,y,5,5,500,400)

now to get the color of your dtm you have to use function getcolor. ex getcolor(x,y), you would call this right after u find your dtm

now whenever your using a dtm, remember when your done using it to free it ex: FreeDtm(Pickaxe);

i hope this helped, if not try downloading drigers tutorial.

Wrycu
12-05-2006, 11:58 AM
Do dtms work on an item which is constantly shifting color, but the color it shifts to are always the same?

Hey321
12-05-2006, 12:25 PM
a dtm will look for matching pixels. I suggest taking 4 or 5 of the same pick, making a dtm of one, and checking the matching pixels XD.

Wrycu
12-05-2006, 08:13 PM
I need something to go through a portal (the kind that glows), so could it work?

Hey321
12-05-2006, 08:26 PM
get 4 different portals from 4 different alters then try it :). Put them all in one image make one the dtm and look at it. I'll go test it using the air altar, ill edit post with results

TOB
12-05-2006, 08:34 PM
If you make a DTM of an item in your inventory it won't find it on the ground because its a different picture.

shadowblade
12-06-2006, 07:25 AM
ok thanks for yout help

Wrycu
12-06-2006, 12:03 PM
I need it for the fire place portal. Ill attempt to do it myself and edit with how it went if noone else has posted.