Results 1 to 8 of 8

Thread: Error

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

    Default Error

    I'm currently making a script, and it's already not working. I've got:

    Simba Code:
    program new;

    var

    counter:integer;

    begin

      Wait(1000);

    end;

    procedure Hot;
    begin

      KeyDown(9);
      Wait(20);
      KeyUp(9);

    end;

    begin
    repeat
      Hot;
      Inc(Counter);
      Until
      Counter >= 9;

    end.

    but I get this error:

    Code:
    [Error] (12:4): period ('.') expected at line 11
    Compiling failed.

  2. #2
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Simba Code:
    program new;

    var

    counter:integer;


    procedure Hot;
    begin

      KeyDown(9);
      Wait(20);
      KeyUp(9);

    end;

    begin
    wait(1000);
      repeat
      Hot;
      Inc(Counter);
      Until
      Counter >= 9;
      end.

    You were using your main loop first!
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

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

    Default

    Either make this a procedure/function or remove this from the script
    Simba Code:
    begin

      Wait(1000);

    end;
    Wish I could explain why it needs to be a procedure/function but I don't know myself =[

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

    Default

    Quote Originally Posted by begginer View Post
    Simba Code:
    program new;

    var

    counter:integer;


    procedure Hot;
    begin

      KeyDown(9);
      Wait(20);
      KeyUp(9);

    end;

    begin
    wait(1000);
      repeat
      Hot;
      Inc(Counter);
      Until
      Counter >= 9;
      end.

    You were using your main loop first!
    Sorry Thanks I thought it would repeat the

    Simba Code:
    Wait(1000);

    but now I look at it it's right

    Quote Originally Posted by 68z35h9 View Post
    Either make this a procedure/function or remove this from the script
    Simba Code:
    begin

      Wait(1000);

    end;
    Wish I could explain why it needs to be a procedure/function but I don't know myself =[
    Ok, thanks

  5. #5
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    I think a function can be made at the very beginning at the script and can be used on procedure. I think it never tried

    There a small button to rep me if I have helped you.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

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

    Default

    Quote Originally Posted by begginer View Post
    I think a function can be made at the very beginning at the script and can be used on procedure. I think it never tried

    There a small button to rep me if I have helped you.
    Infact, I think that has sort of answered a question of mine. Can you instead of writing a new

    Simba Code:
    begin
    wait(1000);
    repeat
    until (false);
    end;

    every single time, make a "shortcut" so that you can just make each procedure do it a different number of times?

  7. #7
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by sm321 View Post

    every single time, make a "shortcut" so that you can just make each procedure do it a different number of times?
    Can you expand on that?

    You mean make it do the procedure a certain number of times?

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

    Default

    Quote Originally Posted by abu_jwka View Post
    Can you expand on that?

    You mean make it do the procedure a certain number of times?
    Say for example you have

    Simba Code:
    program Example;

    var

    counter:integer;

    procedure Example2;
    begin

      KeyDown(9);
      KeyUp(9);

    end;



    begin
    repeat
      Example2;
      Inc(Counter);
      Until
      Counter >= 10;

    end.

    and you wanted to do ALOT of procedures similar to that, are there any shortcuts other than adding


    Simba Code:
    program Example;

    var

    counter:integer;

    procedure Example2;
    begin

      KeyDown(9);
      KeyUp(9);

    end;

    procedure Example3;
    begin

      KeyDown(9);
      KeyUp(9);

    end;

    begin
    repeat
      Example2;
      Inc(Counter);
      Until
      Counter >= 9;

    end;

    begin
    repeat
      Example3;
      Inc(Counter);
      Until
      Counter >= 20;

    end.

    every single time?

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
  •