Results 1 to 4 of 4

Thread: Need help with eating

  1. #1
    Join Date
    Mar 2013
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Need help with eating

    Simba gives this error when i try to run my script: Semicolon (';') expected at line 89
    Compiling failed.

    Code:
    procedure eat
    var  <-- line 89
      salmon; Integer;
    begin
    salmon := DTMFromString('mkwEAAHicE2ZgYOAFYhYgZgZiNgYI4ABibiDmB2IhIBYFYgkglgFiSShbFCoHUsMDxFxQWhwqxgtVIw6lhZHUckLtYobaB7ObBUqD5LfYgXQxUglTD1DLRThcBQCvuQMw');
      If findDTM (salmon, X, Y, MSX1, MSY1, MSX2, MSY2);
      Writein('Found salmon')
      MMouse(x, y, 3, 3)
      If IsUpText('at salm') Then
      Writein('Eating salmon'
      Mouse(x, y, 0, 0, True)
      End:

  2. #2
    Join Date
    Mar 2013
    Location
    The Netherlands
    Posts
    185
    Mentioned
    2 Post(s)
    Quoted
    70 Post(s)

    Default

    procedure eat;
    Simba Code:
    procedure eat;
    var
      salmon : Integer; // changed ; to :
    begin
      salmon := DTMFromString('mkwEAAHicE2ZgYOAFYhYgZgZiNgYI4ABibiDmB2IhIBYFYgkglgFiSShbFCoHUsMDxFxQWhwqxgtVIw6lhZHUckLtYobaB7ObBUqD5LfYgXQxUglTD1DLRThcBQCvuQMw');
      If findDTM (salmon, X, Y, MSX1, MSY1, MSX2, MSY2) then //Changed to then
      begin
        Writein('Found salmon'); // added ; to function end
        MMouse(x, y, 3, 3);
       
        If IsUpText('at salm') Then
        begin
          Writein('Eating salmon'); // added );
          Mouse(x, y, 0, 0, True);
        end;
      end;
    End; // changed to ; instead of :

    Don't forget to free the DTM!
    Last edited by jelknab; 05-11-2013 at 11:10 AM.
    Nothing to do here :l.

  3. #3
    Join Date
    Sep 2012
    Location
    Australia.
    Posts
    839
    Mentioned
    16 Post(s)
    Quoted
    225 Post(s)

    Default

    Quote Originally Posted by pwnedbymeh View Post
    Simba gives this error when i try to run my script: Semicolon (';') expected at line 89
    Compiling failed.
    Try this

    Simba Code:
    procedure eat;
    var  //<-- line 89
      x, y, salmon: Integer;
    begin
    salmon := DTMFromString('mkwEAAHicE2ZgYOAFYhYgZgZiNgYI4ABibiDmB2IhIBYFYgkglgFiSShbFCoHUsMDxFxQWhwqxgtVIw6lhZHUckLtYobaB7ObBUqD5LfYgXQxUglTD1DLRThcBQCvuQMw');
      If findDTM (salmon, X, Y, MSX1, MSY1, MSX2, MSY2) then
        Writeln('Found salmon');
        MMouse(x, y, 3, 3);
        If IsUpText('at salm') Then
          Writeln('Eating salmon');
          Mouse(x, y, 0, 0, True);
    end;

    Alright. I'll go through what I edited to make it work.

    Line 78 - You need a semi-colon after your procedure name.
    Line 80 - You needed to add x and y to your variables, unless they're in your global variables.
    Line 84 - You needed a then after it instead of a semi-colon.
    Line 85 - It's not 'Writein' it's 'WriteLn'. It has an L in there instead of the I. You also needed a semi-colon after it. The only time it doesn't need one is when it's only one line.
    Line 86 - Needed semi-colon after.
    Line 88 - Needed a closing bracket after the '. Also needed a semi-colon.
    Line 89 - Needed a semi-colon.
    Line 90 - You don't end a procedure with a :, you also place a semi-colon after end unless you're using end else.

    Hope this cleared it up for you. Good luck!

  4. #4
    Join Date
    Mar 2013
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    thanks

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
  •