SRL Archive - OSR Intermediate Scripting Tutorials

Yohojo's DTM Tut 1(Item finding with DTMs)


YoHoJo

2006-04-06 21:47:23

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 the 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:

• 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:

• 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

2006-04-06 21:48:23

*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:

• 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:
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):

Step5: Saving and Testing the DTM

•Now we must save the DTM:

•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

2006-04-06 21:49:36

*CONTINUED FROM ABOVE*

•Now we must test to see if your DTM works. So click:

• If it worked correctly you should see somthing like this:

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

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

DTM := DTMFromString('78DA63AC666460286740017509960CFF81345' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A202B' + '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('78DA63AC666460286740017509960CFF81345' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A202B' + '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

2006-04-06 21:53:52

nice tutorial :PXD

Neonknight77

2006-04-06 21:58:22

Did Sdouble teach you this?

Jagex_Fagex

2006-04-06 21:58:32

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

2006-04-06 22:00:16

Jagex: Its because i got big ol pics

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

WhiteShadow

2006-04-06 22:21:15

Lol, Yohojo you release this on every forum. :p

It's good.

YoHoJo

2006-04-06 22:24:05

Its good to learn =)
And thz to starblaster for recovering it from kaitnieks!

The Un-Named

2006-04-08 08:19:38

I rep'd you on kaitnieks for this. It's very good. :)

YoHoJo

2006-10-28 15:03:38

cmon guys anyone else wana learn DTMs?
they are usefel!=)

lardmaster

2006-10-28 15:45:15

i learned DTMs from this!. very useful

Bramble

2006-11-27 16:32:12

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('78DA639466606010674001BE969C0CFF81342' +
'310FF07024611208397010D302291405A8A08359A404292801A45' +
'202147400D3711E608030945FC6A008B9706F2');
if FindDtm(logs, x, y, 550, 200, 740, 470) then
writeln('congratz! You have just found your first DTM!')

end.

YoHoJo

2006-11-27 19:13:07

This will bank all logs after you open the bank:

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

begin
logs := DTMFromString('78DA639466606010674001BE969C0CFF81342' +
'310FF07024611208397010D302291405A8A08359A404292801A45' +
'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

2006-12-03 19:09:21

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('78DA63F4676260D060644006D19EC60CFF813' +
'448F43F103082D4A8A0AA81C8C24820ED0254638C5B0D187B00D5' +
'68E356C304A2FD80A40E0135A140520DB71A16101D0954A340404' +
'D30508D3C7E35004D5D09C7');
if FindDTM(barbtail,x,y,1,1,200,200) then
writeln('congrats')
end.

YoHoJo

2006-12-03 19:54:00

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

2006-12-03 21:07:14

weird, when testing the dtm, it can find it, but when i try run, it just wont say the congrats bit

YoHoJo

2006-12-03 21:55:45

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('78DA63BCC0C8C0E001C448C0C1C28EE13F900' + 
'689FE0702C6D340961DAA1A5111110639A81A1060BC4A849A3340' +
'962F01355708AB0100F8530CA0');

someone

2006-12-03 22:09:28

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

2006-12-03 22:17:50

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

2006-12-03 22:25:32

crap, im probably waaay ahead of myself here but:

program fisher;

var barbtail, x, y: Integer;

procedure findbarbtail;
begin
barbtail := DTMFromString('78DA63BCC0C8C0E001C448C0C1C28EE13F900' +
'689FE0702C6D340961DAA1A5111110639A81A1060BC4A849A3340' +
'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

2006-12-04 16:57:43

ROFL
replace
function ClickMSDTM(DTM: Integer): true;

with
ClickMSDTM(barbtail)

dontpanic

2006-12-04 17:48:18

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

2006-12-04 17:54:07

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

2006-12-04 17:54:32

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

2006-12-04 17:55:54

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

2006-12-04 17:59:18

yea i added an are of 2 and it works well now
another DTM successfully made!

dontpanic

2006-12-04 18:02:04

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

2006-12-04 18:09:23

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

2006-12-05 20:29:49

oh, ok, thanks

YoHoJo

2007-02-13 02:42:59

New people of the community, LEARN DTMs!
bump

dario69er

2007-02-13 03:08:40

yohojo this is from ur wc scrip wat does it mean man

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

t3hl33tn00b

2007-02-13 07:02:25

From: dario69er
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

2007-02-13 10:23:24

From: dario69er
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

2007-02-23 11:27:42

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

2007-02-23 16:48:16

Saves to memory. Just paste and it will be there. Tap.

JAD

2007-02-23 17:31:44

how do i open memory? lol. sorry I'm new to the whole print screen thing.

Boreas

2007-02-23 17:39:48

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

2007-02-25 00:32:00

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

2007-02-26 01:47:27

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

2007-02-26 02:38:35

Gheeheehee Thanks,
maybe I should make more =).

JAD

2007-02-26 13:32:13

From: yohojo8
Gheeheehee Thanks,
maybe I should make more =).


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

