Page 2 of 2 FirstFirst 12
Results 26 to 38 of 38

Thread: Common Scripting Errors

  1. #26
    Join Date
    May 2012
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    [Error] C:\Simba\Scripts\RimmingtonMiner (2).simba(1136:3): 'BEGIN' expected at line 1135

    This one isn't in the tutorial?

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

    Default

    You've got one end; more then you got a begin. Example of code that will create your error:

    no begin
    Simba Code:
    program new;

      writeln('hello');
    end.

    should be

    Simba Code:
    program new;

    begin
      writeln('hello');
    end.

    one end; more then you got begin
    Simba Code:
    program new;

    begin
      if 1 > 3 then
        writeln('how odd!');
      end;
    end.

    should be

    Simba Code:
    program new;

    begin
      if 1 > 3 then
      begin
        writeln('how odd!');
      end;
    end.

    or

    Simba Code:
    program new;

    begin
      if 1 > 3 then
        writeln('how odd!');
    end.
    Working on: Tithe Farmer

  3. #28
    Join Date
    May 2012
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    You've got one end; more then you got a begin. Example of code that will create your error:

    no begin
    Simba Code:
    program new;

      writeln('hello');
    end.

    should be

    Simba Code:
    program new;

    begin
      writeln('hello');
    end.

    one end; more then you got begin
    Simba Code:
    program new;

    begin
      if 1 > 3 then
        writeln('how odd!');
      end;
    end.

    should be

    Simba Code:
    program new;

    begin
      if 1 > 3 then
      begin
        writeln('how odd!');
      end;
    end.

    or

    Simba Code:
    program new;

    begin
      if 1 > 3 then
        writeln('how odd!');
    end.
    After adding "Begin", and saved, try to start it.. This message get at my logscreen..

    [Error] C:\Simba\Scripts\RimmingtonMiner (2).simba(1137:3): Unknown identifier 'arP' at line 1136
    Compiling failed.

  4. #29
    Join Date
    Apr 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default .Error: Exception: FindDTMs: DTM[] is not consistent at line 260

    what is mean?
    Compiled successfully in 1422 ms.
    Error: Exception: FindDTMs: DTM[] is not consistent. at line 260
    The following DTMs were not freed: [0, 1, 2]




    Quote Originally Posted by abu_jwka View Post
    This is a tutorial for those who get errors while trying to create a script not run one. For errors when trying to run a script go to: So, you get an error huh? and the FAQ

    Without further adieu:

    • Semicolon (';') expected at line xx
      This means on the above line, you forgot to put a semicolon ; at the end of it
      ---
    • Identifier Expected at Line xxx
      It's cause by not having enough end; meaning you the number of begins and ends in your procedure/function do match up - there needs to be an equal number. Also note that a case needs and end; too.
      ---
    • Unknown identifier '' at line xx
      There are various reasons why this are caused.
      Firstly, it may be because you have an undeclared variable. By this I mean you want a word to represent a value and you use it, such as:
      Simba Code:
      procedure Logs;
      begin
        Logs := 2;
      end;
      You need to tell the script what 'Logs' represnt, to do this you have to decalre it as a variables, so:
      Simba Code:
      procedure Logs;
      var
        Logs: Integer; // declared here as an integer, which a whole number
      begin
        Logs := 2;
      end;


      Another reason it because you may have misspelled a function, such as spelling WriteLn as WriteIn <- with an 'i', which means that Simba has no idea what the function is supposed to mean

      The final reason you may have got this error is because you forgot to include Simba, make sure you have this after you define smart:
      Simba Code:
      {$i srl\srl.simba}

      And this in your mainloop:
      Simba Code:
      SetUpSRL; // put before your functions

      ---
    • Assignment expected at line xx
      This means, when writing the equals sign in simba, you put the colon but forgot to put the actual equals sign. It should:
      Simba Code:
      i := 2; //look like this
      i :2; // not this
      ---
    • Error: Exception: Access violation at line 101
      When trying to script - if you get this error it means you have forgotten to put SetUpSRL; at the start of your mainloop
      ---
    • Duplicate Identifier '' at Line xx
      There are a few reason why this may occur.

      The first is because you have made two procedures/functions with the same name.

      The second is because you have made a procedure/function with a name that already exists in the SRL Include.

      The third is because you named a variable the same as a procedure or function that already exists in the SRL Include.
      ---
    • Invalid number of parameters at line xx
      This means, when using a function you have not put the right amount of values within the brackets. This is either because you just haven't, or you missed out a comma.
      In this case, you may also get the rror:
      Code:
      comma (',') expected at line xx
      ---
    • Closing square bracket (']') expected at line xx
      When you use a square bracket [, make sure you close it with a closed square bracket ]
      ---
    • Closing parenthesis expected at line 21
      Simple means you have forgotten to put a closing bracket ) at that line, go to the line and put in the bracket or remove the extra bracket if that is the problem.
      ---
    • Colon (':') expected at line xx
      Usually occurs when you make a function but forget to write what it returns. For example:
      Simba Code:
      function HeyThere; // will not compile
      function HeyThere: Boolean; // tells Simba it returns a boolean, will compile
      ---
    • Syntax error at line xx
      This means you've messed up somewhere when using signs - usually the equals sign. Make sure they are correct.
      ---
    • Type mismatch at line xx
      The most common reason this error occurs is because you have entered a value wrong within the brackets for a function.

      For example you have written an integer (number) when there should be a string (word). Or if you have declared something as a string or integer when it should've been the other way round.

      Another reason may be because when using functions such as FindObjCustom, which allow you to put multiple uptexts and colours, the multiple uptexts and colours must go within square brackets regardless of the amount you use. So:
      Simba Code:
      FindObjCustom(x, y, 'heymama', [234, 567], 20); // will not compile
      FindObjCustom(x, y, ['heymama'], [234, 567], 20); //this will because it has square brackets around the uptext 'heymama'

      Having said the above point, you will also get a mismatch error if you use normal brackets where square brackets are needed.
      ---

    • Unexpected end of file at line 0
      This error occurs when you are missing your final end. Put it in and remember that it needs a period(.) after it as it is the last one.
      ---


    So yeh there is a list of the most common errors people seem to be getting when trying to make scripts, hopefully this will help you on your way!

    If you want any common errors to be added to this list let me know. Also, be sure to point out any reason I may not have mentioned for errors

    Like, comment and subscribe *lool*
    what is mean this error.

  5. #30
    Join Date
    Apr 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you forgot to mention out of range dudes


    Quote Originally Posted by abu_jwka View Post
    This is a tutorial for those who get errors while trying to create a script not run one. For errors when trying to run a script go to: So, you get an error huh? and the FAQ

    Without further adieu:

    • Semicolon (';') expected at line xx
      This means on the above line, you forgot to put a semicolon ; at the end of it
      ---
    • Identifier Expected at Line xxx
      It's cause by not having enough end; meaning you the number of begins and ends in your procedure/function do match up - there needs to be an equal number. Also note that a case needs and end; too.
      ---
    • Unknown identifier '' at line xx
      There are various reasons why this are caused.
      Firstly, it may be because you have an undeclared variable. By this I mean you want a word to represent a value and you use it, such as:
      Simba Code:
      procedure Logs;
      begin
        Logs := 2;
      end;
      You need to tell the script what 'Logs' represnt, to do this you have to decalre it as a variables, so:
      Simba Code:
      procedure Logs;
      var
        Logs: Integer; // declared here as an integer, which a whole number
      begin
        Logs := 2;
      end;


      Another reason it because you may have misspelled a function, such as spelling WriteLn as WriteIn <- with an 'i', which means that Simba has no idea what the function is supposed to mean

      The final reason you may have got this error is because you forgot to include Simba, make sure you have this after you define smart:
      Simba Code:
      {$i srl\srl.simba}

      And this in your mainloop:
      Simba Code:
      SetUpSRL; // put before your functions

      ---
    • Assignment expected at line xx
      This means, when writing the equals sign in simba, you put the colon but forgot to put the actual equals sign. It should:
      Simba Code:
      i := 2; //look like this
      i :2; // not this
      ---
    • Error: Exception: Access violation at line 101
      When trying to script - if you get this error it means you have forgotten to put SetUpSRL; at the start of your mainloop
      ---
    • Duplicate Identifier '' at Line xx
      There are a few reason why this may occur.

      The first is because you have made two procedures/functions with the same name.

      The second is because you have made a procedure/function with a name that already exists in the SRL Include.

      The third is because you named a variable the same as a procedure or function that already exists in the SRL Include.
      ---
    • Invalid number of parameters at line xx
      This means, when using a function you have not put the right amount of values within the brackets. This is either because you just haven't, or you missed out a comma.
      In this case, you may also get the rror:
      Code:
      comma (',') expected at line xx
      ---
    • Closing square bracket (']') expected at line xx
      When you use a square bracket [, make sure you close it with a closed square bracket ]
      ---
    • Closing parenthesis expected at line 21
      Simple means you have forgotten to put a closing bracket ) at that line, go to the line and put in the bracket or remove the extra bracket if that is the problem.
      ---
    • Colon (':') expected at line xx
      Usually occurs when you make a function but forget to write what it returns. For example:
      Simba Code:
      function HeyThere; // will not compile
      function HeyThere: Boolean; // tells Simba it returns a boolean, will compile
      ---
    • Syntax error at line xx
      This means you've messed up somewhere when using signs - usually the equals sign. Make sure they are correct.
      ---
    • Type mismatch at line xx
      The most common reason this error occurs is because you have entered a value wrong within the brackets for a function.

      For example you have written an integer (number) when there should be a string (word). Or if you have declared something as a string or integer when it should've been the other way round.

      Another reason may be because when using functions such as FindObjCustom, which allow you to put multiple uptexts and colours, the multiple uptexts and colours must go within square brackets regardless of the amount you use. So:
      Simba Code:
      FindObjCustom(x, y, 'heymama', [234, 567], 20); // will not compile
      FindObjCustom(x, y, ['heymama'], [234, 567], 20); //this will because it has square brackets around the uptext 'heymama'

      Having said the above point, you will also get a mismatch error if you use normal brackets where square brackets are needed.
      ---

    • Unexpected end of file at line 0
      This error occurs when you are missing your final end. Put it in and remember that it needs a period(.) after it as it is the last one.
      ---


    So yeh there is a list of the most common errors people seem to be getting when trying to make scripts, hopefully this will help you on your way!

    If you want any common errors to be added to this list let me know. Also, be sure to point out any reason I may not have mentioned for errors

    Like, comment and subscribe *lool*
    Last edited by nyaks; 06-26-2013 at 05:15 AM.

  6. #31
    Join Date
    Mar 2008
    Posts
    426
    Mentioned
    1 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    This is a tutorial for those who get errors while trying to create a script not run one.
    Handy tut man.

    Should that be "compile a script"?



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

    Default

    This little guide has been updated with errors I have been able to reproduce with srl 6. If there are any you want me to add/modify please let me know.


  8. #33
    Join Date
    Mar 2016
    Posts
    6
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    lots of help thanks

  9. #34
    Join Date
    Apr 2014
    Posts
    323
    Mentioned
    0 Post(s)
    Quoted
    131 Post(s)

    Default

    Could we add the "access violatio" error to this list? I can't figure it out.
    If all pork-chops were perfect, we wouldn't have hot-dogs.

  10. #35
    Join Date
    Apr 2017
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I'm new to scripting with Simba/Lape. I keep getting an error message stated as, "Error: Block expected at line 11"

    What did I forget to do to create this error?

  11. #36
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by RevanScripts View Post
    I'm new to scripting with Simba/Lape. I keep getting an error message stated as, "Error: Block expected at line 11"

    What did I forget to do to create this error?
    You forgot a begin somewhere around line 11. To say more I'd need to see your code.

  12. #37
    Join Date
    Apr 2017
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I found the issue. The error was that I was using too many begin/ends around my If/Then/Else statements. I thought that you had to do

    If xx then
    begin
    end else

    Which seemed to have work before, but in this instance it did not.

  13. #38
    Join Date
    Sep 2008
    Location
    Argentina
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Stucked on trying to walk in OSRS, I can log in, but instead of walking the correct path, the program only clicks on the lower right direction of the bitmap.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •