PDA

View Full Version : Yohojo's DTM Tut 1(Item finding with DTMs)



YoHoJo
04-07-2006, 01:47 AM
Update: Learn all of the below in a video I created found here:
http://www.youtube.com/watch?v=SlS4q9MiFX4



*Well i love DTMs and decided to share my knowledge with all of the other scripters. In this tutorial i will show you how to make DTMs for locating items on Runescape and MapWalking*

Whats a DTM?

• DTM stands for: Deformable Template Model.

• A DTM i a special point on the screen that SCAR recognizes by how far it is from certain points and colors


Why use DTMs?

• DTMs are easy to make once you know how. They are also very precise and accurate

• DTMs are easier to make then bitmaps and DTM codes are a lot shorter than bitmap codes.


How to make a DTM to locate an item

• In this first have of the tutorial i will show you how to use DTMs to locate items on the runescape bank screen or inventory. DTMs can not be used to find items on the mainscreen because there are many camera angles ect...

Step1:
• The first thing you should do when making a DTM for an item is get a picture of that item.

• This can be done by logging into runescape and getting a picture of the item you want. Do this by putting the item in you inventory or bank account and pressing thehttp://i15.photobucket.com/albums/a399/yohojo88/PrintScreen.jpg key.

• BUT it you are a Ub3R /\/0ob and dont have the item you need just go to a runescape help site and find a picture of the item there.
After this open a paint document and paste the picture there.


Step2:
• Now you should open up a SCAR CDE and drag the corsshair to the paint screen making shure you can still see your picture.

• Then you should go back to your SCAR CDE and click Tools>DTM Editor:
http://i15.photobucket.com/albums/a399/yohojo88/tools.png

• Congrats! You have just opened up the screen where all DTMs are made. Now the first thing you should do is click the middel of you item. After that your screen should look something like this:
http://i15.photobucket.com/albums/a399/yohojo88/Parent.jpg

• The info on the right tells the x and y coodianates and the color of the point you just clicked. Because this is the first point you clicked it is called the Parent. The parent is the point that SCAR refers to when you do anything with the DTM.

Step3:
• Now we must create some "links" to make the DTM unique. Jagex made making DTMs for items oh so easy for us by outlining all of their items.

*CONTINUED BELOW*

YoHoJo
04-07-2006, 01:48 AM
*CONTINUED FROM ABOVE*

•As you can see in the top left corner of the DTM editor there is a close up of a 9 pixel square. This helps us be more prcise on picking our points. And EVERY item in runescape is oulined with a onc pixel long black line. So now move your mouse arround your item and when you see some of the black outline in the center of the 9 pixel box click. After you click your first point it should look something like this:
http://i15.photobucket.com/albums/a399/yohojo88/DTMoutline.png

• You have just created you first "link"! This liink shows the distance from your parent to the outline of your object. Now all you have to do is create a few more links arround the outline of the object like so:
http://i15.photobucket.com/albums/a399/yohojo88/DTMlinks.png
NOTE: Try not to make a link at the top left corner otherise it wont work for stackable items or if you have multiple in your bank!
Step4: Making the DTM "Universal"
Runescape Updated, 131072 is now the black color. So make sure the color on your outline points is 131072
• Now we must make the DTM what i call "Universal" meaning it works for all items of the type. Example: All logs have the same outline so the back color is ok. BUT my parent has a unique color so it will only work work normal logs.

• So all you have to do to make your DTM universal is add some tolerance to the parent point. So now click the info about the parent and change the tolerance to 255(MAX):
http://i15.photobucket.com/albums/a399/yohojo88/255.png

Step5: Saving and Testing the DTM

•Now we must save the DTM:
http://i15.photobucket.com/albums/a399/yohojo88/Save.png

•After this we must test it. So now exit out of the DTM editor and find/take a differnt picture of the same item. Then click DTM editor again so the picture will be displayed.

*CONTIUED BELOW*

YoHoJo
04-07-2006, 01:49 AM
*CONTINUED FROM ABOVE*

•Now we must test to see if your DTM works. So click:
http://i15.photobucket.com/albums/a399/yohojo88/FindDTM.png

• If it worked correctly you should see somthing like this:
http://i15.photobucket.com/albums/a399/yohojo88/aaaa.png

Step6:: Useing your DTM in your script:

•Using a DTM in a script is similar to using a bitmap in a script. First you must convert you DTM to text. So open up the DTM editor and click File>Open>Where ever your DTM is saved and click
http://i15.photobucket.com/albums/a399/yohojo88/Dtmtotext.png

•Now exit out of the DTM editor and look in the SCAR report box you should see somthing like this:


DTM := DTMFromString('78DA63AC666460286740017509960CFF813 45' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A 202B' + '8B809A26202B13BF1A0034E80BCD');


•See where it says "DTM" before the :=? That is where you name the DTM anything you want to!

•Now all we have to do it use it in a script like a bitmap. The FindDTM function goes as followed:


FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Integer


•This is what all of they variables mean
DTM= Name of Your DTM
x,y= The x,y cords that the dtm is it. (Scar finds this)
x1,y1,x2,y2: The box in which SCAR tries to find the DTM in

•So here is an example of using this DTM in a script:


program New;
var Logs,x,y:integer;
begin
Logs := DTMFromString('78DA63AC666460286740017509960CFF813 45' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A 202B' + '8B809A26202B13BF1A0034E80BCD');
if FindDTM(Logs,x, y,1, 1, 200, 200) then
writeln('Congratz! You have just found your first DTM!')
end.



And this concludes Yohojo's DTM Tutorial

Sdcit
04-07-2006, 01:53 AM
nice tutorial :PXD

Neonknight77
04-07-2006, 01:58 AM
Did Sdouble teach you this?

Jagex_Fagex
04-07-2006, 01:58 AM
why do i see all the tutorial as huge wide blocks? like Sdcit's post is normal, and everything above is wider than normal

YoHoJo
04-07-2006, 02:00 AM
Jagex: Its because i got big ol pics

Neon: Yes, Sdouble toght me the concept of making DTMs like that

WhiteShadow
04-07-2006, 02:21 AM
Lol, Yohojo you release this on every forum. :p

It's good.

YoHoJo
04-07-2006, 02:24 AM
Its good to learn =)
And thz to starblaster for recovering it from kaitnieks!

The Un-Named
04-08-2006, 12:19 PM
I rep'd you on kaitnieks for this. It's very good. :)

YoHoJo
10-28-2006, 07:03 PM
cmon guys anyone else wana learn DTMs?
they are usefel!=)

lardmaster
10-28-2006, 07:45 PM
i learned DTMs from this!. very useful

Bramble
11-27-2006, 09:32 PM
thank you for creating this guide, i am going to follow it closely and tell you how i do, thx alot

wow works great, and it makes me understand and use dtms pretty well, mad props for the guide, and thanks again, this is code i came up with
and this code only searchs your inventory for the logs, im gonna try and make it so it stores all in bank, so ill have to learn how to search for rs2 text so i can store in inventory

program New;
var Logs,x,y:integer;

begin
logs := DTMFromString('78DA639466606010674001BE969C0CFF813 42' +
'310FF07024611208397010D302291405A8A08359A40429280 1A45' +
'202147400D3711E608030945FC6A008B9706F2');
if FindDtm(logs, x, y, 550, 200, 740, 470) then
writeln('congratz! You have just found your first DTM!')

end.

YoHoJo
11-28-2006, 12:13 AM
This will bank all logs after you open the bank:

program New;
var Logs,x,y:integer;

begin
logs := DTMFromString('78DA639466606010674001BE969C0CFF813 42' +
'310FF07024611208397010D302291405A8A08359A40429280 1A45' +
'202147400D3711E608030945FC6A008B9706F2');
if FindDtm(logs, x, y, 550, 200, 740, 470) then
Begin
Mouse(x,y,5,5,false)
Wait(200+Random(1000))
PopUp('Deposit All')
end;
end.

someone
12-04-2006, 12:09 AM
Hey there people, just got back from being away, now that this hunter skill has been introduced, now, the thing is, im not sure if im really getting this right, can someone(not me, ffs) tell me where i might be going wrong, its compiling successfully, but the writeln is not tellin me 'congrats'

program New;
var barbtail,x,y:integer;
begin
barbtail := DTMFromString('78DA63F4676260D060644006D19EC60CFF8 13' +
'448F43F103082D4A8A0AA81C8C24820ED0254638C5B0D187B 00D5' +
'68E356C304A2FD80A40E0135A140520DB71A16101D0954A34 0404' +
'D30508D3C7E35004D5D09C7');
if FindDTM(barbtail,x,y,1,1,200,200) then
writeln('congrats')
end.

YoHoJo
12-04-2006, 12:54 AM
If its not saying crongrats its not working
either the DTM you made doesnt Follow the rules i made ^ OR
the DTM isnt within the cords (1,1,200,200)

Also iv noticed that the outline of Hunter still isnt 65536 like all other skills and items
maybey jagex messed up =p

try again, if it doesn work ill help you out

someone
12-04-2006, 02:07 AM
weird, when testing the dtm, it can find it, but when i try run, it just wont say the congrats bit

