SRL Archive - Help

DTM Script error


sm321

2012-02-28 12:28:44

I've followed YoHoJo's Scripting Tutorial: DTMs 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('mbQAAAHicY2VgYBBggABZKGYCYl4oWxqIGRlg4D8DMYARCwYDAHRSAZw=');

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

2012-02-28 12:34:32

Try
{$i SRL/SRL.simba}

Instead of the ()

sm321

2012-02-28 13:31:38

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

2012-02-28 14:59:47

hm I'm not sure about that one, try searching the forums with that phrase and see what you find

LordJashin

2012-02-28 15:07:28

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

2012-02-29 02:36:44

I get this error:

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

Thanks by the way :)