Log in

View Full Version : DTM Script error



sm321
02-28-2012, 05:28 PM
I've followed YoHoJo's Scripting Tutorial: DTMs (http://www.youtube.com/watch?v=SlS4q9MiFX4) and I've currently got this script which is "meant" to open Microsoft Word:

program DTMTest;

($1 SRL\SRL.simba)

var
MSWord, X, Y: integer;

begin
SetupSRL;

MSWord := DTMFromString('mbQAAAHicY2VgYBBggABZKGYCYl4oWxqIGR lg4D8DMYARCwYDAHRSAZw=');

If findDTM(MSWord, X, Y, MSX1, MSY1, MCX2, MSY2) Then
Begin
WriteIn('You clicked Microsoft Word!');
MMouse(x, y, 7, 7);
Mouse(x, y, 0 , 0, True);

end;

FreeDTM(MSWord);

end.

However, I get these errors:


[Error] (4:5): Closing parenthesis expected at line 3
Compiling failed."
and

[Error] (4:1): 'BEGIN' expected at line 3
Compiling failed.

What do I do? Thankyou.

Ashaman88
02-28-2012, 05:34 PM
Try
{$i SRL/SRL.simba}

Instead of the ()

sm321
02-28-2012, 06:31 PM
Try
{$i SRL/SRL.simba}

Instead of the ()

Thanks, that worked. However, now I've got this error:


Exception in Script: Unknown compiler directives at 4:3

Ashaman88
02-28-2012, 07:59 PM
hm I'm not sure about that one, try searching the forums with that phrase and see what you find

LordJashin
02-28-2012, 08:07 PM
Alright


If findDTM(MSWord, X, Y, MSX1, MSY1, MCX2, MSY2) Then
Begin
WriteIn('You clicked Microsoft Word!');
MMouse(x, y, 7, 7);
Mouse(x, y, 0 , 0, True);


x and y need to be X, Y in your mouse functions. Also your trying to find Microsoft Word, your not using Runescape at all. MSX1, MSY1, MCX2, and MSY2 are all runescape coordinates of stuff. XS, XE, YS, YE... XS, XE is the top left of the box you want to start searching from ( imagine it as the top left corner of a box ) YS, YE is the bottom right corner of the box.

FindDTM(MSWord, X, Y, XS, XE, YS, YE); // Something like this is the original function prototype




Try this code instead

var
w, h, X, Y: Integer;

SetClientAsDesktop; // So if your screen is 1024x728 that would be the
// max width and height of your desktop

GetClientDimensions(w, h); // To get the width and height of the client
// which is the desktop

If FindDTM(MSWord, X, Y, 0, 0, w - 1, h - 1) Then
Begin
WriteIn('You clicked Microsoft Word!');
MMouse(X, Y, 7, 7);
// Changed x, y to X, Y
Mouse(X, Y, 0 , 0, True);

sm321
02-29-2012, 07:36 AM
I get this error:


[Error] (9:1): Unknown type 'GetClientDimensions' at line 8
Compiling failed.

Thanks by the way :)