YoHoJo
12-04-2006, 02:55 AM
well remember like i said
make it properly
remember to put 255 on your center point
and then click border (black) outline of it
Also like i said the outline is kinda weird so add a tolerance of about 20 to the outline points

and also, it should always work when you test it..
if you make a DTM with a pic, and test it on the same pic its always going to fin it
to test it better, exit out of the DTM Editor, and enter it again and then test

Make it just like you would for an item even though your are doing it for a Skill Picture

Here try this

DTM := DTMFromString('78DA63BCC0C8C0E001C448C0C1C28EE13F9 00' +
'689FE0702C6D340961DAA1A5111110639A81A1060BC4A849A 3340' +
'962F01355708AB0100F8530CA0');

someone
12-04-2006, 03:09 AM
ahh sweet, got it now dude, thanks man, looks like ive just stuffed up making the DTM, its a tricky one tho that barbtail poon, need a still hand lol

YoHoJo
12-04-2006, 03:17 AM
lol i just tried making some and i cant get it
tell me if yours works all the time
i just tried making 5 and none worked!
ill get one eventually
happy yours worked good job

someone
12-04-2006, 03:25 AM
crap, im probably waaay ahead of myself here but:

program fisher;

var barbtail, x, y: Integer;

procedure findbarbtail;
begin
barbtail := DTMFromString('78DA63BCC0C8C0E001C448C0C1C28EE13F9 00' +
'689FE0702C6D340961DAA1A5111110639A81A1060BC4A849A 3340' +
'962F01355708AB0100F8530CA0');
if FindDTM(barbtail,x,y,1,1,200,200) then
writeln('found barbtail');
end;

procedure equipbarb;
begin
function ClickMSDTM(DTM: Integer): true;
end;

begin
findbarbtail;
equipbarb;
end.


result:
Failed when compiling
Line 15: [Error] (15:1): Identifier expected in script


why?

YoHoJo
12-04-2006, 09:57 PM
ROFL
replace
function ClickMSDTM(DTM: Integer): true;

with
ClickMSDTM(barbtail)

dontpanic
12-04-2006, 10:48 PM
One quick question about dtms, what is the area size and shape? Is it like the tolerance of where the point can be or is it the actual area of the point or something else?

TOB
12-04-2006, 10:54 PM
I think with DTMs where their is more instances of the color than just the parent you will have to add to the area field for the parent. TY for help on MSN yohojo.

tarajunky
12-04-2006, 10:54 PM
The Area Size is like a position tolerance. So, if the point moves around like something on the minimap would, you will still pick it up as long as that point falls within the area you specify. I've had the best luck with the normal square area shape and increasing area sizes as necessary.

This is NOT needed for items in inventory, since they do not change size or shape. Also, do NOT increase the area size for the original parent pixel. That will just make it lag as it searches every point multiple times, and it won't find things any better. Only change the area sizes for surrounding pixels.

TOB
12-04-2006, 10:55 PM
Actually I was trying it for a kebab and it wouldn't find it until yohojo told me to add an area of 2.

YoHoJo
12-04-2006, 10:59 PM
yea i added an are of 2 and it works well now
another DTM successfully made!

dontpanic
12-04-2006, 11:02 PM
tarajunky, thanks very much for sorting that out! I could never figure that one out, but now i finally know :)
Anyway, why would someone ever use a cross or x as the area shape?

tarajunky
12-04-2006, 11:09 PM
The only reason to use a cross is if you know the color is going to be in a vertical or horizontal line around that area. Let's say that there will be a wall on the minimap within 20 pixels of a symbol you're looking for. Well, the symbol will move around, so the wall might be 5 pixels away, or it might be 20. If you put a size 20 square, SCAR will have to search 20x20 = 400 pixels every time it tests a point for your DTM. If you use a 20 pixel cross it would only have to search 80 pixels instead of 400.

That said, I don't think I've ever used a cross or an x. Even if it worked, I always ended up changing the DTM around until it worked better with just squares.

dontpanic
12-06-2006, 01:29 AM
oh, ok, thanks

YoHoJo
02-13-2007, 07:42 AM
New people of the community, LEARN DTMs!
bump

dario69er
02-13-2007, 08:08 AM
yohojo this is from ur wc scrip wat does it mean man

line 166: [Error] (3520:4) unkown identifier 'find0bjex' in scrip..

t3hl33tn00b
02-13-2007, 12:02 PM
yohojo this is from ur wc scrip wat does it mean man

line 166: [Error] (3520:4) unkown identifier 'find0bjex' in scrip..

i didnt look at the script yet but im guessing that is supposed to be findobj

not sure though i'll check for you

YoHoJo
02-13-2007, 03:23 PM
yohojo this is from ur wc scrip wat does it mean man

line 166: [Error] (3520:4) unkown identifier 'find0bjex' in scrip..

That script is three years old... it doesn't work.

JAD
02-23-2007, 04:27 PM
well its a good tut. but you left out 1 thing for noobs like me :P when i press print screen, where does it save picture too? and for pressing it, do you have to hold print screen or just tap it and let go? its a good tut, if i could ever find the picture i think i took :P

Boreas
02-23-2007, 09:48 PM
Saves to memory. Just paste and it will be there. Tap.

JAD
02-23-2007, 10:31 PM
how do i open memory? lol. sorry I'm new to the whole print screen thing.

Boreas
02-23-2007, 10:39 PM
Pressing printscreen is like highlighting a picture and pressing ctrl+c. It's saved into the memory, so all you have to do is paste (crtl+v) like usual

JAD
02-25-2007, 05:32 AM
Oh OK awesome! thanks ALOT Boreas for helping me with that, and thanks for making tut yohojo for making this uber tut :) this really helped me and now i added DTM's to my dropping procedure for my power miner :)

n3ss3s
02-26-2007, 06:47 AM
You people here at villu seem to make very good TUTs.
Every TUT you look at here you know right at the moment whats going on.
GGGOOOOOOOOOOOOOOOOOOOOODDD!!!!

YoHoJo
02-26-2007, 07:38 AM
Gheeheehee Thanks,
maybe I should make more =).

JAD
02-26-2007, 06:32 PM
Gheeheehee Thanks,
maybe I should make more =).

you should :) this tut was the uberist ever lol.

IEatJ00erBaybees
03-05-2007, 10:01 PM
Cool! Awesome tutorial. Helped me a load.

But here's the question. What can I use these for? I could just use

DropTo(2,28)

to drop things, so I don't necessarily need it for that.

To autobuy something possibly?

What else could you use it for?

Boreas
03-05-2007, 10:07 PM
Well once you get past writing powerminer/choppers you will want to drop or use certain items, and you won't know what spot there are in, so you will use DTMs (mostly of the black (65536) outline).

Yes you can use for buying in the same way.

For withdrawing from banks you can use them in the same way (or you can use BlackLists which work similarly, link in sig).

You can also use them for finding things on the minimap (theres a knack to making good ones) and sometimes on the mainscreen (even bigger knack).

seaking
03-06-2007, 12:50 AM
Great Script! Using DTM's now in a "smelter" that will probably die eventually because I will get bored but... still, it's a start :-p

Pinqvin
03-09-2007, 01:24 PM
Nice tut. Helped me out a ton on making DTM's! Rather easy ;)

YoHoJo
03-11-2007, 09:02 AM
Cool! Awesome tutorial. Helped me a load.

But here's the question. What can I use these for? I could just use

DropTo(2,28)

to drop things, so I don't necessarily need it for that.

To autobuy something possibly?

What else could you use it for?

DropTo(2,28) drops all items from slot 2 to 28.
This would include
money
gems
random event items
extra pics
extra axes.

Using dtms would only drop specific items instead of everything.

And to everyone else.
Im glad you like this tutorial im happy it's so helpful to you all =).

gsquare567
03-17-2007, 02:52 AM
honestly, your teaching skills are impressive. great tut. say, in an autofighter, how would you use dtms? also, a) do they take longer to find than colors (compare finddtm to findcolor), and b) if you can't use them on the mainscreen, that means you can only find them for inventory items and randoms i guess. this is probably very useful for randoms, but for inventory items, you will rarely need this because color-finding can do the same, that is unless the answer to a) = false ^^ this is not criticism on your tut, which is amazing, just on the use of dtms to regular scripters. thanks!
EDIT: can this be used for things like coins and arrows, that as they stack, their picture grows? and i also just tested it. your tut is so clear, got it on first try! and i'll remember not to do top-left corner and set to 255 to make it universal. such a great tut omg!
EDIT AGAIN: can you help me with dtms to make this function better...

{************************************************* ******************************
function PopUp(Option: String): Boolean;
By: RsN
Description: Finds Popup menu, then clicks Option.
************************************************** *****************************}

