Results 1 to 6 of 6

Thread: DTM Script error

  1. #1
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default DTM Script error

    I've followed YoHoJo's Scripting Tutorial: DTMs and I've currently got this script which is "meant" to open Microsoft Word:

    Simba Code:
    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:

    Code:
    [Error] (4:5): Closing parenthesis expected at line 3
    Compiling failed."
    and
    Code:
    [Error] (4:1): 'BEGIN' expected at line 3
    Compiling failed.
    What do I do? Thankyou.

  2. #2
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  3. #3
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ashaman88 View Post
    Try
    {$i SRL/SRL.simba}

    Instead of the ()
    Thanks, that worked. However, now I've got this error:

    Code:
    Exception in Script: Unknown compiler directives at 4:3

  4. #4
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

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

  5. #5
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Alright

    Simba Code:
    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.

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




    Try this code instead

    Simba Code:
    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);
    Last edited by LordJashin; 02-28-2012 at 08:16 PM.

  6. #6
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I get this error:

    Code:
    [Error] (9:1): Unknown type 'GetClientDimensions' at line 8
    Compiling failed.
    Thanks by the way

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •