SRL Archive - Help

Not Finding DTM?


Vexile

2012-12-25 00:05:50

Hello SRL community. I am new to SRL coding, and i was following a DTM tutorial for using it in your inv, objects, even minimap.

He said to try it on a blood rune, but i chose a vial. Also im doing this in a rsps, 2006 oldschool.

Here is the code:
program VialExamin;
{$i SRL\SRL.simba}//We need this in all scripts.

procedure ExamineVial;

var
x, y, Vial: Integer;// We Declare our DTM, x and y as Integers.
begin//Begins program.

ClearDebug;//Clears debug, keeps it clean.
SetupSRL; //Enables SRL.
Vial := DTMFromString('mwQAAAHic42RgYPBgQmB/IHYEYgcgDgBiZyD2BeLnQHXXgPgzEL9kgPA/AvEHIL4NxHeBuKurH0gy4sX8QJIQxm8CBMMBAAPDDPg=');
//With the above, we Defined our DTM with the code the DTM Editor gave us.
if FindDTM(Vial, x, y, MIX1, MIY1, MIX2, MIY2) then
//FindDTM(DTMname, x, y, xs, ys, xe, ys):Boolean;
MoveMouse(x, y);
ClickMouse(x, y, 2);
ChooseOption('Examine');//Choose Examine in the pop-up.
Writeln('We have examined a Vial!');
end;

begin
ExamineVial;
end.//Ends program.

And Debug:
SRL Compiled in 0 msec
We have examined a blood rune!
Successfully executed.
The following DTMs were not freed: [2]

It's checking the codes, as it said "we have examined a Vial!"

But my mouse didn't move, neither it didn't actrually examined the vial.
I have checked the inv area size for MIX1 - MIX2, and they seems fine.
Thanks for reading.

Ian

2012-12-25 00:12:01

The debug suggests that you were running a different version of what you posted because the debug says blood rune but the code says vial.
And to free the DTM, add
FreeDTM(Vial);
after you`re done using it.

To make the mouse move, you need to add begins and ends after the if statement, like:
if FindDTM(Vial, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MoveMouse(x, y);
ClickMouse(x, y, 2);
ChooseOption('Examine');//Choose Examine in the pop-up.
Writeln('We have examined a Vial!');
end;

otherwise it just reads the 1st line if I`m not mistaken

DannyRS

2012-12-25 00:12:58

You need Begin End; to cover everything after the find dtm


If FindDTM Then
Begin
MoveMouse;
Wait;
Click;
Wait;
End;

Also choseoption include probably wont work on a RPS, so you have to either find the font, or move the mouse from its current position after a right click to where the examine option is, eg, move mouse, click, movemouse current y-50 click

Flight

2012-12-25 00:13:50

Try this instead mate. It should give you better feedback on successful/unsuccessful attempts:

program VialExamin;
{$i SRL\SRL.simba}//We need this in all scripts.

procedure ExamineVial;
var
x,y,Vial: Integer; // We Declare our DTM, x and y as Integers.
begin
Vial := DTMFromString('mwQAAAHic42RgYPBgQmB/IHYEYgcgDgBiZyD2BeLnQHXXgPgzEL9kgPA/AvEHIL4NxHeBuKurH0gy4sX8QJIQxm8CBMMBAAPDDPg=');
//With the above, we Defined our DTM with the code the DTM Editor gave us.
if FindDTM(Vial, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Found the vial');
MMouse(x, y, 5, 5);
ClickMouse2(mouse_left);
if not ChooseOption('Examine') then
Writeln('Could not find Examine option')
else
Writeln('Examined the vial');
end else
Writeln('Did not find the vial DTM');

FreeDTM(Vial);
end;

Begin
SetupSRL; //Enables SRL.
ClearDebug;//Clears debug, keeps it clean.

ExamineVial;
End.

Also, if you're posting Simba scripts I recommend using "[SIMBA}, " tags as opposed to [CODE}, " tags.

Edit:
Also, the coordinates for MIX1,MIY1,MIX2,MIY2 might be wrong because in SRL the Nav. bar is taken into account, so the Y coordinates are +50. You might want to double-check that.

Vexile

2012-12-25 00:16:42

Thanks, that was quick. I don't know why but i have the variable declared already. and it's saying this in the debug box.

[Error] (27:11): Unknown identifier 'Vial' at line 26
Compiling failed.

Also, i add the begin & end; after the finding the DTM.

Vexile

2012-12-25 00:19:36

Thx, flight. It says this: Did not find the vial DTM
Successfully executed.

Vexile

2012-12-25 00:32:12

Guys you have any idea how i can make it find DTM? Because i've seen it used in other rsps scripts.

I've also edited my own Inv Coords.

DannyRS

2012-12-25 00:34:04

From: Vexile
Guys you have any idea how i can make it find DTM? Because i've seen it used in other rsps scripts.


Try a more in depth tutorial on DTM's because i dont think you understand enough about them yet ;)

Flight

2012-12-25 00:39:46

From: Vexile
Guys you have any idea how i can make it find DTM? Because i've seen it used in other rsps scripts.

I've also edited my own Inv Coords.


Send me Post a screenshot of it in your inventory and I'll make you a DTM.

Vexile

2012-12-25 00:47:58

Here ya go! And thx! If you have skype, you can me. I really willing to learn more from a experienced person.
http://puu.sh/1F10p

Flight

2012-12-25 00:53:14

Give this one a try bud:

Vial := DTMFromString('mggAAAHicY2NgYJjEzMAwGYi7gXgmEM8C4h4gXsQIlAPihUC8AIhXQXFRSSHDggnODCxAvUBlYBqERXBgRhwYAgDhvQqu');

Vexile

2012-12-25 01:01:29

Thanks man, but my Debug said:

Did not find the vial DTM
Successfully executed. =(
Btw i read this Whole guide, aswell this video.

http://villavu.com/forum/showthread.php?t=77691
http://www.youtube.com/watch?v=SlS4q9MiFX4

Pew

2012-12-25 05:50:35

Also having the same problem on a private server. I can take a screen capture of client and it locates the DTM fine but ingame it can't find it hence it can't find it's coordinates.

Vexile

2012-12-25 12:10:30

I somewhat fixed it. Here is the simba code.
program TestDTM;
{$i SRL\SRL.simba}

var
SnapeGrass, X, Y: Integer;


begin
SnapeGrass := DTMFromString('mwQAAAHic42RgYHBjYmDwYILQoUBsBcQOQOwHxP5AbAfEj4DqrgPxeyB+C8SPgfgmEH8E4odA/BKIWQP1gCQjXszPQBjgNwGC4QAAVZkLSg==');

if FindDTM(SnapeGrass, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
MoveMouse(X, Y);
wait(50);
ClickMouse2(mouse_right);
MoveMouse(X, Y+70);
ClickMouse2(mouse_left);
end;
FreeDTM(SnapeGrass);
end.

DannyRS

2012-12-25 12:25:39

Remember MIX1 and the other included variables are for the real game and will porbably not accurate for an rps

rj

2012-12-25 15:26:39

From: Pew
Also having the same problem on a private server. I can take a screen capture of client and it locates the DTM fine but ingame it can't find it hence it can't find it's coordinates.


Make sure you use plenty of points and use color tolerance in the dtm