function PopUp(Option: string): Boolean;
var
Top, Bottom: TPoint;
dtmTop, dtmBottom, x, y: Integer;
begin
dtmTop := DTMFromString('78DA63146464606801622C0026CA2800643 5A' +
'3AA890D7147552345841A90393D04D4880259DD04D4880359 ED04' +
'D4280059AD04FC2504644DC4AF06000DC909E0');
dtmBottom := DTMFromString('78DA635CCCC8C070198891406C883B98868 93' +
'22E02B22EA1AA8101B89A8540D64522CCB948843984EC02B9 F910' +
'01BBA610E1AF6944D80572F311026AE6005967F0DB05007BD 4134' +
'5');
if (FindDTM(dtmTop, Top.x, Top.y, 10, 10, 764, 502) and FindDTM(dtmBottom,
Bottom.x, Bottom.y, Top.x, Top.y, 764, 502)) then
if (FindText(x, y, Option, upchars, 0, 0, Bottom.x, Bottom.y)) then
begin
Result := True;
Mouse(x + Length(Option) * 3, y + 2, 4, 3, True);
Wait(150 + Random(200));
end else
if (FindText(x, y, 'Cancel', upchars, Top.x, Top.y, Bottom.x, Bottom.y))
then
Mouse(x + 3, y + 2, 4, 3, True);
FreeDTM(dtmTop);
FreeDTM(dtmBottom);
end;
i'm not entirely sure where the dtms are and how to use them when using a popup, but this function doesnt always work for me. pls help.

YoHoJo
03-17-2007, 08:52 PM
The pop up function works fine.

What do you need help with,
All you need to do is something like:

If FindDTM(Logs) Then
Mouse(x,y,3,3,false)
PopUp('Drop')

And im glad you liked my tut =).
Happy you found it easy to understand.
That was the point, very clear, explain everything, even where the Print Screen button is :p

gsquare567
03-21-2007, 02:01 AM
ok, got a real question about dtm for u.
i made a rune arrow dtm:
DTM := DTMFromString('78DA63DCCEC0C0308B910119B86BB032B00 26' + // rune arrow
'990E87F2060DC07644C445503918591407A3790E827A0662B 9058' +
'4240CD0620B118BF1A004D7F0B1F');
i set the tolerance to 5, then when i tried it on the mithril arrow, it also worked, which isn't really what i want. how can i make it specific to the arrow i want?

Mjordan
03-21-2007, 03:31 AM
ok, got a real question about dtm for u.
i made a rune arrow dtm:
DTM := DTMFromString('78DA63DCCEC0C0308B910119B86BB032B00 26' + // rune arrow
'990E87F2060DC07644C445503918591407A3790E827A0662B 9058' +
'4240CD0620B118BF1A004D7F0B1F');
i set the tolerance to 5, then when i tried it on the mithril arrow, it also worked, which isn't really what i want. how can i make it specific to the arrow i want?


hmm that would be pretty tricky I'd think. Since both arrows are pretty close to the same color, I really dont know what you could do. Just dont have any mith arrows in your inv or something? Im sure there is a way though, anyone know?

gsquare567
03-21-2007, 04:48 PM
does dtm only work with black spots?

Mjordan
03-21-2007, 06:05 PM
does dtm only work with black spots?

nope

legendaryhero90
03-21-2007, 11:48 PM
great DTM tut...but my DTMs still cant be detected... such as the DTM of the Shopkeeper's head

gsquare567
03-22-2007, 02:27 AM
ok, so i made a dtm with a stack of iron arrows and made one of the points the arrowhead color, and i tested it in the dtm editor and it worked on tons of different pics, but then i go
if(FindDTM(arrowdtm,x,y,10,10,721,298)) then MMouse(x,y,5,5);in my script and it cant find the dtm. even if it was the same as in the picture. help?

EDIT: nevermind. never forget to put a procedure you made that loads the dtms into your main code! lesson learned =)

YoHoJo
03-22-2007, 04:00 AM
great DTM tut...but my DTMs still cant be detected... such as the DTM of the Shopkeeper's head

DTMs most preferably work on 2d things like inventory and bank because they are more constant.
Making DTMs of things on 3d main screen is much harder, though it IS possible.

Which shop keeper are you making DTM for?
Ill try for you.

da_professa
03-24-2007, 11:47 PM
great DTM tut...but my DTMs still cant be detected... such as the DTM of the Shopkeeper's head

For That I think (not 100% sure, he should know), you need to set tolerance not only for the middle dot but for rest of the dots too. This is because for invo and items, the black colour does not change, but for the head it does..

RudeBoiAlex
03-26-2007, 06:02 PM
1 question when u see and x in the dtm picture mine says do u want to change the current postion or something but it still has an x tho do i save that 1 and put dtm to string or watever

king vash
03-26-2007, 06:43 PM
i can't get dtms to work even with this beautify guide, i choose like 10 points and it works with all my pictures but when i try ingame it stops working? i'll post the script in a second.



code:

program New;
var hides,x,y:integer;
begin
hides := DTMFromString('78DA6314636060506340010BA74E65F80FA 41' +
'981F83F10300A0019AAA86AA67675321841D58000233F9090 4755' +
'73E2E0415435E240420655CDCA797351D5C863AA59BF6409A A1A0' +
'520A184A666D1224C359AA86AB6AE5E85E91E3D5435A70E1F 4255' +
'C387A9262E530A450D00AFD0197C');
if FindDTM(hides,x, y,1, 1, 200, 300) then
writeln('Congratz! You have just found your first DTM!')
end.

rkroxpunk
03-27-2007, 08:09 AM
Ok soz i'm nooby at this. but if you have something like an Ore which has gaps in the one picture do you make a DTM of just one little bit of the Ore that doesn't contain a gap or not? hope that made sense

YoHoJo
03-27-2007, 08:02 PM
Ok soz i'm nooby at this. but if you have something like an Ore which has gaps in the one picture do you make a DTM of just one little bit of the Ore that doesn't contain a gap or not? hope that made sense


I understand, took me a while though.
For your parent point, click anywhere on the ore.
For the other points just click ANY black outline doesnt matter if there are gaps or not.
Any black outline along any part of the ore will work fine.


And king vash

Make sure you are doing everything propperly.
For your first point, click anywhere on the white of the hide.
Then click around the outline, making sure you are clicking the BLACK points.
10 is what i said in the tutorial, but 5 or 6 points will be enough and leave less room for error.
Also remember to change the tolerance of the parent (first) point to 255.

gsquare567
03-29-2007, 10:49 PM
what?! you can change tol for every point! that just helped me so much thanks!

edit: now i get "Access violation at address 00652566 in module 'scar.exe'. Read of address 00000020." when i try to test "Find DTM" help?

Smartzkid
03-29-2007, 11:12 PM
Are you sure that you set the dtm?

PM the test script to me, and I'll be glad to help

gsquare567
03-30-2007, 02:29 AM
nvm i fixed it. well not really fix, just made a similar one that works just as well. i think it didnt like me highlighting two points and setting their tolerance at the same time, if you know what i mean. im so happy yohojo pointed out multi-point tolerance.

YoHoJo
03-30-2007, 02:52 AM
You normaly get a runtime error when you change the tolerance/area size of points other than the parent.

To fix this, just click each of your points one by one at the top right, and change the drop down menu to the parent point.

Ill post an example of how to fix that for others.

the scar noob
04-03-2007, 06:16 PM
This tut owns!!
Really thank you yohojo!! I like it that much that i even saved a link at my desktop from this page :p
Thanks to you i was able to make my first DTM, a DTm from a fish, a pike :p
DTM:
program New;
{.Include srl/srl.scar}
var Pike:integer;
begin
Pike := DTMFromString('78DA63146160609064400131B5E10CFF813 42' +
'310FF0702460E204381010D302291405A1C48081050234184 392A' +
'404290801A4520C145400D1F909020A0861F4828E15703002 79F0' +
'7AE');
if FindDTM(Pike,x, y,MIX1, MIY1, MIX2, MIY2) then
writeln('Congratz! You have just found your first DTM!')

end.


Line 174: [Hint] (182:43): Variable 'NEWLINE' never used in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar
Congratz! You have just found your first DTM!
Successfully executed

Thanks yohojo!!

EDIT: is the DTM from a pike, a trout and a salmon the same or should i better make one for each??

YoHoJo
04-03-2007, 09:05 PM
If it works ita all good.
But if you would like a DIFFERENT dtm for each then make the tolerance of the parent point smaller like 30-50 and you can have a DTM for each.
But if thats not necessary for your script, then one DTM should over it all.

Im happy to see you happy! =)

rkroxpunk
04-08-2007, 12:37 PM
??? soz if someone already asked this but how do u make a DTM on the mm..there's no black outlines on anything. for example i want my script to find the 4 bankers at varock east bank on the minimap which appears as four yellow dots can i use DTM's cos that's what wizzup? uses..or should i use bmp's?

YoHoJo
04-10-2007, 07:32 AM
Well DTMs for minimap are a bit harder beacuse its not constant.

Just make the parent a big color and the other points something else thats pretty big.
And on each point change the are to about 3-5 pixels.

Its a bit harder but after some trial and error it should work.

For bankers, just click middle yellow dot, and one to right and left.
Add a tolerance of about 50, and area size of about 5.

Make sure you make the compass at the same angle before finding the DTM.

rkroxpunk
04-10-2007, 10:17 AM
hmmm ok thx

EDIT: Also does that count as spam cos if it does what do you do instead of saying thx cos rep is pretty pointless on this forum

YoHoJo
04-11-2007, 03:17 AM
Yea i saw you repped me.
Too bad it didn't add any

