Ok well progress reports are not hard. Here is the basic SRL Multiplayer Progress report.
Writeln(' Worked : '+ IntToStr (Players[CurrentPlayer].Worked)+' minutes.');
Writeln(' Banked : '+ IntToStr (Players[CurrentPlayer].Banked) + ' loads.');
[COLOR="Red"][SIZE="5"]
Maintaining And Developing A Script[/SIZE][/COLOR]
[COLOR="Red"][SIZE="4"]
I DID TAKE THIS FROM MY OTHER TUTORIAL FOUND HERE[/SIZE][/COLOR]
http://www.srl-forums.com/forum/tut-developing-and-t7297.html[COLOR="Red"][SIZE="4"] How To Organize and Develop A SRL/Scar Based Script Through Neatness To Get it Done Faster/ Better[/SIZE][/COLOR]
[COLOR="Black"][SIZE="4"]~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/SIZE][/COLOR]
[COLOR="Black"][SIZE="4"]Index[/SIZE][/COLOR]
- I. Getting Started
- II. Using Basic Tools
- III. Scripting Standards
- IV. Making An Outline
- V. Orgranizing The MainLoop
- VI. Publishing A Script
- VII. Conculsion
[COLOR="Black"][SIZE="4"]~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/SIZE][/COLOR]
[SIZE="4"]Chapter One Getting Started[/SIZE]
Ok, Youre probably reading this tutorial because your scripting is messy, you have trouble finding things, or your just plain bored. This tutorial will go into an explainaton on how I like to keep my scripts organized / make an outline so I don't forget things, don't loose things, etc.
[COLOR="Black"][SIZE="4"]~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/SIZE][/COLOR]
[SIZE="4"]Chapter Two Using Basic Tools[/SIZE]
Well For this Tutorial all you really need are 4 things.
- A Computer -
- Notepad(Or any other writing Program -
- Scar -
- Knowledge Of Scripting -
I am going to go ahead and get you to do the follow things
- Create A folder on the desktops named " My Scripts " or something similar to that -
- Open Up Scar -
- Open Up Your Writing Program -
My Example Will Be A PowerChopper
[COLOR="Black"][SIZE="4"]~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/SIZE][/COLOR]
[SIZE="4"]Chapter Three Scripting Standards[/SIZE]
Well Scripting Standards are the way us scripters keep our scripting
LOOK AT THE BOTTOM OF THE PAGE FOR A STANDARDIZER GOTTEN FROM HEY321 or
~~~~~~~~~~~~~~~~~~~~~~~~
http://www.srl-forums.com/forum/scar-scripting-standards-t6042.html?t=6042http://www.srl-forums.com/forum/scar-script-official-t3997.html?t=3997http://www.srl-forums.com/forum/scripting-standards-t5496.html?t=5496^^^^^^^^^^^^^^^^^^^^^
Go To These Tutorials If you don't understand Scripting Standards. Some scripters have their own standards that they create. In my opinion, if its neat, its good enough for me.
[COLOR="Black"][SIZE="4"]~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/SIZE][/COLOR]
[SIZE="4"]Chapter Four Making An Outline[/SIZE]
Ok well this is where we really start the tutorial. So you have everything ready and you understand scripting standards. To start your outline, you need to know what you want to make. So at the top of your writing program, put your title/idea in
Bold.
[/CENTER]

After that, Make your basic Outline. This FORCES you to know what you want to do with the script

** NOTE ** notice how I use " * " to make personal notes for myself
This Tells you Exactly What to do with the Script. Now, You begin a detailed version of Your outline. Like So
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Red Dots = I like To put special Symbols when indicating a custom procedure
Black Line = See How I fill in the X when its done?[COLOR="Black"][SIZE="4"]~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/SIZE][/COLOR]
[SIZE="4"]Chapter Five Organizing The Mainloop[/SIZE]
Now you have to Organize your mainloop. I don't really know how to explain this as each scripter has his/her own style but, this is how I would organize mine.

[SIZE="6"][COLOR="Red"]
Intermediate[/COLOR][/SIZE]
[SIZE="4"][COLOR="Red"]DTMS[/COLOR][/SIZE]
Ok Well I Love DTMs. They Are a Scripters Best Friend. They are very easy to make and almost infalliable. To get to the DTM Maker, Do these steps.
- Select RS Window
- Go to Tools --> DTM Editor...
THE KEY!! ONLY MOVE THE MOUSE OVER THE OUTLINE COLOR 65336!! THIS IS WHAT IS CALLED A STATIC COLOR. IT DOES NOT CHANGE!!!Now every point you click in the picture is recorded. A DTM(Deformable Template Module) checks for colors and their distances between them. But colors change in rs. Thats why you only choose the color 65336. Here is a picture of a Basic DTM Being Made.
Make The DTM, (See all the colors in the top right? they are all 65336).

