Results 1 to 6 of 6

Thread: But there IS a semicolon... wtf

  1. #1
    Join Date
    Apr 2007
    Location
    UK
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default But there IS a semicolon... wtf

    I keep getting an error that is confusing the hell outta me..
    Failed when compiling
    [Error] (17375:4): Semicolon (';') expected
    And the piece of code it seems to be pointing towards quite clearly has a semicolon... it's rather annoying. This is my first script and I'd like to create it without smashing up my pc. If anyone can point out the probably screamingly obvious mistake I've made it'd be most helpful as I can't see anything wrong atm...

    SCAR Code:
    program AutoLogin;

    {.include SRL/SRL.scar}

    var
    screen : Integer;

    const
    username= 'omghelpme';
    pass= '*****';

    procedure FindScreen;
              begin
                   if (findcolor(x,y,16777215,391,271,532,311)) then
                   begin
                        screen:=0;
                   end else
                       if (findcolor(x,y,65535,434,212,498,231)) then
                          screen:=1;
                       end;


    procedure GoLogin;
              Begin
                   mmouse(x,y,(460+random(5)),(292+random(5)));
                   wait (500+random(500));
                   mouse(x,y,(460+random(5)),(292+random(5)),true);


    //[-----MAIN LOOP------]
    begin
         SetupSRL;
         FindScreen;
         if (screen=0) then
            begin
                 gologin;
            end else
                writeln('Nope...');
         end;
    end.

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program AutoLogin;

    {.include SRL/SRL.scar}

    var
    screen : Integer;

    const
    username= 'watachore';
    pass= 'ascii';

    procedure FindScreen;
              begin
                   if (findcolor(x,y,16777215,391,271,532,311)) then
                   begin
                        screen:=0;
                   end else
                       if (findcolor(x,y,65535,434,212,498,231)) then
                          screen:=1;
                       end;


    procedure GoLogin;
              Begin
                   mmouse(x,y,(460+random(5)),(292+random(5)));
                   wait (500+random(500));
                   mouse(x,y,(460+random(5)),(292+random(5)),true);

              end;
    //[-----MAIN LOOP------]
    begin
         SetupSRL;
         FindScreen;
         if (screen=0) then
            begin
                 gologin;
            end else
                writeln('Nope...');
    end.
    Fixed you had an extra end; in the main loop, and in your procedure above the main loop you did not have an end for that begin.

  3. #3
    Join Date
    Apr 2007
    Location
    UK
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry.. ignore my extreme noobness... I failed to spot the obvious lack of 'end's.. Sorted.. although still confused as to why it pointed me in the completely wrong direction.

    [Edit] Ty v much!

  4. #4
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Dude! You really should fix your standards

    *runs away horrified*
    Interested in C# and Electrical Engineering? This might interest you.

  5. #5
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh and to make sure you don't put extra ends, indent your lines -
    SCAR Code:
    program AutoLogin;

    {.include SRL/SRL.scar}

    var
      screen : Integer;

    const
      username= 'watachore';
      pass= 'ascii';

    procedure FindScreen;
    begin
      if (findcolor(x,y,16777215,391,271,532,311)) then
      begin
        screen:=0;
      end else
      if (findcolor(x,y,65535,434,212,498,231)) then
      screen:=1;
    end;

    procedure GoLogin;
    begin
      mmouse(x,y,(460+random(5)),(292+random(5)));
      wait (500+random(500));
      mouse(x,y,(460+random(5)),(292+random(5)),true);
    end;
    //[-----MAIN LOOP------]
    begin
      SetupSRL;
      FindScreen;
      if (screen=0) then
      begin
        gologin;
      end else
      Writeln('Nope...');
    end.

    It's nearly impossible to add extra ends etc. this way.
    Huehuehuehuehue

  6. #6
    Join Date
    Apr 2007
    Location
    UK
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    By that you mean my 'lets throw bits of code everywhere' approach to coding?

    lol my first day dude.. I'm finding it hard enough not to put my head through the monitor right now... Can't even click the 'existing user' button 'realisticly'.. lol but thats for another thread.. right now i need nicotine bad..

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Semicolon
    By 2pacfan in forum OSR Help
    Replies: 4
    Last Post: 03-20-2008, 09:01 PM
  2. Semicolon help
    By Dangerous Garden Tools in forum OSR Help
    Replies: 17
    Last Post: 03-11-2008, 04:08 PM
  3. Semicolon (';') help
    By TommyGun in forum OSR Help
    Replies: 5
    Last Post: 02-28-2008, 02:55 PM

Posting Permissions

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