IEatJ00erBaybees

2007-03-05 17:01:58

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

2007-03-05 17:07:04

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

2007-03-05 19:50:31

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

2007-03-09 08:24:57

Nice tut. Helped me out a ton on making DTM's! Rather easy ;)

YoHoJo

2007-03-11 05:02:55

From: IEatJ00erBaybees
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

2007-03-16 22:52:22

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('78DA63146464606801622C0026CA28006435A' +
'3AA890D7147552345841A90393D04D4880259DD04D4880359ED04' +
'D4280059AD04FC2504644DC4AF06000DC909E0');
dtmBottom := DTMFromString('78DA635CCCC8C070198891406C883B9886893' +
'22E02B22EA1AA8101B89A8540D64522CCB948843984EC02B9F910' +
'01BBA610E1AF6944D80572F311026AE6005967F0DB05007BD4134' +
'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

2007-03-17 16:52:48

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

2007-03-20 22:01:03

ok, got a real question about dtm for u.
i made a rune arrow dtm:
DTM := DTMFromString('78DA63DCCEC0C0308B910119B86BB032B0026' + // rune arrow
'990E87F2060DC07644C445503918591407A3790E827A0662B9058' +
'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

2007-03-20 23:31:42

From: gsquare567
ok, got a real question about dtm for u.
i made a rune arrow dtm:
DTM := DTMFromString('78DA63DCCEC0C0308B910119B86BB032B0026' + // rune arrow
'990E87F2060DC07644C445503918591407A3790E827A0662B9058' +
'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

2007-03-21 12:48:40

does dtm only work with black spots?

Mjordan

2007-03-21 14:05:44

From: gsquare567
does dtm only work with black spots?


nope

legendaryhero90

2007-03-21 19:48:48

great DTM tut…but my DTMs still cant be detected… such as the DTM of the Shopkeeper's head

gsquare567

2007-03-21 22:27:15

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

2007-03-22 00:00:19

From: legendaryhero90
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

2007-03-24 19:47:37

From: legendaryhero90
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

2007-03-26 14:02:00

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

2007-03-26 14:43:19

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('78DA6314636060506340010BA74E65F80FA41' +
'981F83F10300A0019AAA86AA67675321841D58000233F90904755' +
'73E2E0415435E240420655CDCA797351D5C863AA59BF6409AA1A0' +
'520A184A666D1224C359AA86AB6AE5E85E91E3D5435A70E1F4255' +
'C387A9262E530A450D00AFD0197C');
if FindDTM(hides,x, y,1, 1, 200, 300) then
writeln('Congratz! You have just found your first DTM!')
end.

rkroxpunk

2007-03-27 04:09:29

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

2007-03-27 16:02:33

From: rkroxpunk
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

2007-03-29 18:49:36

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

2007-03-29 19:12:59

Are you sure that you set the dtm?

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

gsquare567

2007-03-29 22:29:34

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

2007-03-29 22:52:38

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

2007-04-03 14:16:12

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('78DA63146160609064400131B5E10CFF81342' +
'310FF0702460E204381010D302291405A1C48081050234184392A' +
'404290801A4520C145400D1F909020A0861F4828E1570300279F0' +
'7AE');
if FindDTM(Pike,x, y,MIX1, MIY1, MIX2, MIY2) then
writeln('Congratz! You have just found your first DTM!')

end.

[PHP]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[/PHP]

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

2007-04-03 17:05:12

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

2007-04-08 08:37:27

??? 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

2007-04-10 03:32:36

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

2007-04-10 06:17:27

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

2007-04-10 23:17:47

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

2007-04-10 23:43:16

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

2007-04-12 20:22:53

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~

2007-04-13 05:28:31

Yay I love DTMs now :D

YoHoJo

2007-04-20 16:34:33

=0 Glad i could help.
DTMs are my best friend, fast easy, and reliable.
0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO0oO

Gwallunit

2007-04-21 18:47:47

Wow this is ace

Im gunna really practice on DTM's

joshie

2007-04-27 13:52:59

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

2007-04-28 13:11:48

hey nice tut, dtms are really cool and now i can use them in my scripts :) thx alot!!!

YoHoJo

2007-05-03 16:51:34

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

2007-05-16 02:23:01

Thanks for maing this tut man… it's great!
This will help me with my scripts.
Thanks again :)

Tazzie

YoHoJo

2007-05-28 16:51:26

Glad you liked it.
DTMs are my favorite :p

WhiteShadow

2007-05-28 16:55:40

From: YoHoJo
Glad you liked it.
DTMs are my favorite :p


As we all know. :rolleyes:

Shave Ice

2007-05-29 14:57:52

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

2007-05-30 23:14:17

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

2007-06-01 23:44:22

thanks much for this tut, I now understand how to use DTMs thanks to think tutorial ;).

Maxine

2007-06-18 15:01:37

The best and most detailed DTM tutorial ever! <3<3
thanks!

Ilikepie1995

2007-06-30 14:14:04

Nice, nice :) helped me alot

Santa_Clause

2007-07-01 06:03:28

1337! I love it :p

McBronzeLongsword

2007-07-01 12:23:34

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

2007-07-02 11:21:43

Thanks… This tut really helped me out with my DTM's

crossback7

2007-07-02 16:53:01

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

2007-07-15 00:36:54

ausome tut before i knew nothing about dtms :) ty for posting this!

YoHoJo

2007-07-16 15:58:07

From: crossback7
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

2007-07-17 15:18:13

great tut, now i might be able to make a good script for once,lol.

TheSantaMan

2007-07-17 18:10:45

wow thanks a load this helped lots. I hope you see my SRL membership app soon.

TheSantaMan

2007-07-17 18:37:32

wow thanks a load this helped lots. I hope you see my SRL membership app soon.

thunar

2007-07-18 17:21:22

Thanks, added one more tool to my scripting powers. Though I still haven't made a working script using SRL.

alfonso1024

2007-08-03 15:26:12

Successfully compiled
[Runtime Error] : Exception: data error in line 5 in scriptnd.




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

begin
DTM:= DTMFromString('78DA63B4646060B0654001D3B73C04D38C503' +
'E23488D3001355640A294809A524CBBD29A36A0AA61031276A86A' +
'22CB96A0AA2903128204ECE2C0747356FB5654352540221F558D7' +
'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

2007-08-04 19:36:38

Runtime errors happen now and then with dtms.
Just make another one and try again =).

alfonso1024

2007-08-04 21:41:31

mines only says this
program New;
var Logs,x,y:integer;
begin
Logs := DTMFromString('78DA6314626060E0654001418E1C0CBF80342' + '310FF070246692083094D8DAF13986684F2C16A4419B002B81A66' + '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

2007-08-05 20:01:11

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

2007-08-07 15:44:21

Thanks Yoho, taught me a lot, I owe ya one.

oliver1205

2007-08-07 21:31:31

nice complete tut, thanks.

Garrett Weir

2007-08-08 20:37:18

How Do We Know Which Places To Pick For The "Invisible Box"(x1,y1,x2,y2)???

YoHoJo

2007-08-08 21:34:34

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

2007-08-09 11:48:00

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

2007-08-09 13:48:25

Id rather not :p
Just ask them here =)

Dude

2007-08-09 16:15:51

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

2007-08-09 18:05:54

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

2007-08-09 18:57:02

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?

2007-08-09 19:18:15

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

2007-08-09 20:06:21

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

2007-08-23 13:44:09

very helpful and in depth, thanks.:D

valesar

2007-08-23 14:00:12

Awesome tutorial, now I use DTM's in my Miner instead of using a bunch of bitmaps.

macromacro123

2007-09-01 22:16:43

ok dude u r #1

YoHoJo

2007-09-02 18:44:33

ROFL, thanks everyone glad i could help.

rogeruk

2007-09-02 18:53:56

Love the guide, helped alot in my learning of DTM's. Very easy too :D

richk1693

2007-09-04 16:58:31

Amazing tut. Very helpful, very easy to follow.

YoHoJo

2007-09-08 13:11:08

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

2007-11-02 04:13:58

@ 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

2007-11-03 16:23:51

Thank you, it was helpful.

I B X R

2008-02-20 18:13:09

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

turn into: DTMFromString('78DA63AC666460286740017509960CFF81345' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A202B' + '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

2008-02-24 20:57:31

Hi there .. wanted to say thank you for a great tutorial :)

HellBoyz

2008-02-26 20:17:59

From: I B X R
How does :FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Integer

turn into: DTMFromString('78DA63AC666460286740017509960CFF81345' + '086E13F1030B663AA81C8C248205D0B64D51050934F849A2A202B' + '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('78DA63E4616060E0634001FBB66E651001D28' +
'C40FC1F081885800C160634C0884402692E20C141400D33A65D58' +
'D5C81250230824C408A801798097801A901942F8D50000D514073' +
'3');
DTMPackage := DTMFromString('78DA63CC67626078CE80024A4AD730C801694' +
'6289FB10CA8E61A031A60442281741E50CD2D026AD2806A1E12A1' +
'E62D013520F77C24A0A61EA8E615116AEEE157030065200C8C');
DTMNotes := DTMFromString('78DA639CCBC4C0F08401056CD8B084C108483' +
'302F17F20609C0754739B010D302291407A0A116AA601D53C22A0' +
'A617A8E639013553816ADE1050B314A8E63D116A9E1250B302A8E' +
'60E7E350077FE13D7');
end;

KoKouKo

2008-02-28 00:29:03

deserves a bump because i learned from this and yohojo has a cool avatar

edit:
thanks

Deni_mulic

2008-03-05 06:00:48

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

2008-03-05 19:36:33

Thanks for this tutorial! I really needed it!

PvH

2008-03-20 12:49:50

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('78DA6314606060E0644001B57102609A11CA6' +
'79404127C0C688091E13FB21A1920C141408D08906025A0869F08' +
'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

2008-03-22 19:42:44

Can this be used to find things in the minimap? :\

Great tutorial tho :)

KoKouKo

2008-03-23 13:36:23

@ 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

2008-03-24 02:09:19

tested tolerance of 30+ should be use for banker or maybe more

faster789

2008-03-26 01:57:47

From: YoHoJo
This will bank all logs after you open the bank:

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

