SRL Archive - General Botting Help

Common Scripting Errors


Abu

2012-05-20 09:20:09

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:
    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:
    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:
    {$i srl-6/srl.simba}  
    And this in your mainloop:
    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:
    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*
:)

Andres

2012-05-20 10:52:07

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 ;)

Dgby714

2012-05-20 10:54:43

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

Abu

2012-05-20 13:39:30

From: Andres
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 :p

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


Thanks and added :)

Justin

2012-05-21 06:49:51

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

stuartroad

2012-05-21 06:53:31

Champion, this is exactly what I was looking for.

Well done young man! Add more for newbies like me :)

Le Jingle

2012-05-21 07:05:53

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

Abu

2012-05-21 10:56:44

From: Le Jingle
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?

Gucci

2012-05-21 11:21:40

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

Le Jingle

2012-05-21 12:29:10

From: abu_jwka
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.

Runaway

2012-05-21 13:50:23

Good idea!

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

stuartroad

2012-06-03 07:13:21

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

Procedure LevelUps;
begin
if (LevelUp) then
Inc (LevelsGained);
[B] WriteIn('Gained a Level!');[/B]
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.

CephaXz

2012-06-03 07:14:41

WriteLn <— LINE, not IN. :p

stuartroad

2012-06-03 07:21:01

From: CephaXz
WriteLn <— LINE, not IN. :p


Fck me dead, thankyou.

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

stuartroad

2012-06-03 08:01:34

From: stuartroad
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 :)

CephaXz

2012-06-03 08:05:51

From: stuartroad
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.

Abu

2012-06-03 10:53:15

From: stuartroad
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 :)

kyleisaboss

2012-06-03 12:16:55

"[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!

Abu

2012-06-05 18:25:33

From: kyleisaboss
"[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 :)

Syntax

2012-06-05 19:19:50

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

Thanatos

2012-06-05 20:24:47

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

NKN

2012-06-18 15:50:43

From: abu_jwka
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

Abu

2012-06-18 16:44:12

From: NKN
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

NKN

2012-06-18 19:10:59

From: abu_jwka
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.

Abu

2012-06-21 17:57:00

From: NKN
Found out how it works.

Delete the final end. and it generates the error.


Tested, approved and added :)

Aqua3

2012-10-25 09:13:42

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

This one isn't in the tutorial? :(

masterBB

2012-10-25 09:57:31

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

no begin
program new;

writeln('hello');
end.

should be

program new;

begin
writeln('hello');
end.

one end; more then you got begin
program new;

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

should be

program new;

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

or

program new;

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

Aqua3

2012-10-25 10:45:54

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

no begin
program new;

writeln('hello');
end.

should be

program new;

begin
writeln('hello');
end.

one end; more then you got begin
program new;

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

should be

program new;

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

or

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.

nyaks

2013-06-20 23:54:59

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]




From: abu_jwka
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:
    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:
    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:
    {$i srl\srl.simba}  
    And this in your mainloop:
    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:
    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:
    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:
    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:
    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.

nyaks

2013-06-26 01:13:08

you forgot to mention out of range dudes


From: abu_jwka
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:
    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:
    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:
    {$i srl\srl.simba}  
    And this in your mainloop:
    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:
    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:
    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:
    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:
    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*
:)

Peanuts

2013-06-26 01:24:38

From: abu_jwka
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"?

Abu

2013-12-12 03:43:25

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.

:)

Denis

2020-04-24 23:23:22

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.