SRL Archive - OSR Help

What language is Simba based off of?


Deffiliate

2012-09-20 05:59:27

Is Simba just some API on top of another language, or is Simba it's own language that's based on a language? I need to know which language I should go out and learn before attempting to script here. Example: Before scripting at Powerbot I had to learn Java.

masterBB

2012-09-20 06:03:57

Simba is written in pascal. The language you script is pascalscript, though lape (pascalscript like, basically the same) will be our new 'scripting language'.

Deffiliate

2012-09-20 06:05:40

Is pascalscript a non-typed language?

Daniel

2012-09-20 07:21:34

From: Deffiliate
Is pascalscript a non-typed language?


Why would it be untyped?

Deffiliate

2012-09-20 08:48:48

From: Daniel
Why would it be untyped?


Okay, so it's not. Also, I came across this while reading a little introduction to PascalScript:

The use of global variables is considered bad practice so I like to define them immediately before the main code block.

Why is using global variable bad practice? They can be quite useful in scripts from my experience…

riwu

2012-09-20 09:01:20

If you are not careful you could unintentionally reused non-null variables from previous procedure. Also not very memory friendly (more significant when the stored variable is large).

It's only bad practice if u use them when they can in fact be declared locally. If they have to be global (cross procedures) then of course you should declare them globally.

Deffiliate

2012-09-20 09:04:39

From: riwu
If you are not careful you could unintentionally reused non-null variables from previous procedure. Also not very memory friendly (more significant when the stored variable is large).

It's only bad practice if u use them when they can in fact be declared locally. If they have to be global (cross procedures) then of course you should declare them globally.


Thanks, that's exactly what I needed to know.

masterBB

2012-09-20 09:10:10

Example of bad use of global variables:

[INDENT]x, y: Integer;[/INDENT]

A good example would be:

[INDENT]ExperienceGained: Integer;[/INDENT]

Deffiliate

2012-09-20 09:55:37

From: masterBB
Example of bad use of global variables:

[INDENT]x, y: Integer;[/INDENT]

A good example would be:

[INDENT]ExperienceGained: Integer;[/INDENT]


I understand what the difference between a global and local variable is, which is why it caught me off guard when the introduction said not to use global variables.