cathering_
07-31-2007, 12:45 AM
--Please Post Feedback on this tutorial it only takes few seconds! --
Hey, Welcome to the Cathering way to Scar Tutorial.
Ill Be teaching you all the basics of Scar but you can continue to the more intermediate stuff like Failsafe loops and cases
This tutorial was designed to be short and sweet!
Introduction
The programming or scripting language used in scar is called Pascal so lets learn few facts about Pascal before we continue
What is Pascal?
It was named after the mathematician and philosopher Blaise Pascal.
Pascal is not new.
It was intended to teach students structured programming.
Unlike PHP or JavaScript you have to define (describe what it is) every variable ex-step variables of the constant.
Now we know what we are going to be programming in lets learn what Scar is!
What is Scar?
Scar was made by Kaitnieks a very long time ago apparently.
Scar was mainly made for Runescape cheating but still can be used for other purposes
Scar today is one the most used cheat programs for Runescape.
Ok, now we know little more about what we are programming in and what we are programming! Lets move on too what you need
What You Need
You Need Scar which you can get here (http://www.freddy1990.com/scar.php) also I recommend downloading SRL when you install Scar (Divi) which usually downloads automaticly on first starting it
Lets move on
The Scar/Pascal Syntax
program Hey;
begin
//Some Statements
end.
Okay first we have to declare are program which is necessary then we have whats called the “Main Loop” which starts at the “Begin” and ends at the “End.” notice the dot after the end, anything wrote in there will run when you click the "play" icon in scar. you can call a program anything you want as long as you have not declared the same name in the script EG
program Hey;
begin
//Some Statements
end.
program Hey;
begin
//Some Statements
end.
- Names Cannot have spaces
- Its best you keep everything lower case
- Keep to the SRL standards which can be found here (http://wiki.srl-forums.com/index.php/Scripting_Standards)
- Pascal is case-sentive (FKGfg is not the same as fkgfg) - Capital Wise
- You may not use two programs only one. or the code inside the other one will be ignored
The //Some statements is just a comment meaning scar will just ignore the text AFTER the // you can also use { } which will ignore the text INSIDE it.
below we have a example of a script that sends the string (text) "Hello World" to the debug box (the text box right below the main scripting window...
program HelloWorld;
begin
Writeln('Hello World');
end.
Write that into scar and click the play button and it will write Hello world in the debug box!
Let's Recap
Ok we know all about the Program and the begin and end. so forget about that.
The Writeln bit is whats called a procedure (notice the brakets) then you have the 'Hello World' that is what is called a string anything inside '' is called a string. Strings can contain almost any text.
then we move on to the ; The semicolon is a separator and is used to distinguish one set of instructions from another, not using this will result in a error.
- You may not use "" you must always use ''
Variables
Variables are used for storing a values, like text strings, numbers
When a variable is set it can be used over and over again in your script
Where going to learn a few of the most used ones
var
John : String;
One : Integer;
Bool : Boolean;
Percent : Extended;
Ok first of all we have tell scar where declareing a few variables so we use the "var" but this must be BEFORE the "begin" in script EG:
program Vars;
var
John : String;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
//Some Statments..
end.
Ok lets learn about the types of Variables
String = Anytype of text but must be inside the ''
Integer = A Whole Number, can be Postisive or negitive
Bool = True or False statement
Extented = A extended number eg 10.11
ok now lets give them a value
program Vars;
var
John : String;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
John := 'Hello';
One := 1;
Bool := true;
Percent := 10.11;
end.
Ok now lets put them to use!
program Vars;
var
John : string;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
John := 'Hello';
One := 1;
Bool := true;
Percent := 10.11;
Writeln(John);
end.
Notice that we did not include any '' we just put it in but since the Writeln ONLY takes string variables we cannot use a integer, Boolean or a extended variable but what we can do
is change it into a string!!
program Vars;
var
John : string;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
John := 'Hello';
One := 1;
Bool := true;
Percent := 10.11;
Writeln(IntToStr(One));
end.
We used the function inttostr to change that integer into a string there are also other conversation functions you can use.
Lets wrap this part up and move on to Operators
Operators
+ = Addition or unary positive real or integer real or integer
- = Subtraction or unary negative real or integer real or integer
* = Multiplication real or integer real or integer
/ = Real division real or integer real
div = Integer division
mod = remainder division
Logic Operators
and = if(('one' = 'one') and ('two' = 'two'))
not = if(not 'one' = 'one')
or = if(('one' = 'one') or ('two' = 'two'))
You will learn to use Operators later lets move on
Procedures
Nearly every script has at least one procedure
using procedures is easy and simple its also very similar to declaring a program!
procedure HelloWorld;
begin
Writeln('Hello World');
end;
Now look we changed the word "program" to procedure. Procedures can have there own variables that ONLY can be used by it only like below
procedure HelloWorld;
var
Hey : string;
begin
Hey := 'Hello World';
Writeln(Hey);
end;
Also notice the dot after the end has changed to a ;
now lets call the procedure!
program Hello;
procedure HelloWorld;
var
Hey : string;
begin
Hey := 'Hello World';
Writeln(Hey);
end;
begin
HelloWorld;
end.
Notice that we wrote the procedure outside the main loop because we only want to call it when we want to
Putting it in the main loop will cause a error
Procedures With Parameters
Parameters are like variables only they are given a value when you call that certain procedure lets look at this one:
HelloWorld(Hey: String);
begin
Writeln(Hey);
end;
Notice that we do not need to declare "var" but we have to define them in the brackets now lets put that procedure to good use!
program hello;
procedure HelloWorld(Hey: String);
begin
Writeln(Hey);
end;
begin
HelloWorld('Hello World!');
end.
Not much different from A normal procedure but there it is!!
-Procedures may not contain procedures in them
-Procedures cannot be put in the main loop
-Procedures must be in a program
If Statements
If statements are easy to get a hang of.
You can use conditional statements in your code to do this.
>> if...else statement - use this statement if you want to execute a set of code when a condition is true and another if the condition is not true
a simple if statement
if(condition is true) then
begin
//Some Statements
end;
Ok if the statement is true it executes the code within the begin and end that code what if its not true?
we use the else statement:
if(condition is true) then
begin
//Some Statements
end else
begin
//Some Statements
end;
if the condition is not true it will execute the else code
notice there’s no ; or . at the end statement
now we can use Operators!
if(('one' = 'one')or('two' = 'two')) then
begin
Writeln('Hello!');
end;
that’s a example of what it can do
Well that’s it that’s all I have to offer Good luck!
- Also keep to the SRL Standards found here (http://wiki.srl-forums.com/index.php/Scripting_Standards)
Hey, Welcome to the Cathering way to Scar Tutorial.
Ill Be teaching you all the basics of Scar but you can continue to the more intermediate stuff like Failsafe loops and cases
This tutorial was designed to be short and sweet!
Introduction
The programming or scripting language used in scar is called Pascal so lets learn few facts about Pascal before we continue
What is Pascal?
It was named after the mathematician and philosopher Blaise Pascal.
Pascal is not new.
It was intended to teach students structured programming.
Unlike PHP or JavaScript you have to define (describe what it is) every variable ex-step variables of the constant.
Now we know what we are going to be programming in lets learn what Scar is!
What is Scar?
Scar was made by Kaitnieks a very long time ago apparently.
Scar was mainly made for Runescape cheating but still can be used for other purposes
Scar today is one the most used cheat programs for Runescape.
Ok, now we know little more about what we are programming in and what we are programming! Lets move on too what you need
What You Need
You Need Scar which you can get here (http://www.freddy1990.com/scar.php) also I recommend downloading SRL when you install Scar (Divi) which usually downloads automaticly on first starting it
Lets move on
The Scar/Pascal Syntax
program Hey;
begin
//Some Statements
end.
Okay first we have to declare are program which is necessary then we have whats called the “Main Loop” which starts at the “Begin” and ends at the “End.” notice the dot after the end, anything wrote in there will run when you click the "play" icon in scar. you can call a program anything you want as long as you have not declared the same name in the script EG
program Hey;
begin
//Some Statements
end.
program Hey;
begin
//Some Statements
end.
- Names Cannot have spaces
- Its best you keep everything lower case
- Keep to the SRL standards which can be found here (http://wiki.srl-forums.com/index.php/Scripting_Standards)
- Pascal is case-sentive (FKGfg is not the same as fkgfg) - Capital Wise
- You may not use two programs only one. or the code inside the other one will be ignored
The //Some statements is just a comment meaning scar will just ignore the text AFTER the // you can also use { } which will ignore the text INSIDE it.
below we have a example of a script that sends the string (text) "Hello World" to the debug box (the text box right below the main scripting window...
program HelloWorld;
begin
Writeln('Hello World');
end.
Write that into scar and click the play button and it will write Hello world in the debug box!
Let's Recap
Ok we know all about the Program and the begin and end. so forget about that.
The Writeln bit is whats called a procedure (notice the brakets) then you have the 'Hello World' that is what is called a string anything inside '' is called a string. Strings can contain almost any text.
then we move on to the ; The semicolon is a separator and is used to distinguish one set of instructions from another, not using this will result in a error.
- You may not use "" you must always use ''
Variables
Variables are used for storing a values, like text strings, numbers
When a variable is set it can be used over and over again in your script
Where going to learn a few of the most used ones
var
John : String;
One : Integer;
Bool : Boolean;
Percent : Extended;
Ok first of all we have tell scar where declareing a few variables so we use the "var" but this must be BEFORE the "begin" in script EG:
program Vars;
var
John : String;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
//Some Statments..
end.
Ok lets learn about the types of Variables
String = Anytype of text but must be inside the ''
Integer = A Whole Number, can be Postisive or negitive
Bool = True or False statement
Extented = A extended number eg 10.11
ok now lets give them a value
program Vars;
var
John : String;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
John := 'Hello';
One := 1;
Bool := true;
Percent := 10.11;
end.
Ok now lets put them to use!
program Vars;
var
John : string;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
John := 'Hello';
One := 1;
Bool := true;
Percent := 10.11;
Writeln(John);
end.
Notice that we did not include any '' we just put it in but since the Writeln ONLY takes string variables we cannot use a integer, Boolean or a extended variable but what we can do
is change it into a string!!
program Vars;
var
John : string;
One : integer;
Bool : Boolean;
Percent : Extended;
begin
John := 'Hello';
One := 1;
Bool := true;
Percent := 10.11;
Writeln(IntToStr(One));
end.
We used the function inttostr to change that integer into a string there are also other conversation functions you can use.
Lets wrap this part up and move on to Operators
Operators
+ = Addition or unary positive real or integer real or integer
- = Subtraction or unary negative real or integer real or integer
* = Multiplication real or integer real or integer
/ = Real division real or integer real
div = Integer division
mod = remainder division
Logic Operators
and = if(('one' = 'one') and ('two' = 'two'))
not = if(not 'one' = 'one')
or = if(('one' = 'one') or ('two' = 'two'))
You will learn to use Operators later lets move on
Procedures
Nearly every script has at least one procedure
using procedures is easy and simple its also very similar to declaring a program!
procedure HelloWorld;
begin
Writeln('Hello World');
end;
Now look we changed the word "program" to procedure. Procedures can have there own variables that ONLY can be used by it only like below
procedure HelloWorld;
var
Hey : string;
begin
Hey := 'Hello World';
Writeln(Hey);
end;
Also notice the dot after the end has changed to a ;
now lets call the procedure!
program Hello;
procedure HelloWorld;
var
Hey : string;
begin
Hey := 'Hello World';
Writeln(Hey);
end;
begin
HelloWorld;
end.
Notice that we wrote the procedure outside the main loop because we only want to call it when we want to
Putting it in the main loop will cause a error
Procedures With Parameters
Parameters are like variables only they are given a value when you call that certain procedure lets look at this one:
HelloWorld(Hey: String);
begin
Writeln(Hey);
end;
Notice that we do not need to declare "var" but we have to define them in the brackets now lets put that procedure to good use!
program hello;
procedure HelloWorld(Hey: String);
begin
Writeln(Hey);
end;
begin
HelloWorld('Hello World!');
end.
Not much different from A normal procedure but there it is!!
-Procedures may not contain procedures in them
-Procedures cannot be put in the main loop
-Procedures must be in a program
If Statements
If statements are easy to get a hang of.
You can use conditional statements in your code to do this.
>> if...else statement - use this statement if you want to execute a set of code when a condition is true and another if the condition is not true
a simple if statement
if(condition is true) then
begin
//Some Statements
end;
Ok if the statement is true it executes the code within the begin and end that code what if its not true?
we use the else statement:
if(condition is true) then
begin
//Some Statements
end else
begin
//Some Statements
end;
if the condition is not true it will execute the else code
notice there’s no ; or . at the end statement
now we can use Operators!
if(('one' = 'one')or('two' = 'two')) then
begin
Writeln('Hello!');
end;
that’s a example of what it can do
Well that’s it that’s all I have to offer Good luck!
- Also keep to the SRL Standards found here (http://wiki.srl-forums.com/index.php/Scripting_Standards)