It goes like this
Every 15 points of reputation the rep GIVER has=
1 point + rep to the RECEIVER.

And nah i dont count that as spam.
More of a 'notification that you understood by reply', scientifically speaking that is :p.

rkroxpunk
04-11-2007, 03:43 AM
Get this...I made a DTM of the Bankers on the MM at VEB and i tested it and it said it found it but when i use it on rs it says it doesn't find it..... any ideas?

also i see that you've copy busted 11 more guys since mine. is it really getting that bad? lol cya

YoHoJo
04-13-2007, 12:22 AM
Meh some people think that its getting wose, but i dont think so.
Sometimes theres a lot, sometimes there arent, its random.

About the DTM, yeah like i said its very hard to make them for the minimap, i would just try to learn radialroadwalk and use that instead.

But if you are stubborn like me, add me on MSN and i can give you some personal help.

Im glad to see that you are actually trying to learn =).

~alex~
04-13-2007, 09:28 AM
Yay I love DTMs now :D

YoHoJo
04-20-2007, 08:34 PM
=0 Glad i could help.
DTMs are my best friend, fast easy, and reliable.
0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0o O0oO0oO0oO0oO

Gwallunit
04-21-2007, 10:47 PM
Wow this is ace

Im gunna really practice on DTM's

joshie
04-27-2007, 05:52 PM
nice tut, very noob proof:P
(i think i just called my self a noob...)

i'm going to start scripting soon so expect something uber:)

wobbii
04-28-2007, 05:11 PM
hey nice tut, dtms are really cool and now i can use them in my scripts :) thx alot!!!

YoHoJo
05-03-2007, 08:51 PM
Yeah thanks.
I love DTMs for items.
Since they only look for a few point they are a few precious milliseconds faster than bitmaps, and i think they are fun to make.

Glad I Could Help.

Tazzie 02
05-16-2007, 06:23 AM
Thanks for maing this tut man... it's great!
This will help me with my scripts.
Thanks again :)

Tazzie

YoHoJo
05-28-2007, 08:51 PM
Glad you liked it.
DTMs are my favorite :p

WhiteShadow
05-28-2007, 08:55 PM
Glad you liked it.
DTMs are my favorite :p

As we all know. :rolleyes:

Shave Ice
05-29-2007, 06:57 PM
Wow, Really nice Guide!!

Helped me so much on how to load the DTM's lol!! :p

Thanks for this awsome tut. Helps my script be better!!! :spot:

Inf456
05-31-2007, 03:14 AM
Nice tut , i taught me a lot more about DTM's. They seem very useful to me now after reading this tut, so I will definetly use this tut to help me make my first script. (not sure what to make yet...:p. ) rep+

Esteban
06-02-2007, 03:44 AM
thanks much for this tut, I now understand how to use DTMs thanks to think tutorial ;).

Maxine
06-18-2007, 07:01 PM
The best and most detailed DTM tutorial ever! <3<3
thanks!

Ilikepie1995
06-30-2007, 06:14 PM
Nice, nice :) helped me alot

Santa_Clause
07-01-2007, 10:03 AM
1337! I love it :p

McBronzeLongsword
07-01-2007, 04:23 PM
Thanks alot, dude! This tut is awesome! Yesterday I studied some BMP's, so today I wanted to learn DTM's. Thanks to you, I know now :)

Again, Thanks :D

(PS: Where do you give +rep? I really want to give you some)
(EDIT: ^^ Gave you +rep, found a very small button called "Add Reputation", or something :P)

-The Ever-Dangerous: Bronze Longsword

Garrett
07-02-2007, 03:21 PM
Thanks... This tut really helped me out with my DTM's

crossback7
07-02-2007, 08:53 PM
Umm. . .how would I make it. . .let's say bury all the bones in my inventory. Would I have to do the PopUp('Bury') option 28 times or what?

Please PM on how you would do this if you have time, as I have a few other questions as well.

Great tut though. Made learning how to actually make DTMs easy as can be.

plaxlord
07-15-2007, 04:36 AM
ausome tut before i knew nothing about dtms :) ty for posting this!

YoHoJo
07-16-2007, 07:58 PM
Umm. . .how would I make it. . .let's say bury all the bones in my inventory. Would I have to do the PopUp('Bury') option 28 times or what?

Please PM on how you would do this if you have time, as I have a few other questions as well.

Great tut though. Made learning how to actually make DTMs easy as can be.

Just do a simple loop like
Procedure BuryBones;
Begin
Repeat
If FindDTM(Bones,x,y,MIX1,MIY1,MIX2,MIY2) Then
Mouse(x,y,2,2,False)
Wait(100+Random(300))
ChooseOption(x,y,Bury)
Until(Not (FindDTM(Bones,x,y,MIX1,MIY1,MIX2,MIY2)
End;

Bobzilla69
07-17-2007, 07:18 PM
great tut, now i might be able to make a good script for once,lol.

TheSantaMan
07-17-2007, 10:10 PM
wow thanks a load this helped lots. I hope you see my SRL membership app soon.

TheSantaMan
07-17-2007, 10:37 PM
wow thanks a load this helped lots. I hope you see my SRL membership app soon.

thunar
07-18-2007, 09:21 PM
Thanks, added one more tool to my scripting powers. Though I still haven't made a working script using SRL.

alfonso1024
08-03-2007, 07:26 PM
Successfully compiled
[Runtime Error] : Exception: data error in line 5 in scriptnd.




program New;
var DTM,x,y:integer;

begin
DTM:= DTMFromString('78DA63B4646060B0654001D3B73C04D38C5 03' +
'E23488D3001355640A294809A524CBBD29A36A0AA61031276 A86A' +
'22CB96A0AA2903128204ECE2C0747356FB5654352540221F5 58D7' +
'7C63454355C402217554D61DF1ECC0B1C1EF1E000032177E' );
if FindDTM(DTM,x, y,1, 1, 200, 200) then
writeln('Congratz! You have just found your first DTM!')
end. what wrong?.....hmm lets see if u know...:rolleyes:

YoHoJo
08-04-2007, 11:36 PM
Runtime errors happen now and then with dtms.
Just make another one and try again =).

alfonso1024
08-05-2007, 01:41 AM
mines only says this

program New;
var Logs,x,y:integer;
begin
Logs := DTMFromString('78DA6314626060E0654001418E1C0CBF803 42' + '310FF070246692083094D8DAF13986684F2C16A4419B002B8 1A66' + '4CBB30D470000931FC6A00F2B30717');
if FindDTM(Logs,x, y,1, 1, 200, 200) then

end.

this i mean

Successfully compiled
Successfully executed
thats all no errors but no congrats =) i guess i did something wrong!////.....

YoHoJo
08-06-2007, 12:01 AM
if FindDTM(Logs,x, y,1, 1, 200, 200) then
If your trying to find them on rs, there cant be any logs in those cordiantes.
Thats just the top left corner of the screen.
Try this
if FindDTM(Logs,x, y,MIX1, MIY1, MIX2, MIY2) then
remember to put
{.include SRL\SRL.scar}
at top of script

lordsaturn
08-07-2007, 07:44 PM
Thanks Yoho, taught me a lot, I owe ya one.

oliver1205
08-08-2007, 01:31 AM
nice complete tut, thanks.

Garrett Weir
08-09-2007, 12:37 AM
How Do We Know Which Places To Pick For The "Invisible Box"(x1,y1,x2,y2)???

YoHoJo
08-09-2007, 01:34 AM
You pick the coordinateswith the color picker on scar.
Or use the built in coordinates

MainScreen: MSX1,MSY1,MSX2,MSYE
Inventory: MIX1,MIY1,MIX2,MIY2

Dude
08-09-2007, 03:48 PM
hey YoHoJo. Thank-You for the guide, very informative i was having a few problems adding extra stuff and had a few queries about some ideas. I'll try to catch you on msn..

YoHoJo
08-09-2007, 05:48 PM
Id rather not :p
Just ask them here =)

Dude
08-09-2007, 08:15 PM
Fair play. As was said above it is possible (yes difficult) to DTM on the MM, as you pointed out its hard because the screen changes. However just from your personal experience do you think that a camera moving function could be used to get into the position that the DTM was taken from? By, for example, having a DTM of the back of your chars head and also as a fail safe another DTM of say your leg that is x cords away from the head DTM To make sure that the camera is in the right location to use the DTM of say a bank(MM) when it gets close to the area?(obviously each person using this bot would need to either wear the same armour as is used in the script or simply make their own DTMs)

Sorry about such a long and wordy post (hence the MSN request) Any input greatly accepted!

YoHoJo
08-09-2007, 10:05 PM
DTMS for minimap are very difficult but possible.
As for the main screen, don't even go there girlfriend.
Something like DTM of a character would 1st need to be different for each and every character and 2nd be extremely unreliable :p.

Dude
08-09-2007, 10:57 PM
Okies, just putting the idea out there, still might use part of that idea in my scripts. when you say that DTMs need to be differentfor each char, could that not be avoided by simply making a DTM for a med helm...just the camera angle tht would need to be fixed but i suppose it could loosly go on a while statement (if scar uses those) eg

