Results 1 to 13 of 13

Thread: Semicolon expeted

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

    Default Semicolon expected

    I have this script so far, from YoHoJo's Scripting Tutorial #1

    Simba Code:
    program SaveTheGoldfish;

    procedure StartGame;
    begin
      MoveMouse(239, 364);
      ClickMouse(239, 364, 1);
      Wait(700);
      MoveMouse(398,324);
      ClickMouse(398, 324, 1);
      Wait(700);
      MoveMouse(352, 160);
      ClickMouse(352, 160, 1);
      End;

    procedure SaveGoldfish;
      var
      x, y:Integer;
    begin
     If FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 1137660, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 869629, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 1869629, 1798, 596, 530, 470, 20) Then
    begin
      MoveMouse(x, y);
      HoldMouse(x, y, 1)
      MoveMouse(639, 292);
      ReleaseMouse(639, 292, 1)
      End;
    end

    begin;
      StartGame;
      Repeat
        SaveGoldfish;
      until(false);
    end;

    And I'm getting this message "[Error] (32:1): Semicolon (';') expected at line 31
    Compiling failed." and I have absolutely no idea why.
    Last edited by sm321; 02-24-2012 at 11:18 AM.

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Simba Code:
    program SaveTheGoldfish;

    procedure StartGame;
    begin
      MoveMouse(239, 364);
      ClickMouse(239, 364, 1);
      Wait(700);
      MoveMouse(398,324);
      ClickMouse(398, 324, 1);
      Wait(700);
      MoveMouse(352, 160);
      ClickMouse(352, 160, 1);
    End;

    procedure SaveGoldfish;
      var
      x, y:Integer;
    begin
      If FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 1137660, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 869629, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 1869629, 1798, 596, 530, 470, 20) Then
      begin
        MoveMouse(x, y);
        HoldMouse(x, y, 1)
        MoveMouse(639, 292);
        ReleaseMouse(639, 292, 1)
      End;
    end; //added ;

    begin;
      StartGame;
      Repeat
        SaveGoldfish;
      until(false);
    end. //added .
    Working on: Tithe Farmer

  3. #3
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Simba Code:
    program SaveTheGoldfish;

    procedure StartGame;
    begin
      MoveMouse(239, 364);
      ClickMouse(239, 364, 1);
      Wait(700);
      MoveMouse(398,324);
      ClickMouse(398, 324, 1);
      Wait(700);
      MoveMouse(352, 160);
      ClickMouse(352, 160, 1);
      End;

    procedure SaveGoldfish;
      var
      x, y:Integer;
    begin
     If FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 1137660, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 869629, 798, 596, 530, 470, 20) or
        FindColorSpiralTolerance(x, y, 1869629, 1798, 596, 530, 470, 20) Then
      begin
        MoveMouse(x, y);
        HoldMouse(x, y, 1);
        MoveMouse(639, 292);
        ReleaseMouse(639, 292, 1);
      end;
    end;

    begin
      StartGame;
      Repeat
        SaveGoldfish;
      until(false);
    end.

    Edit:
    I got 'd...

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  4. #4
    Join Date
    Dec 2011
    Posts
    273
    Mentioned
    0 Post(s)
    Quoted
    39 Post(s)

    Default

    I could be wrong.. but if you look at Save Goldfish.. there are 2 End;'s try making another one.. it might just work for you :3

    Or the 2nd end doesn't have a semicolon try that too :3
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

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

    Default

    Quote Originally Posted by VillaVuFTW View Post
    I could be wrong.. but if you look at Save Goldfish.. there are 2 End;'s try making another one.. it might just work for you :3

    Or the 2nd end doesn't have a semicolon try that too :3
    Yes! It's worked. Thankyou

  6. #6
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    lol, you guys are so slow. On another note: You should swap the coordinates of the color find functions. Start with the high ones like this:

    Simba Code:
    FindColorSpiralTolerance(x, y, 1271548, 530, 470, 798, 596, 20) or

    instead of:

    Simba Code:
    FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
    Working on: Tithe Farmer

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

    Default

    Another problem.

    "Error: Exception: You passed wrong values to a finder function: xs > xe (798,530). at line 19"

  8. #8
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Already answered it above: you're to slow :P
    Working on: Tithe Farmer

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

    Default

    Quote Originally Posted by masterBB View Post
    lol, you guys are so slow. On another note: You should swap the coordinates of the color find functions. Start with the high ones like this:

    Simba Code:
    FindColorSpiralTolerance(x, y, 1271548, 530, 470, 798, 596, 20) or

    instead of:

    Simba Code:
    FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
    I'll give that a go now. I've got this again "Compiled successfully in 31 ms.
    Error: Exception: Out of memory at line 19". It compiled fine, and then that message came up. Here's the code I have now:

    Simba Code:
    program SaveTheGoldfish;

    procedure StartGame;
    begin
      MoveMouse(239, 364);
      ClickMouse(239, 364, 1);
      Wait(700);
      MoveMouse(398,324);
      ClickMouse(398, 324, 1);
      Wait(700);
      MoveMouse(352, 160);
      ClickMouse(352, 160, 1);
      End;

    procedure SaveGoldfish;
      var
      x, y:Integer;
    begin
     If FindColorSpiralTolerance(x, y, 1271548, 530, 470, 798, 596, 20) or
        FindColorSpiralTolerance(x, y, 1137660, 530, 470, 798, 596, 20) or
        FindColorSpiralTolerance(x, y, 869629, 530, 470, 798, 596, 20) or
        FindColorSpiralTolerance(x, y, 1869629, 530, 470, 798, 596, 20) Then
    begin
      MoveMouse(x, y);
      HoldMouse(x, y, 1)
      MoveMouse(639, 292);
      ReleaseMouse(639, 292, 1)
      End
    end;

    begin;
      StartGame;
      Repeat
        SaveGoldfish;
      until(false);
    end.
    Last edited by sm321; 02-24-2012 at 11:12 AM.

  10. #10
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    I don't get that error, it compiles fine here...
    Working on: Tithe Farmer

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

    Default

    Quote Originally Posted by masterBB View Post
    I don't get that error, it compiles fine here...
    It compiled, but when it actually played, it said that.

    EDIT: I needed to put the cross-hair on the box. Although, it loads at the start, and doesn't actually pick up the fish? "Compiled successfully in 31 ms.
    Error: Exception: You passed a wrong xe to a finder function: 798. The client has a width of 480, thus the xe is out of bounds. at line 19". Got that error too. Sorry about this
    Last edited by sm321; 02-24-2012 at 11:27 AM.

  12. #12
    Join Date
    Feb 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I get the same error, dont know what to do, im a total newbie at this

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

    Default

    Quote Originally Posted by budbud2oo7 View Post
    I get the same error, dont know what to do, im a total newbie at this
    I re-did the script and it works now Were you watching his tutorial too? Because I have the working script if you want it

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
  •