Log in

View Full Version : DTM Question



Element17
04-18-2012, 10:18 PM
I hit run and it just ends....why? I had it working two hours ago and then I added the third DTM Q2 and not it doesn't work. I just made these DTMs at 5:15 so they are new.

Program ClanToGuild;
//{$DEFINE SMART}
{$i srl/srl.simba}

Var
X, Y: Integer;
Q: Array [0..2] of Integer;//DTM Declaring procedure.
aFound: Extended;

Procedure SetDTM;//DTM Defining procedure. //DTM for walking
Begin
Q[0] := DTMFromString('mlwAAAHicY2dgYIhlYmBIAuJKIM4C4kQg9g HiUCC+A5Q/AcRPgfg/EP8D4u9AfA6Ig8IDGKwcVIAsRgaDZDEGMwdZhhBnGbA4SC0/DsyIB0MBAL+YDuU=');
Q[1] := DTMFromString('mlwAAAHicY2dgYOhnYmDoAOJ1QLwCiDOAeD 4QlwExDyMDw2Wgmt1AzM4IwbZA7ADEYWGBDBFOsgxzZ09lCPZR Z/jCysIQH6bD8PbtB4b/QPX8ODAjHgwFAAI7EHk=');
Q[2] := DTMFromString('mlwAAAHicY2dgYPBjYmBIB+JsIPYBYncmiF gSEP8HyjMzMjAcBNJiQJoRiO8D2bxAOig8gCHEWYZh5pwpDF/ZmBkUIoXAYmHBmmB9/DgwIx4MBQDoow1s');
End;

Procedure FrDTM;//DTM Freeing procedure.
Begin
FreeDTM(Q[0]);
FreeDTM(Q[1]);
FreeDTM(Q[2]);
End;



Begin
SetupSRL;
ActivateClient;
SetDTM;


If FindDTMRotated(Q[0], X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) Then
Begin
Mouse(x, y, 3, 3, True);
Writeln('Walking to point');
FFlag(6);
Repeat
Wait(50 + Random(25));
Until FindDTMRotated(Q[1], X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
End;
If FindDTMRotated(Q[1], X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) Then
Begin
Mouse(x, y, 3, 3, True);
Writeln('Walking to point');
FFlag(6);
Repeat
Wait(50 + Random(25));
Until FindDTMRotated(Q[2], X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
End;
If FindDTMRotated(Q[2], X, Y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) Then
Begin
Mouse(x, y, 3, 3, True);
Writeln('Walking to point');
FFlag(6);
End;
FrDTM;
end.

YoHoJo
04-18-2012, 10:20 PM
Does it Writeln('Walking to point'); ?
If not, then the DTM Q[0] is not being found, so re-make it and try again.

I suggest you look into ObjectDTMs for minimap walking, they are AMAZING!

Joe
04-18-2012, 10:21 PM
Does it Writeln('Walking to point'); ?
If not, then the DTM Q[0] is not being found, so re-make it and try again.

I suggest you look into ObjectDTMs for minimap walking, they are AMAZING!

I totally agree. You also don't get those stupid SPS errors and they are so much more accurate. I know Abu_Jwka has a great tutorial, and so does Euphenism.

Total
04-18-2012, 10:23 PM
Use the DTM Editor and convert your DTMs from string(DTM>DTM From String in DTM editor) and copy the code in between the '' and paste it in there, then see if you can match the DTM still. There may be something in the way or something else.

Element17
04-18-2012, 10:29 PM
Does it Writeln('Walking to point'); ?
If not, then the DTM Q[0] is not being found, so re-make it and try again.

I suggest you look into ObjectDTMs for minimap walking, they are AMAZING!


I've used ObjectDTMs before and I tired with to earlier with them but they weren't working. I will try again, just frustrating at times having some methods work for me sometimes and other times not so.

YoHoJo
04-18-2012, 10:35 PM
Yeah MiniMap walking is pretty hit and miss and hard to get a prefect constantly working.
Lots of trial and error, but once you get it it feelssogood!

Element17
04-18-2012, 10:43 PM
Haha that is true!

Well I got this one point to work with ObjDTM
procedure ClanToGuild;
var
cx, cy: Integer;
begin
if ObjDTM_Find('26:39:4:1:7:27:75:1:7:14:97:10:7:66:4 9:10:7:92:62:4:20:36:41:32:43:51:17:53', cx, cy, True) then
begin
Writeln('Found point');
ObjDTM_Walk('26:39:4:1:7:27:75:1:7:14:97:10:7:66:4 9:10:7:92:62:4:20:36:41:32:43:51:17:53', 2, 100, 5, True);
end else
Writeln('Could not find point');
end;

begin
SetUpSRL;
ObjDTM_Setup;
ClanToGuild;
end.

Anyway to add a failsafe in there? Like a DTM or something? Never added failsafe's to walking procedures before.

Abu
04-19-2012, 05:41 AM
Anyway to add a failsafe in there? Like a DTM or something? Never added failsafe's to walking procedures before.

Erm isn't quite obvious? You can put the failsafe after end else! :p
So if it didn't find it then it will try your backup method...

Element17
04-19-2012, 03:56 PM
*Face-palm* yeah..haha thanks! Also thanks for answering back my PM.