while xDTM ! found

camera function movmnet


If the dtm was taken as high up as possible and you only allowed DTM to search in 520:250 (random guess)...maybe im just too desperate for this idea to work....no harm in trying tho! Thanks again for the guide!

The Prince of Randomness?
08-09-2007, 11:18 PM
You forgot the WriteLn('Congratz! You have just found your first DTM!');
after if FindDTM(Logs,x, y,1, 1, 200, 200) then

Nose Smasher
08-10-2007, 12:06 AM
You pick the coordinateswith the color picker on scar.
Or use the built in coordinates

MainScreen: MSX1,MSY1,MSX2,MSYE
Inventory: MIX1,MIY1,MIX2,MIY2


Awesome TUT YoHoJo! And this bit of info really helped me :)
(I'm a new scripter...)

kraft1
08-23-2007, 05:44 PM
very helpful and in depth, thanks.:D

valesar
08-23-2007, 06:00 PM
Awesome tutorial, now I use DTM's in my Miner instead of using a bunch of bitmaps.

macromacro123
09-02-2007, 02:16 AM
ok dude u r #1

YoHoJo
09-02-2007, 10:44 PM
ROFL, thanks everyone glad i could help.

rogeruk
09-02-2007, 10:53 PM
Love the guide, helped alot in my learning of DTM's. Very easy too :D

richk1693
09-04-2007, 08:58 PM
Amazing tut. Very helpful, very easy to follow.

YoHoJo
09-08-2007, 05:11 PM
Thanks Again Guys =)
Glad its easy to understand, i took my time taking lots of pics to make everything clear.
Ask questions if you need =)

YoHoJo
11-02-2007, 08:13 AM
@ Evil
all runes have the same outline anyways, so first, for your parent point, instead of a tolerance of 255, choose some of the green tree of the nature rune, and make it a tolerance of around 150 and try that.

@Toterache
Glad i could help =)
And yes you can put tolerance over 255, but 255 is the max tolerance, anything over 255 basically =255 anyways.

@Maxcore
Yes, you can use DTMs for minimap, but its not highly suggested as they arent too accurate
Try looking for my DDTM tutorial, they are a bit more reliable when it comes to the minimap

@Wachko999
Same to you, and please dont triple post=)

Eicca
11-03-2007, 08:23 PM
Thank you, it was helpful.

I B X R
02-20-2008, 11:13 PM
How does :FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Integer

turn into: DTMFromString('78DA63AC666460286740017509960CFF813 45' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A 202B' + '8B809A26202B13BF1A0034E80BCD');

BTW, soz if it's a dumb question, I'm just trying to make my power mining script =D(A basic one, that looks at DTMs/BMs, not just colors. Lol)

gillian
02-25-2008, 01:57 AM
Hi there .. wanted to say thank you for a great tutorial :)

HellBoyz
02-27-2008, 01:17 AM
How does :FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Integer

turn into: DTMFromString('78DA63AC666460286740017509960CFF813 45' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A 202B' + '8B809A26202B13BF1A0034E80BCD');

BTW, soz if it's a dumb question, I'm just trying to make my power mining script =D(A basic one, that looks at DTMs/BMs, not just colors. Lol)

You have to declare your DTM which like this


procedure LoadDTMs;
begin
DTMAirTally := DTMFromString('78DA63E4616060E0634001FBB66E651001D 28' +
'C40FC1F081885800C160634C0884402692E20C141400D33A6 5D58' +
'D5C81250230824C408A801798097801A901942F8D50000D51 4073' +
'3');
DTMPackage := DTMFromString('78DA63CC67626078CE80024A4AD730C8016 94' +
'6289FB10CA8E61A031A60442281741E50CD2D026AD2806A1E 12A1' +
'E62D013520F77C24A0A61EA8E615116AEEE157030065200C8 C');
DTMNotes := DTMFromString('78DA639CCBC4C0F08401056CD8B084C1084 83' +
'302F17F20609C0754739B010D302291407A0A116AA601D53C 22A0' +
'A617A8E639013553816ADE1050B314A8E63D116A9E1250B30 2A8E' +
'60E7E350077FE13D7');
end;

KoKouKo
02-28-2008, 05:29 AM
deserves a bump because i learned from this and yohojo has a cool avatar

edit:
thanks

Deni_mulic
03-05-2008, 11:00 AM
Havent used this tut in 5 months.. daaamn
Anyway, Does DTM item finding work with items on the ground? and is it the same method as in this tutorial?

Wade007
03-06-2008, 12:36 AM
Thanks for this tutorial! I really needed it!

PvH
03-20-2008, 04:49 PM
hmm.. nice tutorial..
but i did something wrong ^^

program New;
{.include SRL/SRL.scar}
var Rune_axe:integer;
X,y:integer;
procedure loaddtm;
begin
Rune_axe := DTMFromString('78DA6314606060E0644001B57102609A11C A6' +
'79404127C0C688091E13FB21A1920C141408D08906025A086 9F08' +
'3520F7CA1150C30D248489B04B08BF1A00E0C908F3');
end;
procedure findruneaxe;
begin
if FindDTM(Rune_axe, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x,y,5,5);
If Isuptext('Rune axe')then // If text up yew log it will click it
begin
mouse(x,y,5,5,true);
end else
writeln('no rune axe');
end;
end;
begin
setupsrl;
activateclient;
loaddtm;
findruneaxe;
end.

that is my code
it goes to rs..
and doesnt do anything...
did my dtm 3 times again..
doesnt work for me:(


Successfully compiled
SRL Compiled in 15 msec
Successfully executed

help me please :D
rep++ anyway

Zezi
03-22-2008, 11:42 PM
Can this be used to find things in the minimap? :\

Great tutorial tho :)

KoKouKo
03-23-2008, 05:36 PM
@ pvh
try changing the tolerance and choose different points on the object

@ boxcrop
you can use dtms for finding certain objects on the mini such as bankers, for bankers set a tolerance of 20 (i think)

HellBoyz
03-24-2008, 06:09 AM
tested tolerance of 30+ should be use for banker or maybe more

faster789
03-26-2008, 05:57 AM
This will bank all logs after you open the bank:

program New;
var Logs,x,y:integer;

begin
logs := DTMFromString('78DA639466606010674001BE969C0CFF813 42' +
'310FF07024611208397010D302291405A8A08359A40429280 1A45' +
'202147400D3711E608030945FC6A008B9706F2');
if FindDtm(logs, x, y, 550, 200, 740, 470) then
Begin
Mouse(x,y,5,5,false)
Wait(200+Random(1000))
PopUp('Deposit All')
end;
end.

yes ! lol now i found sumthin dtm is used for...u shud show examples like this one...lol because i knew how to do it but i didnt know wat to use for...thxxx rep+



EDITTT!!= OK im rely confused why theres two ways of doing it...one is this :

DTMFromString('78DA6314606060E0644001B57102609A11C A6' +
'79404127C0C688091E13FB21A1920C141408D08906025A086 9F08' +
'3520F7CA1150C30D248489B04B08BF1A00E0C908F3');

ANOTHER one is this:
begin
SetArrayLength(ironSP, 5);

ironMP.x := 20;
ironMP.y := 17;
ironMP.areasize := 1;
ironMP.areashape := 0;
ironMP.color := 2305870;
ironMP.tolerance := 9;

ironSP[0].x := 6;
ironSP[0].y := 23;
ironSP[0].areasize := 1;
ironSP[0].areashape := 0;
ironSP[0].color := 65536;
ironSP[0].tolerance := 0;

ironSP[1].x := 13;
ironSP[1].y := 7;
ironSP[1].areasize := 1;
ironSP[1].areashape := 0;
ironSP[1].color := 65536;
ironSP[1].tolerance := 0;

ironSP[2].x := 24;
ironSP[2].y := 8;
ironSP[2].areasize := 1;
ironSP[2].areashape := 0;
ironSP[2].color := 65536;
ironSP[2].tolerance := 0;

ironSP[3].x := 30;
ironSP[3].y := 15;
ironSP[3].areasize := 1;
ironSP[3].areashape := 0;
ironSP[3].color := 65536;
ironSP[3].tolerance := 0;

ironSP[4].x := 18;
ironSP[4].y := 26;
ironSP[4].areasize := 1;
ironSP[4].areashape := 0;
ironSP[4].color := 65536;
ironSP[4].tolerance := 0;

ironDDTM.MainPoint := ironMP;
ironDDTM.SubPoints := ironSP;
result := AddDTM(ironDDTM);
end;

wats the difference?? and which one is used for wat?

faster789
03-26-2008, 06:05 AM
You pick the coordinateswith the color picker on scar.
Or use the built in coordinates

MainScreen: MSX1,MSY1,MSX2,MSYE
Inventory: MIX1,MIY1,MIX2,MIY2

FINALY>>>i needed this information lol!! you shud add this to tut very important...i know as i am a new scripter..

Gold
03-27-2008, 02:47 AM
OMg this tut helped me a shit load rep+++

KoKouKo
03-27-2008, 04:04 AM
@ faster789
the one yohojo teaches you (the first one) is a DTM

the second one is a DDTM the main difference is the DDTM can change during runtime

faster789
03-27-2008, 05:34 AM
@ faster789
the one yohojo teaches you (the first one) is a DTM

the second one is a DDTM the main difference is the DDTM can change during runtime
oo thx.:) .wel which would u consider using if i were going to use it to mapwalk(which i cant do because there is NO tut that teaches how to "exactly" use DTM/DDTM in mapwalking..) and then why like in some top scripts that i used before they would use DDTM for finding a broken rune pick...wouldnt a DDTM be not needed because the picture of a broken rune pick is going to stay the same...am i rite?

