SRL Archive - OSR Help

DTM Troubles


Archaic

2012-02-10 17:30:54

I've recently been using DTMs to find some very specific items on the main screen. I've got the script set up, everything checked and ready to go but every time I set my DTMs they simply don't work.

I've been using the DTM editor but every time I re-paste my DTM strings into the DTM string portion of the editor it places my DTM in the far left corner of the screen even though I meticulously created the DTM at an entirely different part of the screen.

I can't seem to figure it out and I'm probably making a stupid error/assumption, which wouldn't be the first time when it came to SRL. Anyway, any help would be greatly appreciated! Any thoughts on how I can remedy this problem of the DTM editor placing my DTM's in the far left of the screen and thus making them not work in my script?

Nebula

2012-02-10 18:42:50

Are you looking for something like an item in a bank, or a moving object, such as an item on the ground? If it's a moving object you will have to use FindDTMRotated();

Either way post some code so we can help you further.

Archaic

2012-02-10 19:26:34

I'm looking for a static object on the main screen that doesn't move (I'm making, err, trying to make a wilderness agility course script so the DTMs are for the various obstacles), and I have been using DTMRotated for this object (could that cause problems?). I think the trouble may possibly be coming from colors in general as the objects are in the wilderness that only has the vibrant colors of black, grey, brown, and the occasional off-grey so color identification could be causing some problems but I honestly don't think that should affect my dtms that much.

I had the script working immediately after I made my DTMs, but I came back to it today and the strings I had set no longer worked. I considered that it could be due to runescape updating or an error in setting camera angle/direction but that wasn't the case, and after checking my strings in the editor it showed me that they were way out in the middle of nowhere in comparison to what I had the day before.

This is the script that I had been using to test my dtms (as such there isn't really standards as it's more a proof of concept than anything), which worked but sadly does not work now with the same strings haha.

program dtmTester;
{$DEFINE SRL5}
{$i SRL/srl.simba}
var

tube,x,y:integer;
afound: Extended;

begin
SetupSRL;

tube :=DTMFromString('m6wAAAHic42ZgYPgPxD+AmJORgYENiL8A2QxA+htU7BOQ/gDEXEB2AJCOBuIIIPYFYj8gzgbiHCDOAOIkIA4D4kAgNjE1Y/ALCATTeYXFDFGxcQy8vLwM7p5ecOzq5sEQEBTMQApgJAEjAQDN/BL4');



if FindDTMRotated(tube, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) Then
begin
writeln('Yay we found it');
MMouse(x, y, 3, 3);
Mouse(x, y, 0, 0, True);
end;

If not FindDTM(tube, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
writeln('we didnt find it');
end;


FreeDTM(Tube);



end.

YoHoJo

2012-02-10 19:32:28

I highly suggest using DTMs for the main screen, as do many other people.
Color is the way to go for mainscreen stuff. Check this out: http://www.youtube.com/watch?v=98wVrr6GwyU

Nebula

2012-02-10 19:33:04

Find the obstacles using TPAs, it will be much more efficient. If you don't know how to use TPAs, try FindObjCustom(); or FindObjTPA;

Archaic

2012-02-10 20:34:46

Ok! Color it is. I have done some personal stuff with color, I just thought I'd give DTMs a go. But for now we'll put those away haha. Though I may bring them out for food usage. Thank you guys for your help! And Yoho, I've watched all your tutorial vids–they're awesome! They've helped little ol' me try a little scripting. I've used a little ACA, but now it looks like i'm gonna get a bit more familiar with it.:)

I'm still a bit curious though, why would my DTMs mess up like that all of a sudden? Rookie mistakes probably?