Results 1 to 3 of 3

Thread: Semicolon expected?

  1. #1
    Join Date
    Sep 2012
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default Semicolon expected?

    So I'm writing a very basic defend your castle script (remember that game where you fling stick people in the air), I got everything working like a charm with the code like this:

    program CastleDefence;
    procedure clickok;
    var
    q, w, e, t: integer;
    begin
    if FindColorSpiralTolerance(q, w, 10066329, 910, 650, 1015, 711, 0) then
    begin
    MoveMouse(q, w);
    ClickMouse(q, w, 1);
    end;
    wait(2000);
    if FindColorSpiralTolerance(e, t, 10066329, 1175, 680, 1280, 730, 0) then
    begin;
    MoveMouse(e, t);
    ClickMouse(e, t, 1);
    end;
    end;
    procedure Protect;
    var
    x, y, r: integer;
    begin
    if FindColorSpiralTolerance(x, y, 13421772, 280, 500, 880, 700, 0) and
    FindColorSpiralTolerance(x, r, 0, 280, 500, 880, 700, 0) then
    begin
    MoveMouse(x, y);
    HoldMouse(x,y,1);
    MoveMouse(1100,10);
    wait(10);
    ReleaseMouse(1100,10,1);
    end;
    end;



    var
    q, w, e, t: integer;
    begin
    repeat
    Protect;
    until FindColorSpiralTolerance(q, w, 10066329, 910, 650, 1015, 711, 0) or
    FindColorSpiralTolerance(e, t, 10066329, 1175, 680, 1280, 730, 0)
    end.



    Yet whenever I change my protect procedure to add more enemies, making it this:
    procedure Protect;
    var
    x, y, r, g, h: integer;
    begin
    if FindColorSpiralTolerance(g, h, 6710886, 280, 500, 880, 700, 0) then
    begin
    MoveMouse(g, h)
    ClickMouse(g, h, 1)
    end
    if FindColorSpiralTolerance(x, y, 13421772, 280, 500, 880, 700, 0) and
    FindColorSpiralTolerance(x, r, 0, 280, 500, 880, 700, 0) then
    begin
    MoveMouse(x, y);
    HoldMouse(x,y,1);
    MoveMouse(1100,10);
    wait(10);
    ReleaseMouse(1100,10,1);
    end;
    end;

    It says this [Error] C:\Simba\Scripts\Castledefence1.simba(28:5): Semicolon (';') expected at line 27. This even happens if I add a semicolon to the end of line 27: the line that says "if FindColorSpiralTolerance(x, y, 13421772, 280, 500, 880, 700, 0) and"

    What did I do wrong? Sorry for being a noob. I probably posted this script wrong too, I'll fix it if I did.

  2. #2
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    begin
    MoveMouse(g, h)
    ClickMouse(g, h, 1)
    end
    your missing the ; on end.

    also when posting code in future use the [simba] tags

  3. #3
    Join Date
    Sep 2012
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default

    aaaaaaaaaah, thank you very much

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
  •