KoKouKo
03-29-2008, 04:43 AM
oo thx.:) .wel which would u consider using if i were going to use it to mapwalk(which i cant do because there is NO tut that teaches how to "exactly" use DTM/DDTM in mapwalking..) and then why like in some top scripts that i used before they would use DDTM for finding a broken rune pick...wouldnt a DDTM be not needed because the picture of a broken rune pick is going to stay the same...am i rite?
idk maybe that item is just ub3r randomized, you can use a dtm or ddtm for walking by just setting the tol of all the points to a value you should ask somebody to find out :p and then when you search for the (d)dtm just change the coords to search within to MMX1, MMY1, MMX2 and MMY2 (are those right?) Cut Em 2 It has a tut on DDTMs somewhere on these forums

Richard
04-06-2008, 09:14 PM
Great tut, I've already repped you :D

This was very thourough and easy to understand.

jacoby6000
04-15-2008, 11:23 PM
ok ive made my DTM but somthing is crapping out on me. for somreson i get this error, Here is my script so far...


program AutoMiner;
{.include SRL\SRL.scar}
Var
x,y: integer;
Const
Username= '';
Password= '';
OreColor = 7044095;
procedure LoadDTMs;
begin
OreDTM := DTMFromString('78DA63B462626078C68002EAD33D18FE036 94' +
'620FE0F048CC640356F18D000231209A4CD8950630954F39A 801A' +
'6BA09A5704D4D801D5BC2442CD3322D4DC27A006143EF708A 8312' +
'3C21C53A09A8704D49800D53C26A00614172FF0AB0100F8FB 14F2' +
'');
end;
begin
if findcolor(x,y,Orecolor,0,0,515,337)then
begin
movemousesmoothEx(x,y +random(5),10,30,500,10,0);
wait(100+random(300));
If IsUpText('Text here') then
Mouse(x,y,1,1,true);
end else
writeln('Could Not find rock');
end;
if findDTM(OreDTM,x,y,687,436,711,459)then
begin
If findDTM(OreDTM,x,y,550,208,736,465)then
begin
movemousesmooth(x,y +random(12))
wait(100+random(250))
Mouse(x,y,1,1,false)
ChooseOption('rop')
end;
end;
end;


PLz IF U CAN HELP my error is

Line 13: [Error] (12656:1): Unknown identifier 'OreDTM' in script C:\Program Files\SCAR 3.15\Scripts\first script in progress.scar

2pacfan
05-04-2008, 02:18 PM
Jacoby you need to put oredtm in var
like:
Procedure Name;
Var
Oredtm,x,y:integer;
and then the rest of the script
Hope i helped

Claymore
07-06-2008, 03:22 AM
ok ive made my DTM but somthing is crapping out on me. for somreson i get this error, Here is my script so far...


program AutoMiner;
{.include SRL\SRL.scar}
Var
x,y: integer;
Const
Username= '';
Password= '';
OreColor = 7044095;
procedure LoadDTMs;
begin
OreDTM := DTMFromString('78DA63B462626078C68002EAD33D18FE036 94' +
'620FE0F048CC640356F18D000231209A4CD8950630954F39A 801A' +
'6BA09A5704D4D801D5BC2442CD3322D4DC27A006143EF708A 8312' +
'3C21C53A09A8704D49800D53C26A00614172FF0AB0100F8FB 14F2' +
'');
end;
begin
if findcolor(x,y,Orecolor,0,0,515,337)then
begin
movemousesmoothEx(x,y +random(5),10,30,500,10,0);
wait(100+random(300));
If IsUpText('Text here') then
Mouse(x,y,1,1,true);
end else
writeln('Could Not find rock');
end;
if findDTM(OreDTM,x,y,687,436,711,459)then
begin
If findDTM(OreDTM,x,y,550,208,736,465)then
begin
movemousesmooth(x,y +random(12))
wait(100+random(250))
Mouse(x,y,1,1,false)
ChooseOption('rop')
end;
end;
end;


PLz IF U CAN HELP my error is

Line 13: [Error] (12656:1): Unknown identifier 'OreDTM' in script C:\Program Files\SCAR 3.15\Scripts\first script in progress.scar

Its not wise to use DTM's at this case. The best way is to maybe use this.
if (FindColorTolerance(EX, EY, (color here), MSX1, MSY1 ,MSX2, MSYE)) or
(FindColorTolerance(EX, EY, (other color), MSX1, MSY1 ,MSX2, MSYE)) or
(FindColorTolerance(EX, EY, (more colors!), MSX1, MSY1 ,MSX2, MSYE)) then

Otherwise i recommend DDTM. This detects the iron rock much better. If your really advanced, try AutoColoring.

Wewt
10-13-2009, 09:00 PM
Hey there. Great tutorial.
I made a DTM, and used your tutorial to find it, but everytime I run the script, I get the following error:

[Runtime Error] : Exception: Access violation at address 0077B925 in module 'scar.exe'. Read of address 000003CD in line 76 in script C:\Program Files\SCAR 3.21\Scripts\My Scripts\TestDTm.scar

In line 76, I define my DTM.

procedure FindTheDTM;
var DTM,x,y : Integer;
Begin
DTM := DTMFromString('78DA7DD25B0B01411407F05DF7FBF5892FA 72' +
'8F264BDD8752B1E5C4A28799194883CEEB65AA4A494EB9732 47E6' +
'649AC6D6ECBF697FCD99993DB26E97A48E4DFA7DA6FDDC27E 5EF5' +
'CB67833E96559B323A6CD9AD9208FE6330EBCF95D07BEC847 62BA' +
'AC19365368EC900FDE6C971A1A07354DD61C3655344EC83B3 10DD' +
'6ECD715342E6AEAE275DCB4564DBC1F0F352A6BAC55198D17 F2C9' +
'1B7AC3F0F6515314D7F243BE88515863CC4B6802743F8AF85 C417' +
'AF6A2F87E429037DE980B154D18F24A4C41DC1B11C8CB7F13 853C' +
'F3B546AD349A18E4E9BF8943EAFCFFE27ADE24A6CC9A713B8 3260' +
'16910A389FB3949C61B61104592');
if FindDTM(DTM,x,y,1,1,200,200) then WriteLn('Found the DTM');
End;

Why does this happen?

YoHoJo
10-13-2009, 09:23 PM
Try, remaking the DTM, only make about 4 "outline points".

Also, this is cleaned up a bit:

Program Bla;

var ItemDTM,x,y : Integer;

Procedure LoadItemDTM;
Begin
ItemDTM := DTMFromString('78DA7DD25B0B01411407F05DF7FBF5892FA 72' +
'8F264BDD8752B1E5C4A28799194883CEEB65AA4A494EB9732 47E6');
End;

Procedure FindIt;
Begin
if FindDTM(ItemDTM,x,y,1,1,200,200) then
WriteLn('Found the DTM');
FreeDTM(ItemDTM);
End;

Begin
LoadItemDTM;
FindIt;
End.

Wewt
10-13-2009, 10:01 PM
Thanks, I figured it out

reddevil12312
10-18-2009, 03:36 AM
Nice tut. Very easy to read.

the smith400
12-13-2010, 02:08 AM
THIS IS AMAZING.

Is this grave digging? I hope not, because it's a tutorial thread.

Seriously, Amazing!

YoHoJo
12-13-2010, 02:10 AM
I don't count tutorials as gravedigs. Thank you.

YoHoJo
11-19-2011, 09:59 AM
Created a video tutorial about DTMs!
http://www.youtube.com/watch?v=SlS4q9MiFX4

lolhahauad
11-20-2011, 01:22 AM
Wow, this helped me.. just look at the creation date and now.. ITS STILL HANDY, good job ;)

heronimus
11-21-2011, 07:59 PM
Hi,
thank you for this guide, it was really helpfull :)
I have 1 question though:
is it possible to declare your bitmap once at the top of your script (before your main repeat loop) and then avoid having to free memory room? or is that just a stupid thing to do?

lifestyles
11-30-2011, 08:45 PM
Guide was great, especially both of your videos. I think the video tutorials help people learn a lot easier than most written ones.

YoHoJo
11-30-2011, 09:53 PM
@heronimus If it's a bitmap/DTM that you plan on using a lot then sure, load it once before loop and then just use it when needed, and free it in the end (or Simba will just free it when you stop the script). Just make sure you don't load too many bitmaps/dtms this way it's okay to have a few loaded but too many I assume would cause some lag.

@LifeStyles, thanks glad you enjoyed this tutorial and the videos, and yeah videos are a lot nicer tool for teaching I think too, and I plan on making more in the future.

