Page 1 of 2 12 LastLast
Results 1 to 25 of 38

Thread: Common Scripting Errors

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

    Thumbs up Common Scripting Errors

    This is a tutorial for those who get errors while trying to compile your own script not run someone elses. For errors when trying to run another script go to: So, you get an error huh?, the FAQ or the script related thread.

    Without further adieu:

    • Operator expected at line xx, column xx or Invalid evaluation at line xx, column xx
      This means on the above line, you forgot to put a semicolon ; at the end of it
      ---
    • Expression expected at line xx, column xx
      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 declaration '' at line xx, column 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' represent, to do this you have to declare 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-6/srl.simba}

      And this in your mainloop:
      Simba Code:
      setupSRL(); // put before your functions

      ---
    • Invalid label at line xx, cloumn 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
      ---
    • Duplicate declaration '' at line xx, column xx
      There are a few reason why this may occur.

      The first is because you have made two procedures/functions with the same name, this can be used by utilising the overload and override options shown here.

      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.
      ---
    • No default value for parameter '' found at line xx, column xx
      This means, when using a function/procedure 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/ put an extra one.
      ---
    • Closing parenthesis expected at line xx, column xx or Found closing parenthesis without matching opening parenthesis at line xx, column xx
      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.
      ---
    • Expected variable of type "", got "" at line xx, column xx at line xx, column 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 have been the other way round.
      ---


    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 Abu; 12-12-2013 at 08:42 AM.

  2. #2
    Join Date
    Feb 2012
    Location
    Denver, CO
    Posts
    863
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very nice! I will definitely be putting this to good work.

    I wish you would have posted this yesterday. The semicolon one took a few minutes to figure out

  3. #3
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Nice, one thing I noticed, Prob not allowed to name a variable the same name as a method tho.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  4. #4
    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 Andres View Post
    Very nice! I will definitely be putting this to good work.

    I wish you would have posted this yesterday. The semicolon one took a few minutes to figure out
    Thanks, my bad

    Quote Originally Posted by Dgby714 View Post
    Nice, one thing I noticed, Prob not allowed to name a variable the same name as a method tho.
    Thanks and added

  5. #5
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Very nice, should help out the new people that are wanting to learn how to script

    Forum account issues? Please send me a PM

  6. #6
    Join Date
    Mar 2012
    Location
    Australia
    Posts
    625
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Champion, this is exactly what I was looking for.

    Well done young man! Add more for newbies like me
    Bored of playing rs, and bored of botting it, why am i here?

  7. #7
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Could you add "warning you passed an invalid finder fuction at line 30/29/28(etc.)"?

  8. #8
    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 Le Jingle View Post
    Could you add "warning you passed an invalid finder fuction at line 30/29/28(etc.)"?
    As Far As I Know that doesn't stop the script from compiling does it?

  9. #9
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Nice tutorial although seems like more like a tutorial on how to fix antileechs but I guess it'll help them learn. Great job Abu
    Last edited by Gucci; 05-21-2012 at 04:30 PM.
    Current Project: Retired

  10. #10
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    As Far As I Know that doesn't stop the script from compiling does it?
    No it doesn't, but I usually pull out my hair trying to figure out why it does that, it'll tell my I set an invalid finding finder function at like -1, -1 and that it set it to 0, 0.

  11. #11
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Good idea!

    I wish there was something like this when I was learning. Getting those errors was so frustrating

  12. #12
    Join Date
    Mar 2012
    Location
    Australia
    Posts
    625
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Gaah this is wracking my brain, how do i fix this one?

    Code:
    Procedure LevelUps;
    begin
      if (LevelUp) then
      Inc (LevelsGained);
      WriteIn('Gained a Level!');
    end;
    [Error] (50:3): Unknown identifier 'WriteIn' at line 49
    Compiling failed.

    I don't understand why my write in's arent working anymore. Is there anything wrong with this, Do you need more of the script? Everything is declared, I am pretty sure.
    Bored of playing rs, and bored of botting it, why am i here?

  13. #13
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    WriteLn <--- LINE, not IN.

  14. #14
    Join Date
    Mar 2012
    Location
    Australia
    Posts
    625
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by CephaXz View Post
    WriteLn <--- LINE, not IN.
    Fck me dead, thankyou.

    I was never using it before some suggest to use them for debug, thankyou so much rofl.
    Bored of playing rs, and bored of botting it, why am i here?

  15. #15
    Join Date
    Mar 2012
    Location
    Australia
    Posts
    625
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by stuartroad View Post
    Fck me dead, thankyou.

    I was never using it before some suggest to use them for debug, thankyou so much rofl.



    Here is an error that I continually got to my stupidness, you might want to include it?

    [Error] (119:1): Identifier expected at line ***

    It's cause by not having enough "end;" meaning you have a begin but it doesn't end anywhere in the procedure/function.

    If I am wrong, slap me and tell me to shutup. Thanks
    Bored of playing rs, and bored of botting it, why am i here?

  16. #16
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by stuartroad View Post
    Here is an error that I continually got to my stupidness, you might want to include it?

    [Error] (119:1): Identifier expected at line ***

    It's cause by not having enough "end;" meaning you have a begin but it doesn't end anywhere in the procedure/function.

    If I am wrong, slap me and tell me to shutup. Thanks
    Yeah, it's a lot of times because of bad standards, making it hard to see when to put begin or end. It's either begin or end missing out before the line stated on the error.

  17. #17
    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 stuartroad View Post
    Here is an error that I continually got to my stupidness, you might want to include it?

    [Error] (119:1): Identifier expected at line ***

    It's cause by not having enough "end;" meaning you have a begin but it doesn't end anywhere in the procedure/function.

    If I am wrong, slap me and tell me to shutup. Thanks
    Tested, Approved and Added

  18. #18
    Join Date
    Jun 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    "[Error] (1:1): Unexpected end of file at line 0
    Compiling failed." please someone help me i have no idea of fixing it thank you!

  19. #19
    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 kyleisaboss View Post
    "[Error] (1:1): Unexpected end of file at line 0
    Compiling failed." please someone help me i have no idea of fixing it thank you!
    Oooohhh, I know this one I just can't remember why it's caused!

    Check for extra ends I guess.

    Also, make sure only you're final end has a period/full stop(.) after it.


    EDIT: If anyone else has the correct solution let me know plz so I can add it
    Last edited by Abu; 06-05-2012 at 10:29 PM.

  20. #20
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    Nicely done tutorial, will look back on in the future.

  21. #21
    Join Date
    Jan 2012
    Posts
    550
    Mentioned
    2 Post(s)
    Quoted
    177 Post(s)

    Default

    I lol'ed when i read this. I did alot of these mistakes when i started my own script.

  22. #22
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Oooohhh, I know this one I just can't remember why it's caused!

    Check for extra ends I guess.

    Also, make sure only you're final end has a period/full stop(.) after it.


    EDIT: If anyone else has the correct solution let me know plz so I can add it
    Pretty sure it's for Program NameHere;
    is missing a semi-colon, or the whole line is missing all-together, might be the final end. also

  23. #23
    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 NKN View Post
    Pretty sure it's for Program NameHere;
    is missing a semi-colon, or the whole line is missing all-together, might be the final end. also
    Tried it and it it runs even without program.

    Also, without the colon it just gives a semicolon error

  24. #24
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Tried it and it it runs even without program.

    Also, without the colon it just gives a semicolon error
    Found out how it works.

    Delete the final end. and it generates the error.

  25. #25
    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 NKN View Post
    Found out how it works.

    Delete the final end. and it generates the error.
    Tested, approved and added

Page 1 of 2 12 LastLast

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
  •