begin
logs := DTMFromString('78DA639466606010674001BE969C0CFF81342' +
'310FF07024611208397010D302291405A8A08359A404292801A45' +
'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('78DA6314606060E0644001B57102609A11CA6' +
'79404127C0C688091E13FB21A1920C141408D08906025A0869F08' +
'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

2008-03-26 02:05:39

From: YoHoJo
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

2008-03-26 22:47:57

OMg this tut helped me a shit load rep+++

KoKouKo

2008-03-27 00:04:39

@ 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

2008-03-27 01:34:36

From: KoKouKo
@ 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

2008-03-29 00:43:43

From: faster789
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

2008-04-06 17:14:15

Great tut, I've already repped you :D

This was very thourough and easy to understand.

jacoby6000

2008-04-15 19:23:43

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('78DA63B462626078C68002EAD33D18FE03694' +
'620FE0F048CC640356F18D000231209A4CD8950630954F39A801A' +
'6BA09A5704D4D801D5BC2442CD3322D4DC27A006143EF708A8312' +
'3C21C53A09A8704D49800D53C26A00614172FF0AB0100F8FB14F2' +
'');
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

2008-05-04 10:18:05

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

2008-07-05 23:22:35

From: jacoby6000
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('78DA63B462626078C68002EAD33D18FE03694' +
'620FE0F048CC640356F18D000231209A4CD8950630954F39A801A' +
'6BA09A5704D4D801D5BC2442CD3322D4DC27A006143EF708A8312' +
'3C21C53A09A8704D49800D53C26A00614172FF0AB0100F8FB14F2' +
'');
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

2009-10-13 17:00:53

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('78DA7DD25B0B01411407F05DF7FBF5892FA72' +
'8F264BDD8752B1E5C4A28799194883CEEB65AA4A494EB973247E6' +
'649AC6D6ECBF697FCD99993DB26E97A48E4DFA7DA6FDDC27E5EF5' +
'CB67833E96559B323A6CD9AD9208FE6330EBCF95D07BEC84762BA' +
'AC19365368EC900FDE6C971A1A07354DD61C3655344EC83B310DD' +
'6ECD715342E6AEAE275DCB4564DBC1F0F352A6BAC55198D17F2C9' +
'1B7AC3F0F6515314D7F243BE88515863CC4B6802743F8AF85C417' +
'AF6A2F87E429037DE980B154D18F24A4C41DC1B11C8CB7F13853C' +
'F3B546AD349A18E4E9BF8943EAFCFFE27ADE24A6CC9A713B83260' +
'16910A389FB3949C61B61104592');
if FindDTM(DTM,x,y,1,1,200,200) then WriteLn('Found the DTM');
End;


Why does this happen?

YoHoJo

2009-10-13 17:23:48

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

2009-10-13 18:01:14

Thanks, I figured it out

reddevil12312

2009-10-17 23:36:15

Nice tut. Very easy to read.

the smith400

2010-12-12 21:08:42

THIS IS AMAZING.

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

Seriously, Amazing!

YoHoJo

2010-12-12 21:10:03

I don't count tutorials as gravedigs. Thank you.

YoHoJo

2011-11-19 04:59:57

Created a video tutorial about DTMs!
http://www.youtube.com/watch?v=SlS4q9MiFX4

lolhahauad

2011-11-19 20:22:20

Wow, this helped me.. just look at the creation date and now.. ITS STILL HANDY, good job ;)

heronimus

2011-11-21 14:59:41

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

2011-11-30 15:45:58

Guide was great, especially both of your videos. I think the video tutorials help people learn a lot easier than most written ones.

YoHoJo

2011-11-30 16:53:24

@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

2011-12-06 17:08:13

Could you create a video tutorial where you will explain walking with DTMs.

I would realy apreciate this.

YoHoJo

2011-12-06 17:25:40

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

2011-12-07 15:23:19

From: YoHoJo
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

2011-12-07 15:30:51

flight was messing with that a week or so ago, I think bitmap walking too

PatDuffy

2011-12-07 21:36:57

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

2011-12-07 21:45:33

Pick the coordinates yourself with the colorpicker tool.
You don't have to use SRLs built in coordinates.

PatDuffy

2011-12-07 21:54:15

I just wasn't sure if there were built-in ones for future reference.
Thanks for the speedy response, Yoho!

YoHoJo

2011-12-07 21:56:50

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

2011-12-31 12:14:11

Thank you for an awesome tutorial! This will be useful.

cause

2012-01-04 13:36:05

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:


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

YoHoJo

2012-01-04 13:38:40

From: cause
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:


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

2012-01-04 20:57:46

lol I know, been here awhile ;). And yeah that worked for me.

ruttedbeez

2012-01-05 02:18:51

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

2012-01-06 12:11:04

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

2012-01-06 15:21:31

after 2 hours watching those 2 tutorial videos, i was like: damn, i forgot everything, where should i start with ? :D

imaloser

2012-01-06 21:16:41

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

2012-01-06 21:19:08

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

2012-01-07 08:18:55

NVM, the tut from DemiseScythe explained how to solve my problem.

mikeym

2012-01-10 20:30:43

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

2012-01-10 20:46:40

Could you phrase that differently please I dont understand what you're asking.

Rally

2012-01-12 13:30:31

Thanks YoHoJo for these these great tutorials :)

honeyhoney

2012-01-19 04:21:50

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

2012-01-19 16:17:06

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

2012-01-20 06:05:24

From: YoHoJo
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

2012-01-20 11:22:35

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

2012-02-29 23:27:11

Very much appreciated! I understand DTMs so much more now!

lolbus

2012-03-05 07:47:50

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

2012-03-05 07:51:10

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

2012-03-05 10:17:50

I watched it and now I understand :) It's very beginner friendly. I am yet to move onto RuneScape bots :)

madyman

2012-03-13 12:05:12

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('78DA63946266606061624006616151609A11C' +
'A671407AAF9C8C8800A9850D54813A14619A8869309BF1A19A01A' +
'3E026AC48850230454C34B400D3F500D070135C24035FF09F84B8' +
'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('mlwAAAHicY2dgYDAAYlUgVgFiIyC2AWJLIDYB4mlAvACIpwJxHxBPBuKZQDwPiM8ukgGSTFjxfwbcgBEPhgIAP/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

2012-03-14 13:11:27

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('78DA63946266606061624006616151609A11C' + 'A671407AAF9C8C8800A9850D54813A14619A8869309BF1A19A01A' + '3E026AC48850230454C34B400D3F500D070135C24035FF09F84B8' + '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

2012-03-21 17:37:50

Thanks for this!
Fixed teleporting problem with the help of this :)

bobbyc

2012-05-05 23:05:41

Great Tutorial! But, how can I make a dtm for an item that is on the ground????

Abu

2012-05-06 12:29:09

From: bobbyc
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

2012-05-07 00:52:05

From: bobbyc
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!

2012-06-09 05:39:03

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/IRAbMDIwaACxGhAbArElEFsAcUC0JoNPuDqDV7gsg1KUCENArDyDo7cSw38G7IARB4YAALWuCtA=');
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

2012-06-09 20:57:10

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

2012-06-12 12:59:37

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

2012-06-12 13:53:54

Much better to do your own better practice.

YoHoJo

2012-06-12 15:59:14

From: MasterCrimez
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

2012-06-12 17:37:57

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('m1gAAAHic42JgYOAHYhkglgdiZSCWAmIRIOZggABWqBo+KJ8JKsYDxGJQ9RJQNSDx0oRYBnNdHQZ+Hl4GdTUlBkMNdQZlJZDpjGAsLyPFICokxEAsYCQSIwAAnr8FFg==');
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

2012-06-12 17:58:14

Im sorry if this is a stupid question.. but i cant seem to find the answer anywhere, where do i download scar?

Master BAW

2012-06-12 18:00:00

MSX1, MSY1, MSX2, MSY2

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

YoHoJo

2012-06-12 18:05:04

From: xTheWayOfTheWarriorx
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

From: MasterCrimez
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

2012-06-12 22:46:36

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

2012-06-18 15:05:12

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

2013-04-29 15:06:47

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('mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BYiPA3EwEEcBcRIQBwCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAoAABUTA8m');
end;

begin
Iron := DTMFromString('mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BYiPA3EwEEcBcRIQBwCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAoAABUTA8m');
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

2013-04-29 17:09:35

From: YoHoJo
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

2013-04-29 17:21:34

From: randy marsh
im going crazyyyy


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

begin
Iron := DTMFromString('mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BYiPA3EwEEcBcRIQBwCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAoAABUTA8m');
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
mlwAAAHicY2dgYNgPxOuAeDcQnwXig0C8BYiPA3EwEEcBcRIQBwCxBxD7AXEMEHvqKgBJRqz4P5DEhbHrgGAoAABUTA8m');


Paste it in the DTM from string with DTM tool.

randy marsh

2013-04-29 17:43:05

where do you put load dtms in?

Haxz

2013-04-29 17:53:13

From: randy marsh
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

2013-04-29 18:19:06

Thanks must of misread the load part

zunkill

2013-05-19 10:00:51

mine doesnt have the test bit on my editor? i can open the DTM but i cant test it :(

g ked

2013-07-25 03:01:47

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

2013-07-30 20:45:43

Also repped. Great and informative tutorial that was easy to understand for the average noob :)