NexPB
12-06-2011, 10:08 PM
Could you create a video tutorial where you will explain walking with DTMs.

I would realy apreciate this.

YoHoJo
12-06-2011, 10:25 PM
Yikes haven't experimented with that for years.
I currently have other plans for upcoming video tutorials about more basic things but I might get there eventually.
Why not check out SPS (SRL Positioning System) it's really easy walking search it up on the forums.

NexPB
12-07-2011, 08:23 PM
Yikes haven't experimented with that for years.
I currently have other plans for upcoming video tutorials about more basic things but I might get there eventually.
Why not check out SPS (SRL Positioning System) it's really easy walking search it up on the forums.
Ok thanks I will search it.

grats
12-07-2011, 08:30 PM
flight was messing with that a week or so ago, I think bitmap walking too

PatDuffy
12-08-2011, 02:36 AM
I figured this would be as good a place as any to ask without starting a new thread.

If I wanted to search for a DTM, not on the main-screen, or the inventory, but under the mini-map, are there pre-set coordinates to do so? For instance, I want to find the summoning icon, so I have my DTM, and I know how to find DTM's, but I'm not exactly sure where to search.

YoHoJo
12-08-2011, 02:45 AM
Pick the coordinates yourself with the colorpicker tool.
You don't have to use SRLs built in coordinates.

PatDuffy
12-08-2011, 02:54 AM
I just wasn't sure if there were built-in ones for future reference.
Thanks for the speedy response, Yoho!

YoHoJo
12-08-2011, 02:56 AM
Yeah no problem.
Umm all I know that's built in is mainscreen, minimap, inventory, and chatbox.
I THINK they are in a script (Like an SRL core script) someone in SRL, but I can't seem to find it....

z92
12-31-2011, 05:14 PM
Thank you for an awesome tutorial! This will be useful.

cause
01-04-2012, 06:36 PM
Awesome tut, question for you, can you choose the black around the ores that are more towards the middle? aka the black outline around the gold colored chunk in the center of the ore:
http://clip2net.com/clip/m109326/thumb640/1325702047-clip-1kb.png (http://clip2net.com/s/1siHW)

again, great tut and very helpful to know about the 255 tolerance :).

YoHoJo
01-04-2012, 06:38 PM
Awesome tut, question for you, can you choose the black around the ores that are more towards the middle? aka the black outline around the gold colored chunk in the center of the ore:
http://clip2net.com/clip/m109326/thumb640/1325702047-clip-1kb.png (http://clip2net.com/s/1siHW)

again, great tut and very helpful to know about the 255 tolerance :).

Lol you JUST learned DTMs? Cute!
And yeah that will work just fine, I think I've made some like that before.

cause
01-05-2012, 01:57 AM
lol I know, been here awhile ;). And yeah that worked for me.

ruttedbeez
01-05-2012, 07:18 AM
Where can I find the SCAR CDE Editor. I downloaded one and it came up a virus. I'd rather not get infected trying to find it. Thanks

EDIT: Problem solved wow I feel dumb...

Chris
01-06-2012, 05:11 PM
Why isnt the tool included with Simba? (or is it?)
I cant find the tool, do I have to download it?

Very nice tut :D

selgius7
01-06-2012, 08:21 PM
after 2 hours watching those 2 tutorial videos, i was like: damn, i forgot everything, where should i start with ? :D

imaloser
01-07-2012, 02:16 AM
I'm using simba,

Followed it throughly seems as though SCAR produced more then one DTM string for you, Simba only gave me on but anyways plugged in all the info and wellll

"The following DTMs were not freed: [0]"

YoHoJo
01-07-2012, 02:19 AM
FreeDTM(DTM:Integer);
^You need to call that when you are done with the DTM.
Like FreeDTM(Logs);
But if you use it frequently, it's best to just leave it loaded and not free it at all, jut make sure you only call the code which loads the DTM once and not multiple times, otherwise it will add up to a lot of memory.

Chris
01-07-2012, 01:18 PM
NVM, the tut from DemiseScythe explained how to solve my problem.

mikeym
01-11-2012, 01:30 AM
How to you add your own cords Ik how to get them just insead of the Mainscreen ones aren'tthere are more than one number for each cord I can find 965 for the incventory but all the lines up and down of that line are 965!

oops the . after the first number is the second haha

YoHoJo
01-11-2012, 01:46 AM
Could you phrase that differently please I dont understand what you're asking.

Rally
01-12-2012, 06:30 PM
Thanks YoHoJo for these these great tutorials :)

honeyhoney
01-19-2012, 09:21 AM
Great tutorial, it's old but it's still an easy read. Thanks.

Just a quick query though; to me it seems DTMs rely on the outline of a shape, how important is the parent point in identifying different items?
Items that have the same shape, ie. normal logs, oak logs, willow logs and so on... surely the only way to differentiate between them is with the parent point? Is that how it's done?
(just not sure how much significance the parent point has :P)

Also, is loading a DTM in the loop a big no-no?
Should it be loaded once when the script is initializing and then be done with it?

YoHoJo
01-19-2012, 09:17 PM
Great questions!

To differentiate between different items of same outline, use tolerance of 20,30,40 (experiment) on the parent point instread of 255.
Good way to check would be ex: have one of each log on screen, adjust tolerance until only the one you want is found.

Never load DTM in loop, load it, use it, free it. And if your script is using same DTM often/quickly then load it once and just never free it.

Goof luck, glad to help!

honeyhoney
01-20-2012, 11:05 AM
Great questions!

To differentiate between different items of same outline, use tolerance of 20,30,40 (experiment) on the parent point instread of 255.
Good way to check would be ex: have one of each log on screen, adjust tolerance until only the one you want is found.

Never load DTM in loop, load it, use it, free it. And if your script is using same DTM often/quickly then load it once and just never free it.

Goof luck, glad to help!

Thanks for the response. :)

I've been looking at a few other tutorials and between the tutorials I've read I've now got a pretty good understanding of DTMs.

It's interesting how different people approach DTMs, you decide to go for the outline, some people decide to go for the bottom-right quadrant of the item etc.

I guess the only way I'll find out what is best for me is by experimentation.

YoHoJo
01-20-2012, 04:22 PM
They both works fine, but as of recently people have been using bottom right quadrant only because graphical glitches and items looking deformed etc
The bottom right always stays looking the same but other parts look messed up so it's usually best to use bottom right right now.

living dead
03-01-2012, 04:27 AM
Very much appreciated! I understand DTMs so much more now!

lolbus
03-05-2012, 12:47 PM
Is there a way I can count the number of DTM (Example blue robe in your case)in my inventories instead of just locating its presence and clicking on it??

YoHoJo
03-05-2012, 12:51 PM
Look in inventory.simba (C:\Simba\Includes\SRL\srl\core) for:
Function CountItems(ItemType: string; Identifier: Integer; tol: TIntegerArray):
And other similar functions to it. They work well.

sm321
03-05-2012, 03:17 PM
I watched it and now I understand :) It's very beginner friendly. I am yet to move onto RuneScape bots :)

madyman
03-13-2012, 04:05 PM
Hi guys! I'm new to Simba scripting, but I know some java and i'm very(VERY) eager to learn :D

I have something that i'm not sure of for DTMs, and this is very stupid D: but, heres a DTM that I have taken using your tutorial! (Btw, GREAT tutorial hahas!):

VialDTM := DTMFromString('78DA63946266606061624006616151609A1 1C' +
'A671407AAF9C8C8800A9850D54813A14619A8869309BF1A19 A01A' +
'3E026AC48850230454C34B400D3F500D070135C24035FF09F 84B8' +
'E192E864B0D000339056E');

if WithdrawItem(Vial, 'dtm', 27, 'ia', [3]) then;
CloseBank;

I am trying to run a basic program that locates and left clicks the Lunars spell Humidify, however, Simba could not locate the vials in the bank, stating: unable to locate 'dtm'.
I noticed that other Simba scripts from pro writers have DTMs that do not have the '+' in them, such as:
barDTM := DTMFromString('mlwAAAHicY2dgYDAAYlUgVgFiIyC2AWJLID YB4mlAvACIpwJxHxBPBuKZQDwPiM8ukgGSTFjxfwbcgBEPhgIA P/cIHA==');

Although im sure that its an error on my part, but I'm learning and I wanna ask how do solve this small problem :/

Abu
03-14-2012, 05:11 PM
Hey madyman! Its great that your'e looking to help out around here.

Why don't you try this:
procedure FindVial;
var
Vial, x, y: Integer;
begin
Vial := DTMFromString('78DA63946266606061624006616151609A1 1C' + 'A671407AAF9C8C8800A9850D54813A14619A8869309BF1A19 A01A' + '3E026AC48850230454C34B400D3F500D070135C24035FF09F 84B8' + 'E192E864B0D000339056E');
if FindDTM(Vial, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Vial!')
MMouse(x, y, 2, 2);
Mouse(x, y, 0, 0, True);
FreeDTM(Vial);
end;
end;
Make sure you've read the beginners guides on Simba.
Make sure you SetUpSRL in your main loop.
For this procedure to work, you must have the bank tab open and it will find it and click on it.



If you want to Withdraw all the Vials, then you can use a much simpler procedure:

DepositAll;
Withdraw(0,0,0);
This procedure Deposits your inventory and then Withdraws a full inventory of the first item in your bank - which you should make Vials. If you want it to withdraw a different amount, simple change the last '0' into the number of Vials you want to withdraw.

Hope that helps!

Fruitboy
03-21-2012, 09:37 PM
Thanks for this!
Fixed teleporting problem with the help of this :)

bobbyc
05-06-2012, 03:05 AM
Great Tutorial! But, how can I make a dtm for an item that is on the ground????

Abu
05-06-2012, 04:29 PM
Great Tutorial! But, how can I make a dtm for an item that is on the ground????

Exactly the same my friend, exactly the same...

YoHoJo
05-07-2012, 04:52 AM
Great Tutorial! But, how can I make a dtm for an item that is on the ground????

I don't suggest doing that, Watch my ACA video (Auto Color Aid) it will help with main screen stuff.

I only like DTMs for flat/static things, not ever for the main screen.

ABC!
06-09-2012, 09:39 AM
Hey, thanks for the great TUT!

But when I try to use it I get an error message and the script is executed:
Successfully executed.
The following DTMs were not freed: [2]

This is my procedure:

Procedure WalkToBank;

var
AreaOne,x,y : Integer;

begin
FindNormalRandoms
If (InvFull) then
begin
AreaOne := DTMFromString('mggAAAHicY2NgYNjAysCwGIh3AfEeVgh/IRAbMDIwaACxGhAbArElEFsAcUC0JoNPuDqDV7gsg1KUCENArD yDo7cSw38G7IARB4YAALWuCtA=');
if FindDTM(AreaOne,x, y, 100, 100, 200, 200) then
begin
writeln('Currently: Walking To Bank - Phase 1!');
Mouse(x, y, 1, 1, true);
end;
end;
end;

YoHoJo
06-10-2012, 12:57 AM
When you're done using the DTM call
FreeDTM(AreaOne);

It's not a big deal it's freed when script stops anywyas.

Master BAW
06-12-2012, 04:59 PM
Thanks. :) Is there a place where standard DTMs are saved? because it takes a lot of time to make all DTMs yourself... Would be nice if DTMs of often used items were stored somewhere online, so, is there such a place?

Mark
06-12-2012, 05:53 PM
Much better to do your own better practice.

YoHoJo
06-12-2012, 07:59 PM
Thanks. :) Is there a place where standard DTMs are saved? because it takes a lot of time to make all DTMs yourself... Would be nice if DTMs of often used items were stored somewhere online, so, is there such a place?

Good idea and I think such a database was thought about/started before with DTMs/Bitmaps.
In the end they often get broken/outdated etc Nd it really just takes a minute or less to make a DTM or bitmap for something, practice will make you faster.

Also there was something made called blacklists/black lists I forgot 100% what their purpose was but it made DTM like things to find items fast/during runtime.

edgee awaits
06-12-2012, 09:37 PM
Hey, I'm also somewhat new to scripting and stuff, I'm trying to make a DTM to click just one trout in my bank, ive looked at your video Tut to see if I could learn anymore from it, but i got this far, basically what happens it it doesnt writea line in the debug box, doesnt move the mouse to the spot and doesnt click. This could be problems on my behalf but I'm not sure, I'm using a two monitor setup if that changes anything?

program new;
{$i SRL\SRL.simba}
Var
Trout, X, Y: Integer;
begin
SetupSRL;
Trout := DTMFromString('m1gAAAHic42JgYOAHYhkglgdiZSCWAmIRIO ZggABWqBo+KJ8JKsYDxGJQ9RJQNSDx0oRYBnNdHQZ+Hl4GdTUl BkMNdQZlJZDpjGAsLyPFICokxEAsYCQSIwAAnr8FFg==');
If FindDTM(Trout, X, Y, MSX1, MSY1, MSX2, MSY2) Then
begin
Writeln('Found DTM');
MMouse(x, y, 5, 5);
Mouse(x, y, 0, 0, True);
end;
FreeDTM(Trout);
end.

Divus
06-12-2012, 09:58 PM
Im sorry if this is a stupid question.. but i cant seem to find the answer anywhere, where do i download scar?

Master BAW
06-12-2012, 10:00 PM
MSX1, MSY1, MSX2, MSY2

where can I find what these variables mean and what the others are?

YoHoJo
06-12-2012, 10:05 PM
Im sorry if this is a stupid question.. but i cant seem to find the answer anywhere, where do i download scar?

SCAR isn't used here, Simba is.
http://villavu.com/forum/showthread.php?t=47714


MSX1, MSY1, MSX2, MSY2

where can I find what these variables mean and what the others are?
Those are coordinates for the main screen.
Inventory is MIX1, MIY1, MIX2, MIY2
Minimap is MMX1,MMY1,MMX2,MMY2

They are hard coded into SRL, I think they can be found in globals.simba.

Divus
06-13-2012, 02:46 AM
Ahh i understand now, i got confused and thought that you still used scar and simba, my bad. Thanks for clearing this up :)

Master BAW
06-18-2012, 07:05 PM
thanks sir! :D Read this and watched your video and It was clear for me and I can use it myself now very easily :)

randy marsh
04-29-2013, 07:06 PM
How come you cant test dtm anymore?







Also do I have to put load dtms in?

Heres my script with them in, think I put in wrong place tho










{$I SRL-OSR/SRL.Simba}



//------------------------------------------------------------------\\
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ; //Username goes here
Players[0].Pass := ''; //Password goes here
Players[0].Nick := 'ake'; //Character name (excluding first letter)
Players[0].Active := True;
end;
//--------------------------------------------------------------------\\








procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(60) of //antiban change (20) to higher number for less antiban
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;




Function FindNPC:Boolean;
var
Cts,a, y, Tries:Integer;
NPCTPA:Tpointarray;
NPCATPA:T2DPointarray;
begin
CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 1.05);
marktime(y);
repeat
if FindColorsSpiralTolerance(MSCX, MSCY, NPCTPA, 5667735, msx1, msy1, msx2, msy2, 14) then
begin

NPCATPA := SplitTPAEx(NPCTPA, 5, 5);
SortATPAFromMidPoint(NPCATPA, Point(262, 224-50))
end;
for a :=0 to high(NPCATPA) do
begin
MouseSpeed:=(Randomrange(9, 15));
MMouse(NPCTPA[a].x, NPCTPA[a].y, 3, 3);
wait(300+Random(100));
Inc(Tries);
if isUptext('ring') then // name of npc
begin
Result := True;
GetMousePos(a, y);
mouse(a,y,3,3,false);
wait(100 + random(200));
ChooseOption('rade');// choose option trade
wait(5000 + random(1000));
Break;
Exit;
end else
Result := False;
end;
Until(TimeFromMark(y) > 20000);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.02, 0.02);
end;









procedure FindIron;
var
Iron, x, y: Integer;


procedure LoadDTMs;
begin
Iron := DTMFromString('mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BY iPA3EwEEcBcRIQBwCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAo AABUTA8m');
end;

begin
Iron := DTMFromString('mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BY iPA3EwEEcBcRIQBwCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAo AABUTA8m');
if FindDTM(Iron, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Iron!')
Mouse(x,y,2,2,False)
FreeDTM(Iron);
end;
end;











begin

DeclarePlayers;
SetupSRL;
ActivateClient;
LoadDTMs;
FindNPC;
findIron;

End.







I then get a

[Error] C:\Simba\Scripts\bars.simba(113:3): 'BEGIN' expected at line 112 ---- which is this line
procedure LoadDTMs;

randy marsh
04-29-2013, 09:09 PM
They both works fine, but as of recently people have been using bottom right quadrant only because graphical glitches and items looking deformed etc
The bottom right always stays looking the same but other parts look messed up so it's usually best to use bottom right right now.

im going crazyyyy

Haxz
04-29-2013, 09:21 PM
im going crazyyyy

procedure FindIron;
var
Iron, x, y: Integer;

begin
Iron := DTMFromString('mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BY iPA3EwEEcBcRIQBwCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAo AABUTA8m');
if FindDTM(Iron, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found Iron!')
Mouse(x,y,2,2,False)
end;
FreeDTM(Iron);
end;

If you wanna test DTM, copy this part only

mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BYiPA3EwEEcBcRIQB wCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAoAABUTA8m');

Paste it in the DTM from string with DTM tool.

randy marsh
04-29-2013, 09:43 PM
where do you put load dtms in?

Haxz
04-29-2013, 09:53 PM
where do you put load dtms in?

You already loaded and free it in that procedure. If you want to load it on a different procedure, you need another procedure to free it too.

randy marsh
04-29-2013, 10:19 PM
Thanks must of misread the load part

zunkill
05-19-2013, 02:00 PM
mine doesnt have the test bit on my editor? i can open the DTM but i cant test it :(

g ked
07-25-2013, 07:01 AM
Gave some rep! This is amazing for a newtimer or even a pro! I have been using DTM's but this just made them flawless! Thanks YoHoJo for another great tut!

Foundry
07-31-2013, 12:45 AM
Also repped. Great and informative tutorial that was easy to understand for the average noob :)