Go To File --> Save
Save It Where You can find it and let it have a good name.
then go to
Test --> FindDTM
at the top of you screen(its a drop down menu)
Go to your DTM.
If it doesnt find your DTM, then make a new one , else great job!
Now go to File, DTMToText and close the screen. The DTM Will be in the DebugBox.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MAIN SRL RELATED FUNCTIONS
[scar]
FindDTM(DTM, x,y, x1, y1, x2, y2) // Finds A DTM in the Specified params. records Position at the vars you specify.
FindDtmIn(var FX, FY: Integer; DTM, X1, Y1, X2, Y2: Integer) // Basically Same thing as above.
//To Click A DTM just say something like
If(FindDTMIn(x,y,(DTM Name Here),X1, Y1, X2, Y2)) then
begin
Mouse(x,y,0,0,true);
end;
[/scar]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[COLOR="Red"]BitMaps[/COLOR]BitMaps Are also a highly effective way to find things. They are like a picture. Actually they are a picture. I personally think Bitmaps Are inaccurate and would rather use advanced color finding or DTM's but i will explain anyway.
Well All A BitMap Is, Is a picture So first we need to take a screen shot.
Press the Button "Print Screen". It should be somewhere directly above the arrow keys but maybe higher. This will take a screen Shot of the screen. Now. Go to Paint(or any other picture editing program) and go to Edit --> Paste.
Now Use the cropping tool to cut the image down to its lowest size.(Use The Magnifier if needed). Make The BackGround Black then save. Now open back up SCAR.
[LIST=1]
- Go To Script --> PictureToStr
- Now Click Open
- Select Your File
- Press OK
Now you have the BitMap String in your debug. State that in your script and you can use any BitMap Function for it.
[SIZE="4"][COLOR="Red"]Arrays[/COLOR][/SIZE]
Ok now Arrays are basically a series of variables.
How to Declare themIf you know the length of the array, then you can say it like this.
[scar]
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;
[/scar]
If You don't(like if your adding colors as you go) then it should be stated like this
[scar]
Var
ColorArray : array of integer;
[/scar]
Some functions for arrays:
[scar]
GetArrayLength((ArrayName));
[/scar]
This will get the current length of the array.
[scar]
SetArrayLength((ArrayName),ArrayLenght));
[/scar]
This is useful for updating arrays as you go. So an example of an updating array would be
[scar]
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;
[/scar]
[SIZE="4"][COLOR="Red"]RADIALWALKING[/COLOR][/SIZE]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...
[scar]
RadialWalk(Color,StartRadial,EndRadial,Radius,ModX, ModY);
[/scar]
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
[scar]
RadialWalk( {WhiteColor} , 0, 90, 70, 0 , 0);
[/scar]
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
[scar]
procedure ClickRoad;
var
tmpRoad : integer;
begin
tmpRoad := FindRoadColor;
RadialWalk(tmpRoad,~~~~~~);
end;
[/scar]
USING YAKMANS RADIWALK HELPERHIGHLY SUGGESTED!!
It works amazingly. Here is kinda a mini tutorial on it.
[LIST=1]
- While In SCAR, Go TO Open
- Click on Includes in The " Main Menu " of SCAR(where you downloaded srl)
- go to includes --> SRL --> scripts --> 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!!
[COLOR="Red"][SIZE="4"]Advanced Procedures[/SIZE][/COLOR]Ok now Advanced Procedures are very useful in scripting. I Like to think of Advanced Procedures Having the folowing :
- AntiBan
- Undetectable
- Higly Accurate
[/LIST]
They Are Kind Of "Spur Of The Moment" Ideas. The folowing would be an example.
[scar]
procedure findrock;
begin
If(FindColorSpiral(x,y,color,x1,y1,x2,y2))then
begin
If(FindColorSprial(x,y,color2,x+15, Y+15, x -15, y - 15))then
begin
Writeln('Found');
end;
end;
end;
[/scar]
EDIT:
Ok Well Many People do not understand this so let me go through this procedure where you can. Ok, When you call the first FindColor Spiral,it stores the position of the color at x,y correct?. Well when you call the second FindColorSpiral, the box it creates wil be with 15 pixels of the first color found. Hopefully that will clear things up for you

.
Basically What this will do is find a color on th main screen. If it finds the second color within a box of the first color, it will write found see?. Base commands on other commands results as so and add failsafes and your good to go.
[SIZE="4"][COLOR="Red"]Making Your Own Functions[/COLOR][/SIZE]Well Making your own functions is what intermediate-advanced scripters do.
To Make the functions you want, you need to understand the 4 types of vars. Now Lets say you wanted to make an AxeHead Finder. You would make an outline (Maintaining and Developing a script Above). And get at it. I would suggest using DTMs Or advanced procedures(above) to get a Axe Head Finder Done. Take into consideration all things that happen durring runtime of the procedure. For instance, The Axe Head often lands under the white dots of people on the minimap, and is usually covered by a person. So if it doesnt find it on the first try, make sure it radialwalks (or any other form of minimap walking) to a white dot.