pwnaz0r
2007-09-09 02:12:39
COMPLETE Scar/SRL Tutorial!
By : Pwnaz0r
Well this is going to basically be the updated version of the Unrivaled Tutorial (3800+ views). Anyway, it was written completely by me, JAD was kinda mad so I gave him credits in it.
[email]Pwnaz0r@hotmail.com[/email]
By : Pwnaz0r
Well this is going to basically be the updated version of the Unrivaled Tutorial (3800+ views). Anyway, it was written completely by me, JAD was kinda mad so I gave him credits in it.
[email]Pwnaz0r@hotmail.com[/email]
TABLE OF CONTENTS
[LEFT][LEFT]
- Begginers
- The Basics
- Those Annoying Errors
- Finding Color
- AntiBan
- Building Proggies
- Functions - Creating And Understanding
- Intermediate
- Cases
- Looping
- DTMS - TBU
- BitMaps - TBU
- Arrays
- Radial Walking
- Some Advanced Procedures
- Making Your Own functions
- Advanced
- Some Components
- Making Custom Var Types - TBU
- Forms
[/Left]
Begginers
The Basics
Ok well the basics are very simple yet at the same time complex. To understand the idea of these "Objects" instantly, you must be open minded. So while you're reading this guide, anything is possible atm. Try to grasp the basic Concept of this chapter. It is not hard but you must be "Open Minded" if you have never scripted before.
CONSTANTS AND VARIABLES
If you have never scripted, this will be confusing. It is not hard at all but because your brain has never seen this before, it may take you awhile to understand. Now there are two types "Objects in SCAR". Constants and Variables. These are simply names for storing information. Now the difference between the two is that a constant DOES NOT CHANGE THROUGHOUT THE SCRIPT. A variable CAN CHANGE THROUGHOUT THE SCRIPT. Ok now so if you don't get that read it again. Most of you probably take some kind of math with variables, trying to find the missing number. All a variable is, is a number that can change.
For Example
a constant would be like
From that point on in the script, the Word "Number" would store the number one and it would never change.
A Variable However can change.
Most people have trouble with variables as the can't grasp the concept so just be open minded. This would be an example of a variable
Ok now don't worry about the
now
Declaring Constants and Variables
Alright well , think of SCAR As a car. When you want the car to go, you press the gas. When you want it to stop, the brakes , etc. But it also has the engine you know nothing about(or you don't know about yet :D). Well in SCAR, You have to state or "Declare" the constants and variables. All you are doing is setting the value of the variable/constant. The only way I can explain is by showing you.
This is what you would do to "Declare" a constant. Most people like to do this right under the program line. This is what you do.
Now lets break this down. I Put "Const" because I want it to Label "Name" as a constant. Then i set the Value of "Name" as a set of our letters called a string. The only reason i have the
ok now this is where we learn about the
While using SCAR There are four types of variables. Remeber to be open minded here.
The Basics
Ok well the basics are very simple yet at the same time complex. To understand the idea of these "Objects" instantly, you must be open minded. So while you're reading this guide, anything is possible atm. Try to grasp the basic Concept of this chapter. It is not hard but you must be "Open Minded" if you have never scripted before.
CONSTANTS AND VARIABLES
If you have never scripted, this will be confusing. It is not hard at all but because your brain has never seen this before, it may take you awhile to understand. Now there are two types "Objects in SCAR". Constants and Variables. These are simply names for storing information. Now the difference between the two is that a constant DOES NOT CHANGE THROUGHOUT THE SCRIPT. A variable CAN CHANGE THROUGHOUT THE SCRIPT. Ok now so if you don't get that read it again. Most of you probably take some kind of math with variables, trying to find the missing number. All a variable is, is a number that can change.
For Example
a constant would be like
const
Number = 1;
From that point on in the script, the Word "Number" would store the number one and it would never change.
A Variable However can change.
Most people have trouble with variables as the can't grasp the concept so just be open minded. This would be an example of a variable
var
banks : integer;
Ok now don't worry about the
: integer;
Just yet. All you need to see is the banks. This word stores the amount of times you have banked. now
Declaring Constants and Variables
Alright well , think of SCAR As a car. When you want the car to go, you press the gas. When you want it to stop, the brakes , etc. But it also has the engine you know nothing about(or you don't know about yet :D). Well in SCAR, You have to state or "Declare" the constants and variables. All you are doing is setting the value of the variable/constant. The only way I can explain is by showing you.
This is what you would do to "Declare" a constant. Most people like to do this right under the program line. This is what you do.
const
Name = 'Bill';
Now lets break this down. I Put "Const" because I want it to Label "Name" as a constant. Then i set the Value of "Name" as a set of our letters called a string. The only reason i have the
' '
around the name is because thats what tells SCAR it is a string. Anyway we will learn that later. Now, On to declaring a variable.
var
Banked : integer;
ok now this is where we learn about the
: integer;
While using SCAR There are four types of variables. Remeber to be open minded here.
[LEFT]
- Integer - Probably the most common, Is Used For Regular Numbers - Examples : 1, 34 , 3354
- Extended - These are numbers that are not whole - Examples 6.4, -35, 5.553
- Boolean - This can result True or False - Examples : True, False
- Strings : This was mentioned earlier, a strip of characters - Examples: 'Bill', 'McDonalds', ' Greg'
Deeper Explaination
Ok Now If You understand the types above then skip this section. This is where alot of people seem to have some trouble. It is not all that hard to understand these. Basically, we will use the examples of talking to a person to understand them. Ok now an integer is like your teacher asking you " What is 1 + 1 ?". You would answer 2 unless you're dumb :D. That would be an integer, because it is in fact a whole number. It is not negative and does not have a decimal. Now an extended would be be more like your teacher asking you " What is 7.4 + 6.3 ?". If you add these up you get 13.7 which does have a decimal so it would have to be extended. Boolean is a true/false question on a test. An example would be your teacher asking you " Is Pwnaz0r Awesome?". You would undoubtedly say "True". Lastly, The string would be like your teacher asking you to read from a book(kind of). This variable is usually the easiest. Anyways, the example would be you reading the text " Jack and Jill Went Up The Hill".
Alright Now i think you may understand Constants and Variables by now. If you do, pat yourself on the back.
Now, we will move on to what we call "Procedures". Procedures are like instructions. They tell scar what to do.
Alwas Include SRL/SRL.scar by the following…(pattern can be edited)
{.include srl/srl.scar}
Those Annoying Errors
(Copied From SRL Wiki)
Include … not found
Example:
Include file c:program filesscar x.0xincludessrl/srl.scar does not exist
You forgot to install SRL.
Duplicate identifier UpChars
Example:
Line 26: [Error] (34:1): Duplicate identifier 'UpChars' in script C:Program FilesSCAR 3.0xincludessrlsrlcoreGlobals.scar
You are using SCAR Divi. Divi needs it own, customized SRL version until SRL 4.0 is out. You can get by clicking on file, download SRL.Access Violation
Example:
[Runtime Error] : Exception: Access violation at address 00651174 in module 'scar.exe'.
You forgot to call SetupSRL; at script startup or used a bitmap or DTM that wasn't initialized by assigning data to its variable.
Out of Range
[Runtime Error] : Out Of Range in line ...in script ...
Your NumberOfPlayers doesn't match up the length of your PlayerArray.OR
If you are making your own script there can sometimes be a problem if you are using arrays.
Example of this is show below
program ErrorCheck;
var
ArrayVariable : array [1..2] of integer;
begin
ArrayVariable[3] := 234234;
end;
This causes problems because the array is only set to be used in the value range of 1 - 2 and you are trying to use it in 3.
Common Runtime Errors
* Access violation runtime errors are caused when you try to use a Bitmap, DTM or character which hasn't yet been loaded into SCAR's memory.
* Math runtime errors are caused if you divide a number by zero or use sin/cos/tan on a value that is impossible to calculate.
* Dll runtime errors are caused if you write or use a corrupt plugin, they are also caused if you use some procedures without putting them into a new thread (procedure [ThreadSafeCall).
* Canvas does not allow drawing runtime errors are caused if you try to draw on a canvas which cant be drawn on, eg. the client canvas.
* Cant create compatible DC runtime errors are caused if you load too many bitmaps, DTMs or character sets without freeing them. SCAR runs out of memory and crashes.
PC Related
Loosing Focus
This means that the SCAR cross hair has been 'shaken' off the client. While working, SCAR assumes that co-ordinates 0,0 are the top-left corner of the client, if focus is shaken off, 0,0 becomes the top-left corner of your desktop.
This can be caused if the RuneScape client changes its Windows handle number. It is also sometimes caused if you use SCAR's color-picking function.
To avoid this, you could set the global boolean 'FindClient' to true. This would make SCAR look for the client by searching for the current width and height. Another way is to use the SCSS client, this sends the Windows client handle to SCAR using InterScarMessaging.
Another way to avoid this is to check the co-ordinates in the bottom-left corner of SCAR. Move the mouse to the top-left corner of the client, if the co-ordinates shown are not close to 0,0 reselect the client.
Finding Color
Ok Now there are various Ways To Find Color. Two Main Categories Though.
With Tolerance and Without. Tolerance is just like finding a color similar to it. The higher the tolerance, the more different the color can be.
MOST COMMON COLOR FINDING PROCEDURES
- FindColor
- FindColorTolerance
- FindColorSpiral
- FindColorSpiralTolerance
All do pretty much the same thing. Now All you have to do it pick a color for it to find. Use the color picker(Icon listed above in Understanding Scar) and pick a color. I cannot Show you how to do this because the screen is frozen and you can't take a screen shot but this is what should show up in the debug box after you have picked a color.
Color Picked: 16777215 at (243, 139)
That is just an example. 16777215 would be th color and (243, 139) are the coordinates. Now all you have to do is add that to a procedure.
procedure GoToColor;
begin
If(FindColor(x,y, 16777215 , 0 , 0 , 100 , 100))then
begin
Writeln('Found The Color');
end;
end;
Not very hard eh? Anyways, Colors are a really easy way to find things in scar.
ANTI BAN
AntiBan is essential to a good script. You should make a procedure name "AntiBan" or something close to that. Most scripters use case's to do antiban. Here are a few of SRL's antiban procedures and an example of a case.
// This list was last updated on August 11, 2007.
// * procedure RandomRClick; // * by phantombmx
// * procedure HoverSkill(Skill: String; Click: Boolean); // * by Dankness extended by Cheesehunk and fixed by Ron
// * procedure PickUpMouse; // * by dark_sniper
// * procedure SayCurrentLevels(which: String); // * by RealRune
// * procedure AlmostLogout; // * by Yakman
// * procedure RandomMovement; // * by Krazy_Meerkat
// * procedure Wait2(timetowait: Integer; Randoms: Boolean); // * by Krazy_Meerkat
// * procedure BoredHuman; // * by WT-Fakawi
Procedure AntiBan;
begin
Case Random(20) of // we don't always want it to call antiban
0: bla;
1: bla;
2: bla;
end;
end;
If you don't understand cases, check the section about them.
Building Proggies
Ok well progress reports are not hard. Here is the basic SRL Multiplayer Progress report.
procedure PlayerStats;
var
Active: string;
i : Integer;
begin
Writeln('****************************************************');
Writeln(' Name : '+ Players[CurrentPlayer].Name);
Writeln(' Number : '+ IntToStr(CurrentPlayer));
Writeln(' Worked : '+ IntToStr (Players[CurrentPlayer].Worked)+' minutes.');
Writeln(' Banked : '+ IntToStr (Players[CurrentPlayer].Banked) + ' loads.');
Writeln(' Location: '+ Players[CurrentPlayer].loc);
Writeln(' Level : '+ IntToStr(Players[CurrentPlayer].Integer1));
Writeln('****************************************************');
for i := 0 to HowManyPlayers - 1 do
begin
if(Players[i].Active = True)then
Active := 'True'
else
Active := 'False';
Writeln (IntToStr(i) + ' : '+Players[i].Name + ' = ' + Active + '. - Lvl: '+IntToStr(Players[i].Integer1)+
'. - B :'+IntToStr (Players[i].Banked)+' times.'+
' - '+IntToStr (Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
end;
Writeln('*****************************************************');
end;
Basically, Making your own report include:
- time running
- different specifics(rocks mined, gases found)
- Script Name and version
Where you report the variables, don't put borders around that line. The borders will become un-even.
Intermediate
Cases
Cases are, in short, a way to determine an action based on a condition(the value of an integer, a boolean value, etc); they are declared like so:
Case {Condition} of
end;
Here would be an example. You simply add what the condition would be, followed by a colon, and then the course of action to take.
procedure Nothing;
begin
Case Random(5) of // Condition is the random number [Contains numbers 0 through 5]
0: Writeln('0');
1: begin
Writeln('1');
Exit
End;
2: nothing;
end;
end;
As you can see, if the random number would equal 4 or 5 here, nothing would happen. That is supposed to be like that.
Looping
Looping is simply the action of make code repeat until a condition is filled. There are the types of looping: Repeat/until,for/do,and while/do.
Here are some examples
var
I: integer;
procedure nothing;
begin
repeat
i := I + 1;
Writeln(IntToStr(x));
until(i = 30);
end;
Here is for to do
var
I: integer;
procedure nothing;
begin
For I:= 1 to 30 do
writeln(InttoStr(I));
end;
and lastly, while/do
var
I: integer;
procedure nothing;
begin
While not I = 30 do
begin
I := I + 1;
Writeln(IntToStr(I));
end;
end;
DTMs - TBU;
Bitmaps - TBU;
Arrays
Ok now Arrays are basically a series of variables.
How to Declare them
If you know the length of the array, then you can say it like this.
var
ColorArray : array [0..5] of integer;
ExtArray : array [0..2] of extended;
BoolArray : Array [0..10] of boolean;
stringarray : array [5..8] of string;
If You don't(like if your adding colors as you go) then it should be stated like this
Var
ColorArray : array of integer;
Some functions for arrays:
GetArrayLength((ArrayName));
This will get the current length of the array.
SetArrayLength((ArrayName),ArrayLenght));
This is useful for updating arrays as you go. So an example of an updating array would be
procedure UpDateArray;
var
I : integer;
ColorArray : array of integer;
begin
If(FindColor(x,y,98347,1,1,100,100))then
begin
I := GetArrayLength(ColorArray);
SetArrayLength(ColorArray, I + 1);// I + 1 so it will be 1 higher than the
// previous array length.
Colorarray[I + 1] := GetColor(x,y);
end;
end;
RADIALWALKING
Ah yes, the all famous radialwalking. The enigma that most srl members do not understand. It will be explained fully and completely here.
Radialwalking is the best form of walking in my opinion. What Radiawalk Basically does is search for a color on the mini map. Now the MiniMap is a circle, no?. There are 360 degrees in an angle. What Radialwalk does is search
between the angles you specify for a color and picks the farthest color from the center. Now Lets Explain The Command and how it works by use of pictures…
RadialWalk(Color,StartRadial,EndRadial,Radius,ModX, ModY);
Ok Now
COLOR = The color your searching for.
StartRadial = The radius to start at.
EndRadial = The radius to end at.
Radius = How Many Pixels from the center?
ModX = random x
ModY = random y

Imagine this is the minimap. Those Are The Angles roughly that the mini map is composed of.
Now if you wanted to search for a white color from 0 to 90, you would make your radiawalk like this
RadialWalk( {WhiteColor} , 0, 90, 70, 0 , 0);
It would search the color in this area.

starting from 0 to 90. Like so.
(SRY for the bad picture, I got it straight from YakMan's RadialWalker Aid.)

If it finds the color White, it Will Click it and exit.
Using RadialRoadWalk is useful yet I prefer to do it like so :D
procedure ClickRoad;
var
tmpRoad : integer;
begin
tmpRoad := FindRoadColor;
RadialWalk(tmpRoad,~~~~~~);
end;
USING YAKMANS RADIWALK HELPER
HIGHLY SUGGESTED!!
[LEFT]
It works amazingly. Here is kinda a mini tutorial on it.
- While In SCAR, Go TO Open
- Click on Includes in The " Main Menu " of SCAR(where you downloaded srl)
- go to includes –> SRL –> Scripting Tools –> Yakman's RadialWalk Helper
- Open it
- Press Play
- Make sure you are logged in to RS
- Move The Window Over to The Side, Out Of the way of the minimap
- Press "CAPTURE FROM CLIENT" on the right hand side
- It Should Take A Picture Of The MiniMap
Now Move The Mouse Over the Mini Map TO The Starting Radial And Click Like so. The Line should stick there.

Only Use The "Radial" not "Radial2" unless you plan on over lapping(not really recommended).
Fill in the Boxes with Radius , Start Radius and End Radius and hit "Show Path". It Should show you how it will search. If you like it , hit "Stop" and hit "Print Procedure". Then Close the box.
Now Look in the debug Box. It has your command already made out!!
[/LEFT]
Advanced Procedures
TBU!
Some Components
Well As You Probably Know, Many Components/Classes were imported from Delphi.
These are listed in the SCAR manual. Here are some basic definitions.
TGroupBox - The TGroupBox component represents a standard group box, used to group related controls on a form.
TLabel - Use TLabel to add text or a bitmap that the user can’t edit to a form.
TEdit - Use a TEdit object to put a standard edit control on a form.
TMemo - Use TMemo to put a standard multiline edit control on a form.
TComboBox - A TComboBox component is an edit box with a scrollable drop-down list attached to it.
TButton - Use TButton to put a standard push button on a form.
TCheckBox - A TCheckBox component presents an option for the user.
TRadioButton - Use TRadioButton to add a radio button to a form.
TListBox - Use TListBox to display a scrollable list of items that users can select, add, or delete.
TScrollBar - Use TScrollBar to add a free-standing scroll bar to a form.
TImage - Use TImage to display a graphical image on a form.
TPanel - Use TPanel to put an empty panel on a form.
TTimer - TTimer is used to simplify calling the system timer functions.
TForm - form (window) component.
TApplication - TApplication encapsulates a windowed application.
TMenuItem - Use TMenuItem to specify the appearance and behavior of an item in a menu.
TMenu - Use TMenu as a base class when defining a component that represents a collection of menu items.
TMainMenu - Use TMainMenu to provide the main menu for a form.
TPopupMenu - Use TPopupMenu to define the pop-up menu that appears when the user clicks on a control with the right mouse button.
TCanvas - Use TCanvas as a drawing surface for objects that draw an image of themselves.
Now that is straight from the SCAR Manual. Some Of these components Uses will be listed here:
- TGroupBox - Used In Forms, Used To Organize
- TLabel - Form Component that the user cant edit.
- TImage - In My Opinion, the best Picture Component For Forms.
- TRadioButton - Radio Button
- TCheckBox - Check Box
- TButton - a button
- TCanvas - Obviously The Canvas of the Forms.
Again that was a very simple list. Now The main reason i made this section was to Discuss the TPoint component so from here on out, thats what its gunna do. TPoint Is Basically, in simple terms, a collective var type that has 2 SubVars. X and Y.
Example Using These:
procedure GetPos;
var
MyPoint : TPoint;
xx, yy : integer;
begin
GetMouse(xx,yy);
MyPoint.X := xx;
MyPoint.Y := yy;
end;
All that procedure does is store the Position of X and Y to the TPoint. I Used TPoint quite alot in my UberAlcher(not finished yet). There is also TPointArray Which Is Good For Storing Positions.
procedure MakeATPointArray;
var
ThePoints : TPointArray;
XX : integer;
YY : integer;
I : extended;
begin
I := -1;
GetMousePos(XX,YY);
repeat
XX := XX + 1;
YY := YY + 1;
I :+ I + 1;
SetArrayLength(ThePoints, I)l
ThePoints[I].X := XX;
ThePoints[I].Y := YY;
until(i = 25);
end;
That procedure doesnt really do anything useful just an example :D
Making Custom Var Types
Well As Seen Above, TPoint is a var type. But did you know you can create your own? This is what the player array is composed of. To declare a new var type, Just add it before your first procedure in script. "Type" is the word used to declare a new var type. The Example should explain everything.
THIS WAS TAKEN FROM MY UBER ALCHER
Type
AntiBannage = record
TalkingRatio : integer;
MovingRatio : integer;
MisClickRatio : integer;
StatsBoxRatio : integer;
end;
and i used it in this way.
procedure AntiBanLand;
var
AntiBanN : AntiBannage;
begin
ABR := 5;
//--------------------------
AntiBanN.TalkingRatio := 1 + random(ABR * 10);
AntiBanN.MovingRatio := 1 + random(ABR * 5);
AntiBanN.MisClickRatio := 1 + random(50);
//--------------------------
Case AntiBanN.TalkingRatio of
1 : begin
end;
end;
//--------------------------
Case AntiBanN.MovingRatio of
1 : begin
SleepAndMoveMouse(1500+random(3000));
ReportVars[1] := ReportVars[1] + 1;
end;
4 : begin
SleepAndMoveMouse(1000+random(2000));
ReportVars[1] := ReportVars[1] + 1;
end;
8 : begin
PickUpMouse;
ReportVars[1] := ReportVars[1] + 1;
end;
10 : begin
AlmostLogOut;
ReportVars[1] := ReportVars[1] + 1;
end;
end;
//--------------------------
Case AntiBanN.MisClickRatio of
1 : begin
GameTab(6);
GameTab(7);
ReportVars[1] := ReportVars[1] + 1;
end;
end;
//--------------------------
HoverEvery(15 + random(10),'Magic');
end;
Forms
Forms are actually quite simple. I think that the form creator is a great tool for creating for but only for the basic structure. I have edited a form that greatly exceeds the form makers abilities because the formmaker does not include all form components. However, I will be discussing how to manually create a form and how to create one via form maker.
STANDARD FORM PROCEDURES
Ok well lets go ahead and get this out of the way. These are always to be put after your main InIt procedure.
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
USING FORM EDITOR
Well The Form Editor Leaves out Many Components But here it is anyway.
To Get To The Form Editor :
- Open SCAR
- Go To Tools –> FormEditor…
Now You Should Get 3 Boxes.(frmDesign),(frmDesigner),(Object Inspector).
Ok Now In the Forum Designer, You can choose from a variety of options.
These Are Not Hard. All you do it click the button on the frm Designer and then click where you want it on the frm Design. (You can edit the size of the form but adjusting the frm Design window. If you can't do this very simple thing of designing a basic form, see other tuts about it and come back. This only goes into detail, explaining how forms work.
Now This Is my Example Form;
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 696;
frmDesign.Height := 480;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := True;
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 498;
Label1.Top := 278;
Label1.Width := 32;
Label1.Height := 13;
Label1.Caption := 'Label1';
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 296;
Button1.Top := 189;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Button1';
Button1.TabOrder := 8;
CheckBox1 := TCheckBox.Create(frmDesign);
CheckBox1.Parent := frmDesign;
CheckBox1.Left := 48;
CheckBox1.Top := 46;
CheckBox1.Width := 97;
CheckBox1.Height := 17;
CheckBox1.Caption := 'CheckBox1';
CheckBox1.TabOrder := 9;
GroupBox1 := TGroupBox.Create(frmDesign);
GroupBox1.Parent := frmDesign;
GroupBox1.Left := 34;
GroupBox1.Top := 215;
GroupBox1.Width := 185;
GroupBox1.Height := 105;
GroupBox1.Caption := 'GroupBox1';
GroupBox1.TabOrder := 10;
Memo1 := TMemo.Create(frmDesign);
Memo1.Parent := frmDesign;
Memo1.Left := 323;
Memo1.Top := 44;
Memo1.Width := 185;
Memo1.Height := 89;
Memo1.Lines.Add('Memo1');
Memo1.TabOrder := 11;
Not Anything Special, Just has many components Form Creator gives you.
Now, Lets just break down one form add-in.
Memo1 := TMemo.Create(frmDesign);
Memo1.Parent := frmDesign;
Memo1.Left := 323;
Memo1.Top := 44;
Memo1.Width := 185;
Memo1.Height := 89;
Memo1.Lines.Add('Memo1');
Memo1.TabOrder := 11;
Ok Now the first line.
Memo1 := TMemo.Create(frmDesign);
Creates A TMemo called Memo1 in (frmDesign).<– frmDesign is the default name of you form.The Second Line,
Memo1.Parent := frmDesign;
Tells SCAR that Memo1 will be placed in frmDesign(in other words, no in a group box, etc).Lines 3-7
Memo1.Left := 323;
Memo1.Top := 44;
Memo1.Width := 185;
Memo1.Height := 89;
Tell Scar the Parameters For Memo1Line 8
Memo1.Lines.Add('Memo1');
Is Specific Command For a TMemo. All Components have their own commands because thats what makes them different components.What I like to do when editing my form manually is split up the sections so here is my example .
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 696;
frmDesign.Height := 480;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := True;
frmDesign.PixelsPerInch := 96;
//------------------
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 498;
Label1.Top := 278;
Label1.Width := 32;
Label1.Height := 13;
Label1.Caption := 'Label1';
//------------------
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 296;
Button1.Top := 189;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Button1';
Button1.TabOrder := 8;
//------------------
CheckBox1 := TCheckBox.Create(frmDesign);
CheckBox1.Parent := frmDesign;
CheckBox1.Left := 48;
CheckBox1.Top := 46;
CheckBox1.Width := 97;
CheckBox1.Height := 17;
CheckBox1.Caption := 'CheckBox1';
CheckBox1.TabOrder := 9;
//------------------
GroupBox1 := TGroupBox.Create(frmDesign);
GroupBox1.Parent := frmDesign;
GroupBox1.Left := 34;
GroupBox1.Top := 215;
GroupBox1.Width := 185;
GroupBox1.Height := 105;
GroupBox1.Caption := 'GroupBox1';
GroupBox1.TabOrder := 10;
//------------------
Memo1 := TMemo.Create(frmDesign);
Memo1.Parent := frmDesign;
Memo1.Left := 323;
Memo1.Top := 44;
Memo1.Width := 185;
Memo1.Height := 89;
Memo1.Lines.Add('Memo1');
Memo1.TabOrder := 11;