SRL Archive - OSR Outdated Tutorials

All in one beginner tutorial


Bebe

2007-06-20 02:28:59

I appreciate that I could help so many people on their path towards learning to use/script with SCAR but I have sadly not been able to keep updated with the current trends withing the SRL community.

Thier has been a fundimental shift towards a new macro Simba. I implore everybody to have a look at Coh3n's THE Beginner's Simba Tutorial as he has been able to provide a more current `All In One`.

Thank you for the support.






All in one beginner tutorial By Bebemycat2 [OUTDATED]


What is this going to cover?:
  • Where to get SCAR
  • How to create your first script
  • How to make and use Functions
  • Bitmaps

What you will need:
  • Willingness to learn
  • Common sense

Where to get SCAR:
You can download SCAR Divi from the official site here: Freddy1990.com
You can also download it from the official Mirror sites:
Dylock.net - Outdated
Moparisthebest.com - Outdated

ONLY DOWNLOAD FROM THESE SITES! You should never have to pay for SCAR, if you have, then you have been scammed.

How to create you first script:
Ok to begin I will ask you to open up SCAR. Now all you should see is this:
program New;
begin
end.
Well I want you to space all of those out a bit like this:
program New;



begin


end.
This will give us some space to code in. This is just the basic elements. program New; This is your programs name, Change "New" to whatever name you want your program to be. Always add a semicolon ( ; ) after the name to tell the script that that is the end of your scripts name. begin Tells the compiler that the script has just began, the coding of your script goes between "begin" and "end." end. Tells the compiler that you have ended the script, Make sure to always put a full stop. If you are making a procedure/function then you end it with a semicolon ( ; ), that will be explained later in the tutorial.

Next thing we are going to do is this:
program script;



procedure;
begin




end.

You will notice that I have added something called a Procedure. Well a "procedure" is basically this:
From: XxKanexX
Procedures are like sections of the
script that can be called upon for many different reasons.


This procedure is where we will create the "body" or the majority of our script, from there is can be called upon later in the "main line" this I will explain more about later.

You also have to have a name for your procedure, so lets name it "Hello" and add a semi-colon after it so it looks like this:
program script;



procedure;
begin




end.
You name the procedure so that you can "call" upon it later in the script. You can name it anything but I am going to use "Hello" for this script.

Now what we are going to do now is add somthing called a "const" or a constant. This means that this "setting" will stay the same throughout the entire script.

To make a const you simply need to do this with your script:
program script;

const

procedure hello;
begin




end.
Now we have to make something a const, so let make it this:
program script;

const
Message1='Hello world!';

procedure hello;
begin




end.
Now you will notice that I have "Message1=" this is because with SCAR you have to always tell it what the "Message1" equals, that’s the reason for the "=". Now for the ' ' marks. These are what SCAR uses to identify when a String begins and when it ends. A string is a word / phrase. You will notice that it has a pinkish color to it, that is the "Syntax highlighting" that SCAR creates so that scripting can be much simpler.

Now that we have a "const" we need it to do something.

Ok, now if you haven't already found the help file included with SCAR, then I think you should know. To access the help file go to "Help"–>"Help" and you should be presented with the Scar help file. Alternatively you can can simply hit "F1" with Scar open and selected as your active window.
The thing that makes this help file so handy is that it has all or most of SCAR's many functions/procedures plus other helpful content. This file should be your best friend when you are just starting out scripting, and even when you become more advanced.

Ok, now that you know about the help file, lets get back to the tutorial.

Now scroll down the list until you come to a procedure called:
Writeln(s: string);
Now as I explained before a procedure is:
From: XxKanexX
Procedures are like sections of the
script that can be called upon for many different reasons.
And a string is: A string is a word / phrase.

This procedure:
procedure Writeln(s: string);
just means that the "S" is a string, so therefore that is where we would enter what we wanted to type.

So I want you to make your Script look like this now:
program script;

const
Message1='Hello world!';

procedure hello;
begin
Writeln();




End.
You will notice that I have "Writeln();" after the begin, that is because you have to begin the script before you can do anything. :)

Also "Writeln" is a typing "command", it tells SCAR to type the keys that you specify. The Text will show up in something called the "Debug" box that is this area of SCAR:


Now we will do this:
program script;

const
Message1='Hello world!';

procedure hello;
begin
Writeln(Message1);




End.
Now normally we would have to use the ' ' identifiers around "Message1" but in this case, since it is already in the "const" there is no need to and this will tell SCAR to type what you have filled out in the "const" "Message1".

Now we have to tell SCAR that we want to end the current procedure for this we will add "end;" like so:
program script;

const
Message1='Hello world!';

procedure hello;
begin
Writeln(Message1);
end;




end.
This is simply to tell SCAR to end the procedure, you will do the same with a function.
"End;" is different from "end." because "end." tells SCAR to end the whole script while "end;" tells it that you are done with a procedure/function.

Now we have to make SCAR actually type our "message" and use our procedure that we have just created. to do this we have to create the "main line" I mentioned before. This is done much like a procedure but has a few differences that I will explain.

So to start off your "main line" you will need to have a "begin" like so:
program script;

const
Message1='Hello world!';

procedure hello;
begin
Writeln(Message1);
end;


begin

end.
You will notice the begin is there, this is just telling SCAR this is where your main line shall begin. Simple, no? :)

So now we are going to make SCAR repeat something. The command to make SCAR repeat is "repeat". This will go after the being in the "main line". So you should now have code that looks like this:
program script;

const
Message1='Hello world!';

procedure Hello;
begin
Writeln(Message1);
end;


begin
repeat

end.
This basically telling SCAR to begin the "main line" and repeat something. Now we have to tell it what it needs to repeat. For this we will take our procedures name (Hello) and add it under our repeat command. So it should look like this:
program script;

const
Message1='Hello world!';

procedure Hello;
begin
Writeln(Message1);
end;


begin
repeat
hello;

end.
This will tell SCAR to repeat our "Hello procedure". But we have to tell it how long it has to repeat it for, so we will need the command "until". like so:
program script;

const
Message1='Hello world!';

procedure Hello;
begin
Writeln(Message1);
end;


begin
repeat
hello;
until(false)
end.
]Now you will notice that I have "until(false)" when I only told you to add "until". Well until needs some sort of "time marker" to tell it when to repeat until, and "(false)" tells it to repeat forever, this will make it an infinite "loop". With "until(false)" this script will repeat our procedure "Hello" forever, never stopping until the user stop SCAR manually.

Now hit: "script" —–> "Compile" and you should get this message in the "debug" box that says "Successfully compiled" this means that you coded the script right. Now to test it.

With your "crosshair"() select your debug box and hit "run script". You will notice that it keeps typing it over and over really fast. So now we need to slow it down a bit. for this we will use a procedure called "wait". Wait tells the script to wait a designated amount of miliseconds before it's next action. To add wait what we do is this:
program script;

const
Message1='Hello world!';

procedure Hello;
begin
wait(1000)
Writeln(Message1);
end;


begin
repeat
hello;
until(false)
end.
You will notice the "1000)" this is the amount of milliseconds you want to wait, now if you paid attention in math(s) (Depending on if your American or not you call it math or maths) you will know that 1000 milliseconds is 1 second. So we are basically saying that when SCAR reads the "main line" and does our procedure "Hello" that it should wait 1 second before it repeats. Simple, no?
Now run it.

You will see that it types at a much more controlled rate now.


CONGRATULATIONS! You have just made your very first script!

Bebe

2007-06-20 02:30:06

Functions:


What are they?
Functions are the same as procedures but they return a value.

What are the "values" it can return?
String - Text, string of characters
Integer - Whole numbers, positive and negative (i.e. 1, 3, -7)
Extended - Real numbers, positive and negative (i.e. 1.5, -2.6)
Boolean - True or False

And a few more, but these are the basic four variables used in most functions.

How do you make a function?
Well lets start of with a basic example. Say I wanted to convert American miles to metric kilometers.
To do this we need to find the conversion formula, in this case being miles * 1.609 = kilometers

So lets start out by making a function and naming it "MilesToKilometers" like so:
program New;

function MilesToKilometers


begin
end.

But now we have to add a variable so the use can input how many miles need to be converted, so we add this:
(miles:extended)

To get it to like like this:
program New;

function MilesToKilometers(miles:extended)


begin
end.

But wait that won't compile because we have to add the type of variable the function will return in the same line also. For this function you would want it to return an extended because when you are multiplying the miles by 1.609 you are not always going to get a "nice" number (whole number).

So we have to add ":extended;" to the end, like this:
program New;

function MilesToKilometers(miles:extended):extended;


begin
end.

Now lets add our "begin" and "end;", so we get it to look like this:
program New;

function MilesToKilometers(miles:extended):extended;
begin
end;


begin
end.

If you try to compile now then you will get an error like this:
Line 3: [Hint] (3:10): Variable 'Result' never used in script


Now you may be thinking to yourself "But I never defined a variable named Result", well SCAR did. Once you create a function, SCAR creates a local variable named Result.

What is Result? Well it is the result of your function that can be used by other areas in your script. It is also the part of that function that will be returned. Like in the case of our "MilestoKilometers" function, we are returning the amount of kilometers.

So lets get back to our script.

Sow now we have to add result in. So we type "Result:=" and then add our formula "miles * 1.609;"
"Miles" is out variable that was previously defined in the Function "title"
The "*" stands for multiplication.
1.609 is the amount of kilometers in each mile.

So you should have something like this:
program New;

function MilesToKilometers(miles:extended):extended;
begin
result:= miles * 1.609;
end;


begin
end.
Successfully compiled



You just created your first function!


To test our function we can use this script:
program New;

function MilesToKilometers(miles:extended):extended;
begin
result:= miles * 1.609;
end;

procedure WriteFunction;
begin
writeln('1 mile is equal to '+floattostr(MilesToKilometers(1.0))+' kilometers');
end;

begin
WriteFunction;
end.

1 mile is equal to 1.609kilometers


*Note* floattostr converts floating point number to string. So a number with a decimal is converted to a string so it can be outputted by functions like writeln.

It works. :)

Bebe

2007-06-20 02:31:08

Bitmaps:


What are Bitmaps?:
A set of bits that represents a graphic image, with each bit or group of bits corresponding to a pixel in the image.

To sum that all up, a bitmap is a image with a high quality, which makes it idle for SCAR's built in image searching functions/procedures.

How do you capture the image?
If you don't have image capturing software, you can simply use the "Prnt Scrn" button, usually located in the upper right of your keyboard.
If you only want to capture the currently selected window, then you can hit Alt + Prnt Scrn, this reduces the amount of cropping/editing you will have to do later.

Ok, now that you know how to capture an image, lets get an example to use for this tutorial, which in this case will be a willow log from RuneScape 2.
So open up RuneScape and capture an image similar to this one:


I would recommend that for the sack of following along with this tutorial you use the above image also, you may notice that it is a .png instead of a .bmp, well that is because imageshack.us automatically converts a .bmp to a .png. But none the less, it will work.

Anyway, open the Inventory image up in paint or your favorite image editing software (I chose paint because this part is very quick, and you don't need any resource intensive software like PhotoShop to do it.
Anyway, open Paint up and select one of the willow logs, like so:

And then copy or cut it onto your "clipboard", and open up a new Paint, and paste the willow log there. Now make sure the paint pallet is as small as possible, so there is no added white space to your image, as this will increases the size of your bitmap and cause more lag and memory usage, which isn't good at all.

Ok so now you should have a Paint open that looks like so:

Now it is time to make it ready for SCAR. Now a little knowledge for you…
SCAR doesn't register black in it's bitmaps, it ignores black. So lets make it happen.

You see how there is a bunch of extra space around the log, well we don't want SCAR to look for that too, so we are going to black that part out. So select your "Bucket" tool and fill the non-willow log part of the bitmap with black like so:

Now it is time to make the image smaller, yes smaller. The golden rule in bitmaps is the smaller the better. Try to balance efficiency with size. Ok, so now we are going to attempt to make the image smaller by getting as close to the edge of the willow log as possible without removing any part of it. To do this you might want to zoom into the image in Paint by hitting Ctrl+ Page Dn.

So now zoom in and use the select/cut tool to crop the image even closer. Here were my results:

Now it is time to open the bitmap in SCAR!
To do this Open up SCAR, and go to 'Tools' —> 'Picture to String…'

You should be presented with a menu resembling the following:

Now hit open, and find the saved bitmap that you have just created. Make sure the entire image is selected and hit "Ok".
You should now be presented with a whole mess of jumbled letters and numbers in your debug box, that should look similar to this:
WillowLog2 := BitmapFromString(31, 25, 'beNqtlkFLAzEUhJujWBS' + 
'V6qUHeyhqUcuKFUUKVihUFEVRoSAUPPn/f4GzjAyv+zZpsLvMoTTd' +
'L5O8eUlbrfWesKymnpJ22N3o9zYH/fbwZOvyfLshfhBzPNq9Lnagb' +
'HhIC5zJzR6wVnnw8l1YguANDmUS9gAB1isPHt4eBx/Pp1/vw+m4Q3' +
'mUhjRK+EGnneSH7/kF9XC37/kWa0U4VpcPt3yJ31sJvnJbBF98Fpb' +
'vmRJWhHKssl0PT4g7RtsoeryV/mImuN2cGJPxZq6gyW3vqug6fmAj' +
'QAmyiissxReZdtNNnCI8TY+wCWoHkm0aGXuPUuxVFzs7p0C2AQdt/' +
'nrGH5Msbx7rw+l3jPCfxYhWBUcfvcyOKw3urfp8erjiITjnwhSxro' +
'kl38PBIRwfaDuW9pyGqsBh2MJtYBLwvIYqCyo4bOc4r00pc8iz1KS' +
'95MM/hBXN7vu1fZooH5S88paGYq1kz0kHzL3FrHOZ19G99o0cKtvS' +
'BLPKp+Gm/zlUCvGv5xdCwRWZ');

Now Lets turn this into a working bitmap finder.

To start of you have SCAR load your bitmap before it can use it, so lets create a procedure and call it "LoadBitmap", straightforward, huh?
And lets copy the bitmap from the debug box and paste it within the procedure, so select the bitmap text and hit CTRL + C (this is the keyboard shortcut for 'copy').

You should have code that look like this:
program New;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(31, 25, 'beNqtlkFLAzEUhJujWBS' +
'V6qUHeyhqUcuKFUUKVihUFEVRoSAUPPn/f4GzjAyv+zZpsLvMoTTd' +
'L5O8eUlbrfWesKymnpJ22N3o9zYH/fbwZOvyfLshfhBzPNq9Lnagb' +
'HhIC5zJzR6wVnnw8l1YguANDmUS9gAB1isPHt4eBx/Pp1/vw+m4Q3' +
'mUhjRK+EGnneSH7/kF9XC37/kWa0U4VpcPt3yJ31sJvnJbBF98Fpb' +
'vmRJWhHKssl0PT4g7RtsoeryV/mImuN2cGJPxZq6gyW3vqug6fmAj' +
'QAmyiissxReZdtNNnCI8TY+wCWoHkm0aGXuPUuxVFzs7p0C2AQdt/' +
'nrGH5Msbx7rw+l3jPCfxYhWBUcfvcyOKw3urfp8erjiITjnwhSxro' +
'kl38PBIRwfaDuW9pyGqsBh2MJtYBLwvIYqCyo4bOc4r00pc8iz1KS' +
'95MM/hBXN7vu1fZooH5S88paGYq1kz0kHzL3FrHOZ19G99o0cKtvS' +
'BLPKp+Gm/zlUCvGv5xdCwRWZ');
end;

begin
end.

Ok, now that you have the bitmap loaded, you have to declare the bitmap name as a variable, so lets do that.
In this case we will declare it as what is called a 'Global Variable'.
To do this add the command 'Var', about one to two spaces below 'Program', so that should like like this:
program New;

var

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(31, 25, 'beNqtlkFLAzEUhJujWBS' +
'V6qUHeyhqUcuKFUUKVihUFEVRoSAUPPn/f4GzjAyv+zZpsLvMoTTd' +
'L5O8eUlbrfWesKymnpJ22N3o9zYH/fbwZOvyfLshfhBzPNq9Lnagb' +
'HhIC5zJzR6wVnnw8l1YguANDmUS9gAB1isPHt4eBx/Pp1/vw+m4Q3' +
'mUhjRK+EGnneSH7/kF9XC37/kWa0U4VpcPt3yJ31sJvnJbBF98Fpb' +
'vmRJWhHKssl0PT4g7RtsoeryV/mImuN2cGJPxZq6gyW3vqug6fmAj' +
'QAmyiissxReZdtNNnCI8TY+wCWoHkm0aGXuPUuxVFzs7p0C2AQdt/' +
'nrGH5Msbx7rw+l3jPCfxYhWBUcfvcyOKw3urfp8erjiITjnwhSxro' +
'kl38PBIRwfaDuW9pyGqsBh2MJtYBLwvIYqCyo4bOc4r00pc8iz1KS' +
'95MM/hBXN7vu1fZooH5S88paGYq1kz0kHzL3FrHOZ19G99o0cKtvS' +
'BLPKp+Gm/zlUCvGv5xdCwRWZ');
end;

begin
end.

Now we have to declare our bitmap "WillowLog2" as a variable. Bitmaps are declared as integers. So lets do it…
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(31, 25, 'beNqtlkFLAzEUhJujWBS' +
'V6qUHeyhqUcuKFUUKVihUFEVRoSAUPPn/f4GzjAyv+zZpsLvMoTTd' +
'L5O8eUlbrfWesKymnpJ22N3o9zYH/fbwZOvyfLshfhBzPNq9Lnagb' +
'HhIC5zJzR6wVnnw8l1YguANDmUS9gAB1isPHt4eBx/Pp1/vw+m4Q3' +
'mUhjRK+EGnneSH7/kF9XC37/kWa0U4VpcPt3yJ31sJvnJbBF98Fpb' +
'vmRJWhHKssl0PT4g7RtsoeryV/mImuN2cGJPxZq6gyW3vqug6fmAj' +
'QAmyiissxReZdtNNnCI8TY+wCWoHkm0aGXuPUuxVFzs7p0C2AQdt/' +
'nrGH5Msbx7rw+l3jPCfxYhWBUcfvcyOKw3urfp8erjiITjnwhSxro' +
'kl38PBIRwfaDuW9pyGqsBh2MJtYBLwvIYqCyo4bOc4r00pc8iz1KS' +
'95MM/hBXN7vu1fZooH5S88paGYq1kz0kHzL3FrHOZ19G99o0cKtvS' +
'BLPKp+Gm/zlUCvGv5xdCwRWZ');
end;

begin
end.

Now that we have the bitmap declared and ready for use, lets search for it!
If you look at your list of Bitmap function, you will see
"function FindBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer): Boolean;"
And you guessed it, this is what we will use to search for the willow log in the RuneScape inventory.

This function my seem complicated, but really it is extremely easy to use. To start off, lets make a procedure to find our bitmap, so creat a new procedure and lets name it "FBitmap". So our script should look like this:
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(31, 25, 'beNqtlkFLAzEUhJujWBS' +
'V6qUHeyhqUcuKFUUKVihUFEVRoSAUPPn/f4GzjAyv+zZpsLvMoTTd' +
'L5O8eUlbrfWesKymnpJ22N3o9zYH/fbwZOvyfLshfhBzPNq9Lnagb' +
'HhIC5zJzR6wVnnw8l1YguANDmUS9gAB1isPHt4eBx/Pp1/vw+m4Q3' +
'mUhjRK+EGnneSH7/kF9XC37/kWa0U4VpcPt3yJ31sJvnJbBF98Fpb' +
'vmRJWhHKssl0PT4g7RtsoeryV/mImuN2cGJPxZq6gyW3vqug6fmAj' +
'QAmyiissxReZdtNNnCI8TY+wCWoHkm0aGXuPUuxVFzs7p0C2AQdt/' +
'nrGH5Msbx7rw+l3jPCfxYhWBUcfvcyOKw3urfp8erjiITjnwhSxro' +
'kl38PBIRwfaDuW9pyGqsBh2MJtYBLwvIYqCyo4bOc4r00pc8iz1KS' +
'95MM/hBXN7vu1fZooH5S88paGYq1kz0kHzL3FrHOZ19G99o0cKtvS' +
'BLPKp+Gm/zlUCvGv5xdCwRWZ');
end;

procedure FBitmap;
begin

end;

begin

Now let me show you how to fill out the function 'FindBitmapToleranceIn':
bitmap: Integer; - This is the name of you bitmap, in this case "WillowLog2"
var x, y: Integer; - These are the variables that will be returned for the position of the found bitmap, this is useful when you want to click the bitmap, or interact with it after it is found.
Integer; x1, y1, x2, y2: Integer; - These are the coordinates for the "box" that SCAR will search for the bitmap in. This is very useful to not only save time when searching for bitmaps (because SCAR has to search less of the selected client), but also reduces memory usage and lag. In our case, since we are searching for the willow logs in the inventory, we will be using the coordinateness 560, 214, 734, 457
tolerance: Integer - this is the amount that the color can change and still be recognized, you want as low a number as possible, so you don't have other colors interfering. I recommend a tolerance of about 20 - 30.

Ok so now that we understand the different parts of 'FindBitmapToleranceIn', lets fill it out and add it to our script. So lets add:
FindBitmapToleranceIn(WillowLog2, x, y, 560, 214, 734, 457, 25);
to our script:
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(31, 25, 'beNqtlkFLAzEUhJujWBS' +
'V6qUHeyhqUcuKFUUKVihUFEVRoSAUPPn/f4GzjAyv+zZpsLvMoTTd' +
'L5O8eUlbrfWesKymnpJ22N3o9zYH/fbwZOvyfLshfhBzPNq9Lnagb' +
'HhIC5zJzR6wVnnw8l1YguANDmUS9gAB1isPHt4eBx/Pp1/vw+m4Q3' +
'mUhjRK+EGnneSH7/kF9XC37/kWa0U4VpcPt3yJ31sJvnJbBF98Fpb' +
'vmRJWhHKssl0PT4g7RtsoeryV/mImuN2cGJPxZq6gyW3vqug6fmAj' +
'QAmyiissxReZdtNNnCI8TY+wCWoHkm0aGXuPUuxVFzs7p0C2AQdt/' +
'nrGH5Msbx7rw+l3jPCfxYhWBUcfvcyOKw3urfp8erjiITjnwhSxro' +
'kl38PBIRwfaDuW9pyGqsBh2MJtYBLwvIYqCyo4bOc4r00pc8iz1KS' +
'95MM/hBXN7vu1fZooH5S88paGYq1kz0kHzL3FrHOZ19G99o0cKtvS' +
'BLPKp+Gm/zlUCvGv5xdCwRWZ');
end;

procedure FBitmap;
var
x, y :integer;
begin
FindBitmapToleranceIn(WillowLog2, x, y, 560, 214, 734, 457, 25);
end;

begin
end.
As you might have noticed, I have added the variables 'x' and 'y' to the "Local variables", you need to do this in order for this script to compile and work. "Local Variables" work the same as Global Variables except they can't be used outside of the specified procedure/function.

Now You just add our procedure 'Fbitmap' to the mainline, and there you go, you have your very own bitmap searching script.

Congratulations! :)

Bebe

2007-06-20 02:32:22

Design tips:

When you want to leave notes to the user of your script like this:
program script;

const
Message1='Hello world!';

procedure Hello;
begin
wait(1000)
Writeln(Message1); // this says hello
end;

begin
repeat
hello;
until(false)
end.
Now you will notice that I used "//". This tells SCAR not to include what comes after the "//" in the script.
Now if you don't feel like using "//" every time you want to comment on something, then you can use " { " and " } ". examples of both.

with //:

program script;

const
Message1='Hello world!';

procedure Hello;
begin
wait(1000)
Writeln(Message1); // this says hello wolrd!
end;

begin
repeat
hello;
until(false)
end.

with { and }:
{ 
This a script in scar that will say
Hello world!
}


program script;

const
Message1='Hello world!';

procedure Hello;
begin
wait(1000)
Writeln(Message1); { this says hello}
end;


begin
repeat
hello;
until(false)
end.
You will notice that with { and } that you can do multiple lines where as with // you can not with out constantly typing "//" over and over.

Bebe

2007-06-20 02:37:06

Update: 07-30-08 - I fixed the images is the bitmap tutorial and tweaked a few things I said. I plan on doinging more improvments soon.

Santa_Clause

2007-06-20 02:58:03

Dang! Hot tutorial!

P.S - Why do people reserve…?

Hugolord

2007-06-20 03:30:21

From: SantaClause
Dang! Hot tutorial!

P.S - Why do people reserve…?


so they can edit later

and Bebe nice TUT!

Bebe

2007-06-20 13:39:47

From: SantaClause
Dang! Hot tutorial!

P.S - Why do people reserve…?

Because I'm not done just yet ;)

@hugolord Thank you :)

malotthouse

2007-06-28 21:14:49

thx for the guide bebe

WhiteShadow

2007-06-28 21:43:46

Your tutorials are always so descriptive. ;DD

lolpie

2007-06-29 00:07:26

Wow, best tutorial on here. GJ, you get a sticker :D
I like it because it actually explains what things like constants and variables are. So many other tuts are like:

"Ok, type

const
i=1;

which makes i equal to 1"
:(

BobboHobbo

2007-06-29 22:00:11

Wow thats alot of explainin, nice TUT Rep+

brettw_nero

2007-07-14 01:10:16

I'm sorry man. I just have to ask the people this one question. Does anyone here understand this script that DOES NOT know how to script? I just started using SRL scripts and I don't want to feel like a leech so I want to take up scripting.

Maybe it's just me or the fact that I'm really tired - Played volleyball all day and it's 1:30 - I just don't understand :(

viscous101

2007-07-14 18:54:14

It isnt just you brettw_nero.
i started using scripts and started feeling like a lecher to so i thought id read through a tut but i just have no clue what to do :confused: :(

i was tryin to see how to make scripts so i could try making a willow cutter/banker but i dont think that i will be able to do that for years of practice

brettw_nero

2007-07-15 13:09:39

Yeah. I was also thinking of making a willow cutter/banker… I found the ones already on this site were useless. Too many errors with them :(

matty24

2007-07-15 21:01:17

is it just me or being 14 and learning this stuff really hard to learn lol… i learnt the first part :saying words lol had some good fun with that HECK YEAH EASY and bitmap had a bit of trouble…but i didnt get mine to work but got urs to work tho :S

HellBoyz

2007-07-15 21:45:22

Yeah, Scripting is fun and it do help a lot but the main problem of yours will be try to learning programming coz its the source of learning scripting in scar. As it won't be happen in a single click, learning scripting is a long way to go and you must have a fate in yourself. lol:sasmokin:

thunar

2007-07-16 12:26:19

I am reasonably new to scripting (havn't made a useful script), and I thought the tutorial was good, but not finished. I know more about bitmaps and functions, but only about 1 feature of bitmaps. I would also like to see more about clicking.
Great job:) .

syther fox

2007-07-18 21:56:55

how would you use it to click on the object?

HyperSecret

2007-07-19 12:39:06

good tut thx alot man

matty24

2007-07-20 12:55:18

very very nice my scar always does this error BUT i figure it out…Line 31: [Error] (31:1): Semicolon (';') expected in script so i put a semicolon all around the area and then i forgot to put a semicolon after Procedure FBitmap; and that fixed it?

inkd

2007-07-20 20:03:21

looks a real nice big and detailed tut ill be sure to read it thanks for the tut.

edit - read it all great tut thnx!

dannymet

2007-07-22 07:26:13

nicve tutorial, but i have now got a headache and my eyes are hurting… im serious!!

i demand for you to pay me for new eyes! :D

Skalla

2007-08-03 14:58:15

Hey i have read a bit of the tutorial, and it is really helpful, :bart:

but, i get a "Failed when compiling"

Failed when compiling
Line 8: [Error] (8:1): Unknown identifier 'WriteIn' in script

please answer as fast as possible so i can continue this tutorial :)

Thanks.

EDIT: Here is the script i done so far from this tutorial~

program Script;

Const
Message1='Hello World!';

Procedure Hello;
begin
WriteIn(Message1);
End;


Begin
Repeat
Hello;
Until(False)

end.



P.S.

The tutorial ROCKS :spot:


EDIT2: Found the problem, think that one space " " can do so much difference O.o


~~ Skalla ~~

[-jesus-]

2007-08-04 17:56:51

Ty! This helped me out alot lol:p I already knew a how to do bitmaps & dtm's + write a message or 2 in the debug box, but that was about it:o

[-jesus-]

2007-08-04 17:58:45

From: dissdiss
Hey i have read a bit of the tutorial, and it is really helpful, :bart:

but, i get a "Failed when compiling"

Failed when compiling
Line 8: [Error] (8:1): Unknown identifier 'WriteIn' in script

please answer as fast as possible so i can continue this tutorial :)

Thanks.

EDIT: Here is the script i done so far from this tutorial~

program Script;

Const
Message1='Hello World!';

Procedure Hello;
begin
WriteIn(Message1);
End;


Begin
Repeat
Hello;
Until(False)

end.



P.S.

The tutorial ROCKS :spot:


EDIT2: Found the problem, think that one space " " can do so much difference O.o


~~ Skalla ~~



It's supposed to be Writeln, not WriteIn

Skalla

2007-08-05 06:34:19

oh yeah :P i noticed a while ago >.<

mynameisjoe

2007-08-06 10:14:41

Yeah, awesome bitmap section! So many helpful pictures! ;)

BLooDBaNDiT

2007-08-07 19:18:10

Good Tut, everything worked… i think. for the bitmap tutorial when i finished it and ran the script it just says:
"Successfully compiled
Successfully executed"
is that all it is supposed to do?

note: im brand new to scar so sorry if this is a very nubbish question

ZCas07

2007-08-10 20:16:48

Very helpful for the newer scripters (like myself :D!) I'm learning a lot by reading it and scripting is actually kinda cool lol. I liked the hello world script the most so far :)!

sindrepg

2007-08-13 02:24:26

I just want to say that this is a great tutorial=) but i had some trouble with the bitmap section… When i get the bitmap in the debug box it says WillowLog2 := BitmapFromString2(false, why does it say false? can anyone help me with this? It just seems like i just can't get this right… An dhow can i only take a screenshot of only the inventory? please i need help=/

Arkeus

2007-08-13 07:07:49

Awesome tutorial, this will definitely help. =D

darky

2007-08-20 12:10:57

This is a really good tutorial, but I am having a bit of trouble finding the "procedureparams" file…Any advice/help/feedback would be very much appreciated as I may one day come up with a great script!!!:(h):

valesar

2007-08-21 00:07:08

Awesome tutorial. I've been looking around for a while now and every other one I found just didn't make sense, but after reading this one I suddenly feel like I know what I'm doing.

jimminarious

2007-08-23 06:34:03

really great tut. helped me a lot. thnx bebe.

gamer 5

2007-08-24 15:08:43

Great tut I really learned alot!

I B X R

2007-08-30 23:41:42

Wow, nice guide dude!!!

gerauchert

2007-08-30 23:59:25

very nice tut, well explained and everything :D

oh and BTW you have the same thing twice in your first part of the tutorial :p

cptn

2007-09-02 19:29:42

ty helped me a lot :)

gothicly2

2007-09-02 20:27:55

Great script likead and loved it!!

popmun

2007-09-03 08:57:47

thnx for the tut need to learn more of this kind of stuff :)

cheri

2007-09-03 09:26:21

Very nice and LONG tutorial. :)

tomd741

2007-09-03 12:08:06

amazing guide!

vilon

2007-09-03 14:08:16

Nice layout and very easy to follow.
Great work! Thanks!

wheatthinz

2007-09-04 00:56:38

awesome tut!!!

Diabloizzle

2007-09-04 02:27:22

Thanks for the help! I'm trying to make my own script…which is not going too well… And the bitmap section really helped me. Then all of the sudden i heard about DTMs…i was like, "oh crap, why'd they add this?" So do DTMs have any advantage over bitmaps? or is it basically the same? (i still dont understand dtms…gonna go look for a tut on that next) :)

Splicer16

2007-09-04 06:37:42

Really hot tut…thanks

The functions tut was most helpful for me…

upmar

2007-09-04 08:44:58

Woot i love it.

monkybuts9

2007-09-04 23:56:13

great tut thnx for posting. it helped a lot:D

kamikeza

2007-09-05 13:30:54

i hope i can make my first scripts soon thanks

deadlyaznboy

2007-09-05 22:01:16

Wow nice tut it help alot… very detail and percise. Thanks Bebemycat2!

[N]ick

2007-09-08 16:59:42

Great tutorial, Thank You!

NitroStalker

2007-09-08 17:03:15

Wow that tut helped alot it's pretty cool! thank you! :D

ultima2007

2007-09-08 18:29:00

This helped me out a lot, cause I hate felling like a leecher and now I might be able to complete a couple of scripts
thanks!

Kuukkeli

2007-09-15 08:18:12

This helped me too much! My first powercutter is ready :P Thanks.

Aser

2007-09-16 00:35:10

I have to say that is a very good tut. Thank you kindly.

I only missed on part and that is


writeln('1 mile is equal to '+floattostr(MilesToKilometers(1.0))+' kilometers');
sorry don't know how to do quote yet

where didt the floattosrt come from

shimon

2007-09-17 21:23:32

great tut I hope you will write more tutorials so we all can learn.

Turix

2007-09-18 16:02:26

Very usefull post, thanks!

Even coming from a programming background (HTML, PHP, SQL, JS/Java) its always nice to have a nice simple introduction to a new language (yes i aint learned pascal before), good length and covers everything needed :)

(rated 5/5 ofc)

/Turix

deathcrow

2007-09-19 09:46:55

nice tutorial….i was wondering if you could help me out with this. I was running the Ratz script and i got this message:
Include file C:\Program Files\SCAR 3.11\includes\SRL\SRL\misc\Bitmaps\Crafting.scar does not exist.
Include file C:\Program Files\SCAR 3.11\includes\SRL\SRL\misc\Bitmaps\Prayer.scar does not exist.
Failed when compiling

How can i fix this? I decided to ask you since you know about bitmaps and stuff.

499185

2007-09-19 21:48:56

ty so much dude. I had no understanding of how it works and now i kinda do
note the kinda. i'll look through more tuts and see if i can make something worthwhile

lolpie

2007-09-22 00:26:50

Anyone wanna put this in a pdf file with all the formatting and stuff removed (except the code boxes)? That way we can print it out and study it later.

Thanks

gicu200100

2007-09-22 10:04:19

VERY USEFULL..READING IT 6 times!

lolpie

2007-09-22 11:19:04

Well I converted it to PDF myself. I cut out a lot of things (intro, random spaces) so you save ink, so now it's down to 21 pages. I'll post it here once Bebe gives me permission

Wdf?

2007-09-22 12:26:04

TYVM :D helped me lots!

li_HAM1

2007-09-23 00:40:02

thanks very helpful

Oranges_Exist

2007-09-23 01:17:55

Wow this helps a lot, thank you SO MUCH

crunkdood23

2007-09-23 14:44:40

awesome thx a lot

popmun

2007-10-02 14:29:08

thnx bebe im gonna read this guide every day more and more so i know exacly when to use procedure etc and like someone said scar scripting takes a long time to learn lol and not in 2 mins :rolleyes:

popmun.;)

Simtoon

2007-10-03 07:48:37

program script;

const
Message1='Hello World!';

procedure Hello;
begin
wait(1000)
WriteIn(Message1);
end;


Begin
repeat
Hello;
until(false)
end.


Failed when compiling
Line 9: [Error] (9:1): Unknown identifier 'WriteIn' in script

lolpie

2007-10-03 11:47:27

It's Writeln, not WriteIn :). It's a lowercase L

lalaland

2007-10-03 18:06:42

Thank you very much Bebe. This is a great tutorial. I have never tryed scripting in SCAR and this helped me alot. I made a simple login procedure while reading this tutorial:) If you want to see my first script ever, PM me. Thanks again!

buck cakes

2007-10-03 21:05:34

thanks!
nice detailed walkthrough and now ive made my own hello world script

skilld u

2007-10-03 22:46:44

thanks. that helped me alot. but i dont understand what you would use the bitmap searching part for.

daw_guy

2007-10-05 16:23:36

This is a great tutorial.
From this I learned the basics.
I had a problem but I looked and looked and found my problem ty so much.
Line 11: [Error] (11:79): comma (',') expected in script 
Successfully compiled
w00t

m3dtem

2007-10-06 01:12:34

WOW–I do not mean World of War craft^^.
very clear
thanks for the effort

pilbusamakas

2007-10-06 07:55:41

i have to say that this tut rocks :spot:
little bit more learning and i think that i´m gonna make a script of firemaking by my self soon. TYMV

spirosoccer2007

2007-10-06 09:27:35

good tutorial

spirosoccer2007

2007-10-06 11:40:14

i get this error when i use the form editor to paste my form into the scar program. It says object is expected in line one

josh81193

2007-10-06 21:19:20

awsome tut! it helped me loads, but still need to learn more ;P

Hexzar

2007-10-07 11:16:46

this is an awsome tutorial, thank you very much !

2pac

2007-10-07 13:22:53

Nice u i Understand how scipt work a little bit keep up your good work thank u…

matiquielma

2007-10-10 14:31:55

I'd like to do the first one, but i wonna do the next thing: i want it to tipe 2 messages, intercallated (like this)
Hello world!
oh yeah!
hello world!
oh yeah!

ok?, well, here is my script, i dont know what is wrong, a lot of expecteds "." in lines 20+


[script]Program script;
const
Message2='Oh Yeaaaahh!';
procedure Hello2;
begin
wait(1400)
Writeln(Message2);
end;
const
Message1='Hello Wold!';
procedure Hello;
begin
wait(1500)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end;
begin
repeat
hello2
until(false);
end;
end.[/script]

I edited one "end;", now its like this:


Program script;
const
Message2='Oh Yeaaaahh!';
procedure Hello2;
begin
wait(1400)
Writeln(Message2);
end;
const
Message1='Hello Wold!';
procedure Hello;
begin
wait(1500)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
begin
repeat
hello2
until(false);
end;
end.


But, when i put "play" i just says "hello wold!" :S
Help?

davidwang95

2007-10-10 15:27:03

lol nice tut

lolpie

2007-10-12 01:25:24

From: matiquielma

[script]Program script;
const
Message2='Oh Yeaaaahh!';
Message1='Hello Wold!';

procedure Hello;
begin
wait(1500)
Writeln(Message1);
Writeln(Message2);
end;

begin
repeat
hello;
until(false)
end;
end.[/script]

But, when i put "play" i just says "hello wold!" :S
Help?


There ya go :)

lolpie

2007-10-13 23:01:19

Writeln (lowercase L)

Harry

2007-10-13 23:03:16

Yes, use WriteLn('String'); The lowercase L confused me when I was a noob. :o

Rawr_Cabbage

2007-10-14 17:42:53

Great tutorial, helped me alot with understanding bitmaps. I know they are avoided if possible (laggage and what not), but when you have to it's great to know ;D. Thanks for the tut.

tylanbo

2007-10-15 12:52:47

"Now it is time to make it ready for SCAR. Now a little knowledge for you…
SCAR doesn't register black in it's bitmaps, it ignores black."

Wow, would have saved myself a bunch of lag if I had known that… well better now than never ;)

Good tut, even the simple tuts can teach you something apparently. (h)

Vap0ur

2007-10-17 17:10:07

nice tut i really liked.

gl3nni

2007-10-19 01:54:59

very nice tut, alltho i need u too finish
:P so ill guess ill add this to favs and come back later :p

phinoxrobo

2007-10-23 05:04:45

this is a awsome TUT and very nicely explained still im rather dumb and its gunna take me a long time to understand it all i enjoy reading these TUTs

LEMON118

2007-10-25 06:11:15

Nice Job, I understand a lot better Now :D

crouch

2007-10-25 15:09:41

thats really interesting , it isnt that hard as it seemed , now' the time stop wasting in the free for alls and making something useful for :D

6RoHmU9

2007-10-27 08:57:26

Bitmap tutorial is old :( I tried to do everything like in it, but when i compiled I got this : Unknown identifier 'x' in line 33

So this is for the older version of scar/srl?

blitzwing

2007-10-28 01:12:48

very helpful tut

supadude

2007-10-28 08:26:15

woot ty so so much awesome guide helped me heaps

im new to scripting and this has taught me a lot thanks so much dude

Corax

2007-10-29 01:39:31

Thanks a lot, this tutorial really helped me. (In particular with the difference between a procedure and a function.)

Nereverine

2007-10-29 02:05:17

Would it be possible to extract/compile SCAR scripts in to a stand alone trainer format?

krnpride

2007-10-29 20:18:37

im like 14 and im tryin to learn how to make scripts
and this is just amazing for beginners

i get scripting alot mor now

AMAZING SCRIPT

killermain53

2007-10-29 21:15:50

ty this helped me alot:fiery:

vasu

2007-10-30 09:05:36

ty, this helps much

*Skiller Feibal*

2007-10-30 17:45:44

Thanks sooo Much! :D .. Fed up of being a leacher lol, learning how to script :) But i got a problem.. :(

I got This: Line 4: [Error] (4:8): colon (':') expected in script
In this Script: :mad:

program New;

var
willow1: interger;

procedure LoadBitmap;
begin
Willow1 := BitmapFromString(32, 28, 'beNrtlEFLw0AUh' +
'JM/4CEHoRRKe+pFij2UFmk1IIGIPZhDwaIoKigF0YMXf75TR8dHdp' +
'Nuay6CyxxKkn5vdvfNi6KzdBT9r+ZXDB3094aDZDJMZuP902nr82E' +
'zcGHnWTtPWxD5h93u7+lAFXkbZKsd+HAIn7IKk+CA7CqYH99fTR5v' +
'jp4fZot5h3JpeqW35Pc6yaYriN9WKbW86LklLNmKfOxxK74tIfG5l' +
'fgB/fPDf306sSVcrIR94WoCzPv5NeLR0Tx6gKGoyYvl21OqwrLt4R' +
'xwqDgfZGm/VCI/xnyLmRGoBq67FpniH5kCBc1Uia8XI5yGkkK4bVE' +
'45AQo0RQH3ZE18F1i3fPgA7i6m/J7wuXQJbsd6x6d+O8vGQ2Lj4jd' +
'Xo5LE8A17Datl6+GEZ/lUKUqUFWJ8PKBIh8/aL4qBSFZc/mwbfm2h' +
'Wr4wVlb36/4MB/i39u6bE5O3VIKUAK7gLC1ZTH0prjmNiEltDbFX6' +
'sqZXaiOswtlvWvLWjU78b0DjrBG8KWS9B2o9g/tT4A8StemQ==');
end;

procedure FBitmap;
var
x, y :integer;
begin
FindBitmapToleranceIn(willow1, x, y, 560, 214, 734, 457, 25);
end;

begin
end.

Sorry..Any help?
but..AMAZING TUT :p

im dan

2007-10-30 19:05:45

suppose this was ok, guess ill go intermediate section and have a butch :D

iunseeni

2007-10-31 18:09:54

Understood most of it, im just reading most of the beginner ones.

prolific125

2007-11-01 04:32:04

thanks this has taught me some good stuff nice tut..

prolific125

2007-11-01 05:17:17

hello i need help i try to start a draynor willow whacker.
it says this
[Runtime Error] : Out Of Range in line 53 in script C:\Documents and Settings\jake\Desktop\Willow Smasher & Banker V2.3.scar and its jsut the username set up line the same as the above one. what do i do

d0pe b0i

2007-11-01 10:39:05

thanks that helped a ton ty =]

tjrazor

2007-11-01 23:50:36

Wow, thanks a lot for this tutorial, I don't have time now but I'll be sure to follow it tomorrow.

kilo187

2007-11-01 23:52:05

Thanks man u explained it beautifully lol.
Trying my best to learn i guess it just takes time though….

prolific125

2007-11-02 01:11:56

thanx so much. again lol but pleas reply to my comment?

Michlenn999

2007-11-02 05:46:12

Nice tut, gonna read a few other tuts then gonna start my very first script :D. Going to attempt to create a simple autotalker to start out ;).

God-Zool

2007-11-02 08:44:08

wtf???

procedure FBitmap;
var
x, y :integer;
begin
FindBitmapToleranceIn(Oaks: x, y, 560, 214, 734, 457, 25);



end.

i keep getting:

Failed when compiling
Line 29: [Error] (29:27): comma (',') expected in script

tofuli

2007-11-06 09:18:19

I was trying to make a needle finder with the help of your tut.
Now this is what I have so far:

program Needlefinder;

var
needle: integer;

procedure LoadBitmap;
begin
needle := BitmapFromString(22, 33, 'beNrFlc1Kw0AUhXt3xafoI/' +
'hSXak7N4FSCm1sjWVCjdM4Y5yaJv2ltiIIPp4nBAouc2bR4S6yOWc' +
'+Tu6902pd7oinPEmch4nUdd3poAj5Vbtdvqa1Aweg50sfgDQtXZL4' +
'AMDBB8CY1eTxhQUQazfLuWYBJMu2cBiNFA0Ah3OABIBz+5U1g0FEA' +
'chicYCDUYoGgMOH1r3eAweQ50c46KeIApCiOMEhm82CYMgBlOUXAm' +
'QTkPX6OwxjG8f9/oROACPM9oDsdj8AwC+gmlAOn78YH8jPa6Spg1I' +
'GVyNDagyr/CGEfPueNQeobkdt3uzeOXw0BJAo0nWd0ElF0RCgWr/j' +
'8TP4p9P0mOdgaAoAh/vbm2EQxGF41+2iGYgMYVKXx2vy7yXilrmP9' +
'sLnD2B0nGk=');
end;

procedure FBitmap;
var
x, y :integer;
begin
FindBitmapToleranceIn(needle, x, y, 560, 214, 734, 457, 25);
end;

begin
end.

So I would want it to say "Needle found" if it finds the needle in Invy, and if it doesnt "Needle not found"

How do I do it?


EDIT: Figured it out! I'll post my needlefinder in the First script section!

jomp92

2007-11-06 19:00:02

dang this helps so much it really helped give me a basic understanding more so I can mess around a little more and get more of an idea thank you

Christphr1

2007-11-06 21:12:30

Thank you, one day i hope to make a great script.

Versace

2007-11-07 01:57:23

Dude, I am like drooling over this tut. I didn't really give any thought to trying complete bare bones scripting myself, but you make it seem possible! :D

"Give a man a script, he autos for a day. Teach a man to script, he autos for a lifetime."

laz0e^

2007-11-07 16:36:39

Thanks alot m8 i was loving this tut u make it look so easy, hopefully one day ill be making cool scripts like these ^^

goth5988

2007-11-12 14:36:03

Very descriptive! Great tut for us noobs! :D

ecclesiastes

2007-11-13 17:25:27

wow nice tut… thanks…

mark9510

2007-11-14 22:48:13

when are you finishing it

chiel226

2007-11-15 16:17:58

good tut! i goin make my own script now.

Doreauxgard

2007-11-15 16:43:54

From: chiel226
good tut! i goin make my own script now.


True dat brah me too

Matsetst

2007-11-16 19:34:08

Thanks fore this tut! It helps me.

Aztec hacker

2007-11-21 17:22:06

Thanks You Sooo Much!!!!! Awesome Tut!!!!:d

Blumblebee

2007-11-21 22:31:33

good tut helped me alot thanks

my-p-hat

2007-11-22 10:36:59

thx man ive done my first script lol (i dont think its much of a script but still)

/////////////////////////////////////////////////////
///////TY VERY MUCH THIS TUT HELPED ME AND I MANAGE//
////// TO DO THIS TYVM!//////////////////////////////
/////////////////////////////////////////////////////



program ty;

const
message1='ty';

procedure ty;
begin
wait(1000)
writeln(message1);
end;

begin
repeat
ty;

until(false)
end.

my-p-hat

2007-11-22 10:48:21

ps.. sorry 4 double post .. but if i got some of the script wrong my bad

Cerium

2007-11-23 11:42:47

Nice tut:)

mageboy46

2007-11-25 03:38:13

Thanks for the TUT helped me alot.

aka1represent

2007-11-25 09:46:38

I understand it a bit better now :)

spensel

2007-11-25 16:50:22

Thanks a ton, man
nice tut

spineless78

2007-11-25 20:01:38

Greta work on the tut, now i understand how to use scar, YAY:D

Yakri

2007-11-27 02:31:43

Thank you! this helped me sooo much. :D

i kinda kept going on the one that writes out text and got this ^_^

program walkytalky;

{this is my first step on the
path to greatness!}

const
Message1='Rosies are red, vilots are blue';
Message2='Bring me some cake';
Message3='or i will eat you';
Message4='eh its too bad this dont rhyme worth a dime';
Message5='never the less i thank you for your time';//this would be much cooler
procedure hello; //if i could rhyme to
begin //save my life
wait(1000)
Writeln(message1);
wait(1000)
Writeln(message2);
wait(1000)
Writeln(message3);
wait(2000)
Writeln(message4);
wait(2000)
writeln(message5);
wait(5000)
end;


begin
repeat
hello;
until(false)
end.

:D

Womble

2007-11-27 17:32:06

very nice tut, but i'm still very unsure. :(
maybe there is hope for me yet…

V3l0ld0

2007-12-01 12:29:54

Ty much dude.
I'm guna try writing a script soon!

anderson192

2007-12-01 16:22:49

Great tut!! :) Helps alot.

SlePWalkeR

2007-12-06 12:54:24

looks too complicated for my brain :eek:

PvH

2007-12-07 02:59:05

great tutorial!
thanks a lot!

footballjds

2007-12-08 00:11:28

From: Bebe
Bitmaps:


What are Bitmaps?:
A set of bits that represents a graphic image, with each bit or group of bits corresponding to a pixel in the image.

To sum that all up, a bitmap is a image with a high quality, which makes it idle for SCAR's built in image searching functions/procedures.

How do you capture the image?
If you don't have image capturing software, you can simply use the "Prnt Scrn" button, usually located in the upper right of your keyboard.
If you only want to capture the currently selected window, then you can hit Alt + Prnt Scrn, this reduces the amount of cropping/editing you will have to do later.

Ok, now that you know how to capture an image, lets get an example to use for this tutorial, which in this case will be a willow log from RuneScape 2.
So open up RuneScape and capture an image similar to this one:

I would recommend that for the sack of following along with this tutorial you use the above image also, you may notice that it is a .png instead of a .bmp, well that is because imageshack.us automatically converts a .bmp to a .png. But none the less, it will work.

Anyway, open the Inventory image up in paint or your favorite image editing software (I chose paint because this part is very quick, and you don't need any resource intensive software like PhotoShop to do it.
Anyway, open Paint up and select one of the willow logs, like so:

And then copy or cut it onto your "clipboard", and open up a new Paint, and paste the willow log there. Now make sure the paint pallet is as small as possible, so there is no added white space to your image, as this will increases the size of your bitmap and cause more lag and memory usage, which isn't good at all.

Ok so now you should have a Paint open that looks like so:

Now it is time to make it ready for SCAR. Now a little knowledge for you…
SCAR doesn't register black in it's bitmaps, it ignores black. So lets make it happen.

You see how there is a bunch of extra space around the log, well we don't want SCAR to look for that too, so we are going to black that part out. So select your "Bucket" tool and fill the non-willow log part of the bitmap with black like so:

Now it is time to make the image smaller, yes smaller. The golden rule in bitmaps is the smaller the better. Try to balance efficiency with size. Ok, so now we are going to attempt to make the image smaller by getting as close to the edge of the willow log as possible without removing any part of it. To do this you might want to zoom into the image in Paint by hitting Ctrl+ Page Dn.

So now zoom in and use the select/cut tool to crop the image even closer. Here were my results:

Now it is time to open the bitmap in SCAR!
To do this Open up SCAR, and go to 'Tools' —> 'Picture to String…'

You should be presented with a menu resembling the following:

Now hit open, and find the saved bitmap that you have just created. Make sure the entire image is selected and hit "Ok".
You should now be presented with a whole mess of jumbled letters and numbers in your debug box, that should look similar to this:
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');

Now Lets turn this into a working bitmap finder.

To start of you have SCAR load your bitmap before it can use it, so lets create a procedure and call it "LoadBitmap", straightforward, huh?
And lets copy the bitmap from the debug box and paste it within the procedure, so select the bitmap text and hit CTRL + C (this is the keyboard shortcut for 'copy').

You should have code that look like this:
program New;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');
end;

begin
end.

Ok, now that you have the bitmap loaded, you have to declare the bitmap name as a variable, so lets do that.
In this case we will declare it as what is called a 'Global Variable'.
To do this add the command 'Var', about one to two spaces below 'Program', so that should like like this:
program New;

var

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');
end;

begin
end.

Now we have to declare our bitmap "WillowLog2" as a variable. Bitmaps are declared as integers. So lets do it…
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');
end;

begin
end.

Now that we have the bitmap declared and ready for use, lets search for it!
If you look at your list of Bitmap function, you will see
"function FindBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer): Boolean;"
And you guessed it, this is what we will use to search for the willow log in the RuneScape inventory.

This function my seem complicated, but really it is extremely easy to use. To start off, lets make a procedure to find our bitmap, so creat a new procedure and lets name it "FBitmap". So our script should look like this:
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');
end;

procedure FBitmap;
begin

end;

begin

Now let me show you how to fill out the function 'FindBitmapToleranceIn':
bitmap: Integer; - This is the name of you bitmap, in this case "WillowLog2"
var x, y: Integer; - These are the variables that will be returned for the position of the found bitmap, this is useful when you want to click the bitmap, or interact with it after it is found.
Integer; x1, y1, x2, y2: Integer; - These are the coordinates for the "box" that SCAR will search for the bitmap in. This is very useful to not only save time when searching for bitmaps (because SCAR has to search less of the selected client), but also reduces memory usage and lag. In our case, since we are searching for the willow logs in the inventory, we will be using the coordinateness 560, 214, 734, 457
tolerance: Integer - this is the amount that the color can change and still be recognized, you want as low a number as possible, so you don't have other colors interfering. I recommend a tolerance of about 20 - 30.

Ok so now that we understand the different parts of 'FindBitmapToleranceIn', lets fill it out and add it to our script. So lets add:
FindBitmapToleranceIn(WillowLog2, x, y, 560, 214, 734, 457, 25);
to our script:
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');
end;

procedure FBitmap;
var
x, y :integer;
begin
FindBitmapToleranceIn(WillowLog2, x, y, 560, 214, 734, 457, 25);
end;

begin
end.
As you might have noticed, I have added the variables 'x' and 'y' to the "Local variables", you need to do this in order for this script to compile and work. "Local Variables" work the same as Global Variables except they can't be used outside of the specified procedure/function.

Now You just add our procedure 'Fbitmap' to the mainline, and there you go, you have your very own bitmap searching script.

Congratulations! :)


could u show me how to change this so it would drop the found willow logs?:garfield:

pk ownage94

2007-12-08 17:00:09

Thanks you for a great tutorial!! Helped me a lot as I'm trying to learn SRL and SCAR at the moment :)

chewgun

2007-12-09 16:33:56

beautiful tutorial.I like the detailed pictures and examples,they're

lots of help for a beginner like me.

Very well done Bebe,thank you!:D

thakiller26

2007-12-10 00:56:45

Those helped me out alot. Are you going to make more tutorials on the reserved posts?

XoxofrogXoxo

2007-12-10 10:50:33

Thank you so much for that tut. Had little trouble at first but got through it!

All that junk at my bitmap did not come out eexactly as yours but I think it still should work. Well time to move on to a harder step. thx.

enig.ma

2007-12-12 03:02:26

Hi I need some help with loading bitmaps into integers.

I have done it exactly, but when I try to convert the integers back to the bitmap, I get "Invalid encrypted string"

Can anyone help me please?

Thanks!

imskate182

2007-12-15 16:08:01

This tut was very helpful thank you!
very easy to understand.
i think you should add something on 'mmouse' and 'mouse'
thank you

ngouterm

2007-12-16 14:48:11

Thanks This tut helped me alot

Putnam

2007-12-20 20:59:39

Nice, ive been wanting to learn how to script and read scripts and this helped!

learning scripting is like learning a new language… hard lol

ill try to learn more tomorrow

Da Grim Raper

2007-12-21 07:14:08

dude thanks for the tut!!
it really helped me out with scripting!!

haseebcash4u

2007-12-21 23:12:43

it was a decent tutorial but i would recommend the unmatched tutorial

muskfresh

2007-12-22 17:26:51

I understand the tut, but for some reason the scripting only works in the debug box. I put the crosshairs on my RS window, but the script kept running in the debug box. What am i doin wrong?

Deepseazebra

2007-12-22 23:37:39

Just like to say this is a great tutorial… I'm starting to kinda understand a bit. 5 out of 5 stars definately!

snowman frosty

2007-12-24 14:06:43

thx for the tut helped me understand alot better

EvilMikey

2007-12-24 19:38:59

luv the tutorial, understood almost everything, i just didnt get the part for what the point of making a bitmap thing does, i ran it and all it said was

Successfully compiled
Successfully executed
:confused: :confused:

Xblainex

2007-12-26 00:53:12

Thanks this guide was very helpful to me im trying to make a script to auto fletch and string for me but its a lot harder than I thought….

gorgouk

2007-12-27 11:56:15

Thanks, will help out alot.

hudhery

2007-12-29 09:00:16

Cool tutorial keep up the good work Bebe

kevin0095

2007-12-29 17:44:50

Thanks a lot. I learned a lot today :). I get the everything but the function part, i'll go back later to try to get that down more.

Kevin0095

kevin0095

2007-12-29 17:56:02

Thanks a lot. I learned a lot today :). I get the everything but the function part, i'll go back later to try to get that down more.

Kevin0095

Powerz

2007-12-31 03:39:01

Hey the tutorial is great, i love it.
But i have one problem;
I get this error:
[Runtime Error] : Exception: Access violation at address 00722806 in module 'scar.exe'. Read of address 00000000 in line 25 in script

This is my script;

program Bitmaptracker; //finds the image and goes too there with the mouse.

var
Willow: integer;

procedure LoadBitmap;
begin
Willow := BitmapFromString(38, 28, 'beNrtllFLAkEUhZ1fEEUhUR' +
'i9+FI+LFESShZGQT4oFBhCUVEgREEv/f6OnfZy9TrD7Gz75nIexNX' +
'59ty9587UaqtrdfkvN6/KcQfNtexwvZ1tdk+2Ljr1SmECGvR3rnrb' +
'UDmiCwuLD693wdIqQZwtiIeH4AJexA6MYGWwrHJiwqt0z5P268Pp+' +
'0v3btCg7PpyS+6SuN/YKA51X9Nz6n64Z6GapUUi6pBQU03UUBG/1x' +
'JiWkCE+Pl2pqEWJIJ3vOJfgynv0RIDYsFpEN1VcA78db4QdW19IMa' +
'QXQ2NblqXvWYc1DHFUAAnXSQsin9kKvNREIa6ye0RaihZJk4HhPG0' +
'60s85V3rRwpnEEQgpk8drkCcuLAsmxdb8ADx+6NPU0LEEHgcHy/MM' +
'WvKRiaSKM0pRD4AuL7I+xIaScTiJOIDDfpSGTMNYoiwpom6XQPEEt' +
'Ng1jlChMEYj0uDw2hwx4nZMuAUQkHGo2zp5An0CVT8BDL3e98c0Lu' +
'JovzDAUZ7FJuyFVZzjnILVc1B1R7VWFL4SmH9AC+vWFU=');
end;

procedure FBitmap;
var
x, y :integer;
begin
FindBitmapToleranceIn (Willow, x, y, 560, 214, 734, 457, 25);
end;

begin
FBitmap;
end.

Can anyone please tell me why i get this error, and how i should fix this?


Powerz.

Relath

2008-01-09 21:59:13

Very nice tut, I'm totally new to scar and scripting but it seems as though every script possible that has been made for runescape has been done. So with that being said, I'm not totally sure if i should continue learning about this kinda stuff. =/

bandwevil

2008-01-11 18:37:41

Thanks for the tutorial, it's great and really helped me learn about scripting. Now hopefully I can start making my own scripts!

mithdollum

2008-01-14 22:14:43

thanks for showing me how to start

mithdollum

2008-01-14 22:15:44

o by the way where do i get my srl id number?

waze

2008-01-15 20:06:39

From: mithdollum
o by the way where do i get my srl id number?


You get your SRL ID number from SRL Stats on the home page. You need to register with e-mail, your desired username, and your desired password. After you have finished, it will give you an SRLID number. There is no confirmation required.

PeaZzT

2008-01-15 21:20:52

this is g8 stuff, i have allways wanted to start scripting.

this is nice for a "newbie" –>> like my self :D

link555

2008-01-15 22:29:24

finally thank you!! this will really help me ty soo much!!!

black_hawk_down

2008-01-16 01:29:52

you know in a way this tut is like making a salad sandwich,

Begin and end represents the start and the end of the script and your lettece and cheease and mao is like the guts of the sandwich

and if you forget to add the corn beef the sandwich doesnt work and neither will the script :D

oh and btw i though this was a great tut :)

~PURESKILLA~

2008-01-24 16:32:34

ok i got it but one problem it runs and all but it types the messge in the debug box not in the rs window if u can ttell wut i did wroong plz pm me

Da R3ap3r of D00m

2008-01-30 04:22:22

Ty for explaining it!:)

Prince

2008-01-31 03:36:19

Thank you very much.

The bitmap section was very helpful, im going to use this to create a pin clicker.

facebooknega

2008-01-31 14:08:05

Good tutorial, solid read to be honest, I want to get into scripting more hands on rather than tweaking premade scripts.

looks cool with all the advances in the scripting that one can do.

Griff

2008-02-17 21:48:39

very good tutorial i learned from this, and you only lost my a couple of times in the bitmaps section

Griff

2008-02-17 21:58:48

I really don't understand bitmaps, but other than that, great script
I'm probly just handi so dont worry about bitmaps too much :D

exppo

2008-02-23 15:08:56

Thanks, helped alot to understand some of the simple things in SCAR, to be honest I felt proud to have completed my first simple scripts ;)
Thanks again!
exppo

03data

2008-02-23 17:30:19

good tut thx man was very usefull

[Dead]

2008-02-24 05:41:52

trying to learn from this, but it is a bit difficult (guessing because of the new versions). People like me trying to learn don't know all the new commands or rules there may be, for example while trying to learn this and following along i got

Line 4: Error : Unknown Identifier ' ' in script
Failed When Compiling
Line 8: Error : Unknown Identifier 'WriteIn' in script

EDIT: the Line 4 error, seemed to have gone away on its own, but the line 8 error, is still saying this, the line looks like

WriteIn(Message1);

[Dead]

2008-02-24 05:58:16

From: [Dead]
trying to learn from this, but it is a bit difficult (guessing because of the new versions). People like me trying to learn don't know all the new commands or rules there may be, for example while trying to learn this and following along i got

Line 4: Error : Unknown Identifier ' ' in script
Failed When Compiling
Line 8: Error : Unknown Identifier 'WriteIn' in script

EDIT: the Line 4 error, seemed to have gone away on its own, but the line 8 error, is still saying this, the line looks like

WriteIn(Message1);


ok, i copy and pasted Writeln from the help menu, and it successfully compiled, seems odd. i dont know if the program doesn't like my keyboard's 'I's or what.. -.-

EDIT: :D seems like its Ln after write and not In….hope this helps someone else who had the same problem as me

►help◄

2008-02-24 17:49:52

wow very nice tut i will try my hardest to do my part and contribute to this forum

Adolis

2008-02-24 17:58:17

Seems like scripting is going to take a lot of time. It really doesn't seem too complicated once you understand the basics.

Lamborgini8

2008-02-24 21:48:08

Thank you! Now I have a bitmap for my script :)

andrewrox424

2008-02-26 01:43:53

sweet thanks.

shrubie1

2008-02-26 02:17:37

jolly good tut

TommyGun

2008-02-27 07:13:46

ty for this tut help me allot when i tried to fix a problem i had with my script and couldnt find an answer anywhere, ty vm dude

mautofiedd

2008-02-27 12:39:16

Thanks bebe, this will help me alot.
although i must say im still quite clueless, haha..

coo too

2008-02-27 13:52:51

This is the first tut I've actually learned something from, no joke. It tells you everything in a way newcomers can understand. lots of rep for you.

vlad

2008-02-27 14:09:53

Thanks, I basically understood it ;). I've even started my own script, let's hope it works!

Snowflake

2008-03-09 10:32:20

Thanks very much for this Bebe! :)

I found the functions and bitmap sections especially helpful - one of the best explanations i have seen/understood.

Thanks for taking the time to put together such a helpful tutorial….:D

lyfer

2008-03-10 21:06:15

Hey great Tut =). Reminds me a little bit of using javascript in my webpage design class =o

sum41rocks

2008-03-11 21:02:11

ok so i got a script now
i got some help from some other ppl
but i can't fix this for some reason

Line 59: [Error] (225:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/Math.scar

lilmike

2008-03-13 15:26:40

OMG real nice tut! Now i understand most of the basics like what the procedure does etc

Revenge of the Jelly Baby

2008-03-13 15:45:39

thanks a lot dude

killer_game0

2008-03-13 20:26:02

Thank You. I have wanted to start programing. I took a video game design class in school. So I kinda understand some of this stuff.
Thank you again…

KG0:(h):

Blaze

2008-03-15 14:47:17

Thanks for the tut! The bitmap part was really helpful…

Putnam

2008-03-16 00:28:11

On any script i run, i get this error.
Line 59: [Error] (228:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/Math.scar
Failed when compiling

ive been tryin to fix for 5 hours straight, probably uninstalled and reinstalled scar and srl and everything like 19 times.


need major help!

codenman

2008-03-16 00:59:11

wow thnx bebe this helped alot and i actually made my first script off this thankyou so much

alartt

2008-03-16 11:22:17

That part with bitmaps are usefull, I havent used bitmaps…. FindObjEx will do most tricks for me:D

Blaze

2008-03-16 13:55:52

haha, yeah, found that out yesterday… do people still use bitmaps?

HellBoyz

2008-03-17 00:28:44

Yes most script still use bitmap even srl script too…

PvH

2008-03-20 03:10:04

awsome guide
rep+ ;)

hitfun

2008-03-24 10:54:47

Coooool very usefull tutorial!

fir3com

2008-03-26 21:47:57

I'm getting better at these tutorials. Hope I can make some sick scripts soon.

Thnx For Tutorial

thematpan

2008-04-04 22:44:01

heres my script so far..
program script;

const
message1='thematpan owns';

procedure hello;
begin
wait(2000)
WriteIn(Message1);
end;

begin
repeat
hello;
until(false)
end.

but i get this when compiling..
Failed when compiling
Line 9: [Error] (9:1): Unknown identifier 'WriteIn' in script

King of the Nites

2008-04-04 23:57:02

@ thematpan, you ate putting writein when it should be writeln. With an l and not an i.

fyi101

2008-04-05 09:28:31

Thanks for an extremely complete and informative tutorial!

thematpan

2008-04-05 18:47:21

From: king of the nites
@ thematpan, you ate putting writein when it should be writeln. With an l and not an i.


ohhh haha alright i got it :D

dark_ninja

2008-04-07 23:13:04

i think good tut but im not sure it confused the heck out of me *scratches head* and easier ones out there?

VikDAkinG

2008-04-08 13:09:26

very good guide, thanks helps me alot trying to learn scripting :)

Pu3rto0wn

2008-04-12 18:33:20

this really helped me thanks alot and nice tut

sunny

2008-04-19 00:02:06

hi your debug box isnt showing

Also "Writeln" is a typing "command", it tells SCAR to type the keys that you specify. The Text will show up in something called the "Debug" box that is this area of SCAR:

it comes up with a little box with a red "X" in it

is this just me or is everyone getting it?

*edit*

hi i was just doing your bitmap searching tut and i keep getting "[Error] (28:1): 'BEGIN' expected"

heres my scriptVVVV did i miss something?

program New;

var
willowlog2: integer;
procedure LoadBitmap;
begin
willowlog2 := BitmapFromString(31, 26, 'beNrllU9Lw0AUxJsvIP' +
'QgFIKQg3gxhCDSYigGSi2UUhowSNEiKiKFoiiI4Ld34rTPZf91Ld4' +
'Mc2g3yS+Tt/NeWq3/d0TQ8dFenrZ7ebvf3R8Une/FPyCDKdjJMB6V' +
'HahZT5IQVx6BCZ/VKAZWVYDzCB5wLyxB4IhJLOIUmFbRuR99U58+L' +
's6Wd8V8ltSTA0rjyLp6Fs7L4tBv+/66974avC1LK1zDqhew8n44yY' +
'SrfBHXNZG/bUN/4KuHvsq3MqnFZXMNN/S3cI3jd+7Y03XMBA69PJ2' +
'DJvKYBxxZOsniapwa/IhdAAk8nAzxXqZ9k0k+IqqnGUIivSB8Dcse' +
'Z9pVmhokKdGmpxo4gLCKOvNKkokSeZjqjpvwz9cL8te3TDO0ktbdK' +
'lPLvLm5Ap9X+cfzkNUQOP7iRVxd40m+BkfLS50b+DhVMyNlDyGb8N' +
'urriREgzMzVvjWhmIQERVMKjYOfrAmfrgrkxyPyJWac2wfhyHOYgu' +
'scP8oMMa+8wNhrbn2CMiBshyYORRfhHw4NysjzICPmn2CmWUJ9xnC' +
'F7L43NWq70u9I/MLrQdi9g==');
end;

procedure FBitmap;
var
x, y :integer;
begin

FindBitmapToleranceIn(willowlog2, x, y, 560, 214, 734, 457, 25);
end;

end.

phoenix79

2008-04-24 00:39:11

Vary descriptive tut. I learned a lot. The scar language reminds me of PHP.

Iceevil

2008-04-24 15:16:15

@sunny u forgot the last "begin"
program New;

var
willowlog2: integer;
procedure LoadBitmap;
begin
willowlog2 := BitmapFromString(31, 26, 'beNrllU9Lw0AUxJsvIP' +
'QgFIKQg3gxhCDSYigGSi2UUhowSNEiKiKFoiiI4Ld34rTPZf91Ld4' +
'Mc2g3yS+Tt/NeWq3/d0TQ8dFenrZ7ebvf3R8Une/FPyCDKdjJMB6V' +
'HahZT5IQVx6BCZ/VKAZWVYDzCB5wLyxB4IhJLOIUmFbRuR99U58+L' +
's6Wd8V8ltSTA0rjyLp6Fs7L4tBv+/66974avC1LK1zDqhew8n44yY' +
'SrfBHXNZG/bUN/4KuHvsq3MqnFZXMNN/S3cI3jd+7Y03XMBA69PJ2' +
'DJvKYBxxZOsniapwa/IhdAAk8nAzxXqZ9k0k+IqqnGUIivSB8Dcse' +
'Z9pVmhokKdGmpxo4gLCKOvNKkokSeZjqjpvwz9cL8te3TDO0ktbdK' +
'lPLvLm5Ap9X+cfzkNUQOP7iRVxd40m+BkfLS50b+DhVMyNlDyGb8N' +
'urriREgzMzVvjWhmIQERVMKjYOfrAmfrgrkxyPyJWac2wfhyHOYgu' +
'scP8oMMa+8wNhrbn2CMiBshyYORRfhHw4NysjzICPmn2CmWUJ9xnC' +
'F7L43NWq70u9I/MLrQdi9g==');
end;

procedure FBitmap;
var
x, y :integer;
begin

FindBitmapToleranceIn(willowlog2, x, y, 560, 214, 734, 457, 25);
end;
[B]begin[/B]

end.

P.S: good tut, but too short :O *need more*

nielskool

2008-04-25 09:03:26

nice tut mabey i wil go script again aswell

jamesrex100

2008-04-27 02:41:30

hey im pretty stupid and i get


[error] (16:1) syntax error


i really need help i wanna make scripts

Vance

2008-04-27 02:47:39

Very very nice guide, I refer to it all the time when I need to do something in a script :P

ldg1414

2008-04-29 21:14:54

Pretty good, I'm not sure I'll beable to remember the Bitmap Finding part, but I think I get the basics, I'm starting to see patterns with certain things, but theres still some confusion.

From: thematpan
heres my script so far..
but i get this when compiling..


Lol I had the same exact problem, I thought WriteLn, was WriteIn :P.

munk_bl4de

2008-05-01 19:07:32

omg, this is to hard for me, but i really wana learn how to make a script =\, any other explanation that i can understand? o.o

Alco13

2008-05-03 10:38:26

hmm this is extramly similar to pascal, im learning in collage, maybe scripting wont be so hard for me now,

nice tutor btw lovin the use of images there

warp55

2008-05-05 09:56:12

wow this really helped me alot
im starting a catherby fisher

gandulfin

2008-05-05 21:44:07

i dont know how to use my scarr pls send me a pm whit a tutorial i need this

:how to use my scar

:how i can put the revisions

:how i can usse in runescape 2

:i need a script to woodcutind willous or firemaking

:fishing or cooking

:mining

pls if any read this send em a pm



gandulfin

Icon1993

2008-05-08 08:26:17

Now I know the basic :D Thanks

opensourcev2

2008-05-09 01:40:17

TY!!! I learned sooo much

jism

2008-05-09 04:05:34

Very informative, I still have a long way to go before I attempt my first script but. What coding language is scar related to anyway ? c++ ?

Immaminor

2008-05-16 23:02:40

Getting ready to start my first script soon and you just helped me a ton.
Very nice descriptive tut. Thanks much.

Night Wraith

2008-05-17 08:27:02

i dont get it at all.. i r dumb

lennoc

2008-05-17 10:24:47

nice tut

X!X

2008-05-17 16:23:08

Thanks, I learned a lot from this tutorial :D

Very nice tutorial!

ilyadusoleil

2008-05-17 20:08:05

Thanks a lot - I just like doubled my knowledge on SCAR o_O

Harryk1

2008-05-19 21:38:21

I cant wait to see this finished I'd love to learn how to script like this it doesnt look to complicated. Hopefully I will have some time to sit down and toy with it soon

enigmatic87

2008-05-21 08:58:32

Maybe it is better to get a course in Basic Pascal or Delphi for the ones who never got in contact with scripting and programming.

iamaguy

2008-05-21 17:12:15

gracias mi amiga!

gore

2008-05-23 03:25:38

best tut i have read it has explained so much thanks heaps mate :)

xykron

2008-05-24 05:16:13

thnx for the tut. i think im going to make my first script soon ^_^

bennyty

2008-05-27 21:16:37

From: jism
Very informative, I still have a long way to go before I attempt my first script but. What coding language is scar related to anyway ? c++ ?


SCAR is related to Pascal:D

I Think…

angel77gal

2008-05-29 23:29:47

Thanks for the great detail. This will really help.:)

shrubie1

2008-05-30 04:25:31

just added a bitmap to my powercutter. ^.^

halohalo

2008-06-01 19:05:24

Wow, Really helpful! i hope to make my own scripts someday.

k1ng duffy

2008-06-02 01:17:03

Very informative. I have learned alot from this. I am new to scripting

patman16

2008-06-03 17:40:12

thanks a bunch, hopefully I'll be able to start scripting soon

MysticEvil

2008-06-09 02:19:13

Awesome guide. I just started scripting yesterday and after reading this guide it feels like ive knwn about it longer. Good information and pics explaining what to do and were

bigg1234

2008-06-09 16:58:58

i dont get it my script says unexpected end any help:confused:

Suhaib42

2008-06-11 04:24:11

um what do you mean by "Now that we have the bitmap declared and ready for use, lets search for it!
If you look at your list of Bitmap function, you will see
"function FindBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer): Boolean;"
And you guessed it, this is what we will use to search for the willow log in the RuneScape inventory.

This function my seem complicated, but really it is extremely easy to use. To start off, lets make a procedure to find our bitmap, so creat a new procedure and lets name it "FBitmap". So our script should look like this:

ScarScript: By Drunkenoldma
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');
end;

procedure FBitmap;
begin

end;

begin
Now let me show you how to fill out the function 'FindBitmapToleranceIn':
bitmap: Integer; - This is the name of you bitmap, in this case "WillowLog2"
var x, y: Integer; - These are the variables that will be returned for the position of the found bitmap, this is useful when you want to click the bitmap, or interact with it after it is found.
Integer; x1, y1, x2, y2: Integer; - These are the coordinates for the "box" that SCAR will search for the bitmap in. This is very useful to not only save time when searching for bitmaps (because SCAR has to search less of the selected client), but also reduces memory usage and lag. In our case, since we are searching for the willow logs in the inventory, we will be using the coordinateness 560, 214, 734, 457
tolerance: Integer - this is the amount that the color can change and still be recognized, you want as low a number as possible, so you don't have other colors interfering. I recommend a tolerance of about 20 - 30.

Ok so now that we understand the different parts of 'FindBitmapToleranceIn', lets fill it out and add it to our script. So lets add:

Code:
FindBitmapToleranceIn(WillowLog2, x, y, 560, 214, 734, 457, 25);to our script:

ScarScript: By Drunkenoldma
program New;

var
WillowLog2: integer;

procedure LoadBitmap;
begin
WillowLog2 := BitmapFromString(32, 26, 'z78DAD5975B7684200C' +
'86B7444888CEA33ABAFF25951AA627168378998EC573FE27D42F2' +
'1379CFBC882A2DE732542DF7B76233A3F0060832EEA800C813C76' +
'D0DED20A48B439734F043D314ED08AFEEC8FCF9F9CF5860AADF83' +
'638E2482BCC865ECA0FC933F3DFC56349C587995765A7BC25B4F5' +
'7AA9FF21F4819098C2800F6ED961175A9ABC0B443D3C175A66CBF' +
'71BEF8AFF71C2CED3E92C80E8E40E9B86B827DF00B738EDE02F33' +
'1B5FD0B970FA1440932FF82D2B72D5FBCBAAACD0E4D7F273CF1E0' +
'7D38A7A5AAD43C0D7772ECDDF3AFE32D509FF1F8AFF45DDCBF993' +
'1523338E8930D763A720FE972AE7FD38E7D1C30FD55680EE20A22' +
'BFE7F07F9AC8BBFEB8EA072D9B225DAFEF4A3549BBC9BAC647191' +
'594F02BA17588466D5CAE24A6747CE2F9CE2E114E7EACB9A7CC19' +
'6EB315AAB0218FC3ABB13FFA37114B415BFFEF57D46732F2B777F' +
'93B6DC172AF2DAE48F7D1E5DC3FC245A74AB8C3F5927A7B3B7431' +
'DEB1135FCF39CB012E72FFE5807AC5AB492055791D7F38F819157' +
'EA4C917F518BEAF92FEA6B9A5F2A8F4C68BA4FA5994D45CE29FEB' +
'D75554DA452D38A7D19D29CA9A74DF1BF64473DFF89B962E31EB1' +
'3D1199EFEE88FFB22DB3D6105A5A5EC6FE743ADA8AD4292AA2682' +
'FE7FBEEB035F1534FFBA99B784E7E63DAAAF5BF68EFC6FC059600' +
'F4EC');
end;

procedure FBitmap;
var
x, y :integer;
begin
FindBitmapToleranceIn(WillowLog2, x, y, 560, 214, 734, 457, 25);
end;

begin
end.
As you might have noticed, I have added the variables 'x' and 'y' to the "Local variables", you need to do this in order for this script to compile and work. "Local Variables" work the same as Global Variables except they can't be used outside of the specified procedure/function.

Now You just add our procedure 'Fbitmap' to the mainline, and there you go, you have your very own bitmap searching script.

Congratulations!"





cuz didn't get srry

V Macro V

2008-06-11 21:06:26

thx for the guide it really helped me

glad to be apart of this great community

Ghostman

2008-07-04 02:56:53

Nice, Just may make a script

Joshseow

2008-07-05 10:18:15

Just asking… But how long did you take to master scripting in Scar?

Lee Lok Hin

2008-07-08 08:17:39

Piotr2000. Spamming is not going to help your chances, and I don't think XFire is used much. Go in the srl IRC, or give your Msn.

Chemonk

2008-07-08 08:39:16

A quintuple post, nice. Because that totally doesn't scream, "I'm spamming so I can leech the Junior Member scripts!"

Rizzelet

2008-07-15 05:24:47

Thanks for the tutorial, I found it extremely helpful.

A really good place for beginners like me to start out.

I do have one question though. In the last section of the functions part of the tutorial you insert two +'s when using the function MilesToKilometers. I was just curious what those +'s were for.

goldenechoe2

2008-07-17 10:23:51

:bart: Your tutorial helped but i still don't know how to make a script so i auto. anyone wanna help me? this is my first time.:bart:

Crozling

2008-07-18 06:14:21

very useful thanks i have some coding experience but i still found it very useful.

triumphost1

2008-07-18 15:30:15

Can someone help me, I cant figure out how to mask a bitmap or make it detect teh shape and size of an object rather than the colour…

toxicpie

2008-07-23 02:01:12

Awsome tut really helpful

bballer

2008-07-24 17:10:51

This helps me a lot, thanks. Part 1 of my willow dropper is complete.

brent8900

2008-07-25 00:45:55

nice script but would you add how to add the bitmap to the main loop please.

P.S. thank you for this script i needed it i had know idea how to use scar just ow to run it till this tutorial thank you.

link555

2008-07-27 03:16:40

looks like a nice tut but i dont know how to script and im trying to learn and i read the whole thing and WOW right over my head… if u could train me through like MSN or something if you arnt busy PM me if you can Thanks

Smarter Child

2008-07-27 18:26:03

this really helps but this is a searching scripts im thinking of making a script for something that is getting a little rarer nowadays like ess miners and bankers and thanks this help its the basic ruling nice TuT

lordsaturn

2008-07-27 21:42:16

From: leather cock
this really helps but this is a searching scripts im thinking of making a script for something that is getting a little rarer nowadays like ess miners and bankers and thanks this help its the basic ruling nice TuT



What the hell is that?

Bebe

2008-07-30 14:06:49

Small updates to the tutorial. Enjoy.

Scaper

2008-07-30 14:16:36

wohoo bebe back she updated the tut nioce 1

deadman2

2008-08-02 13:59:28

This helped me out a ton. thanks for posting it. it gave me a basic understanding of scar script. now to learn some other things….

livewrong811

2008-08-03 08:28:51

Great tutorial, now I understand the variables and stuff, and I can fix some old scripts. xD

Argentinian

2008-08-04 21:26:24

Thank you very much for the tutorial, I hope to start wtriting my own scripts soon. I like pascal.

Enchanted

2008-08-07 05:08:16

Hey Bebe! I just want to say this tutorial is really good for beginners like me. - Now i have my own little auto talker and a program that finds the start menu and clicks and it, All thanks to bitmaps. :). The only one i didn't read to much in detail was functions but i will some other time, anyways just a big thank you!


EDIT: Now that i have knowledge of bitmaps i am planning on making my first script. :). I'm not going to tell you what it will be because that will give the game away. :p. All i can say is it will involve "Picking". :rolleyes:.

heliumbox

2008-08-08 13:19:30

Thank you this helped me to understand these basics a little more :spot:

jarbados

2008-08-10 05:58:44

very good tut thx m8

Janziz

2008-08-12 07:37:24

Great tutorial! Helped me a lot.
OFFTOPIC - Most of the beginners tutorials are great but it would be perfect if the examples were a bit more practical, like including setupSRL (it took me few hours to find that out :) ) procedure and for example when finding the right bitmap then actually click on it instead of writeln('bitmap_found').

Still thank you a lot, great stuff!

xgrimangel

2008-08-13 14:12:24

Nice tut i learned about the bitmap and function thanks to you

Pyjama_Llama

2008-08-14 03:46:48

Thank you for this tut it helped me very much and like a few other tuts i have read it actually explains each step.
thank you again

AzulDrake

2008-08-21 01:22:01

Hiya Bebe,

I'd just like to add my thanx to the thousands of other scripters in this post. This helped me alot, seeing that I'm only just started with SCAR.

Of all the beginner's tuts, I'm glad I chosse yours to start with :)

rbk_nightmare77

2008-08-21 21:33:39

thank you for helping me learn the basics of scripting

atomnooblet

2008-08-22 00:23:35

Excellent tut!

I particularly like the integration of the bitmap part…didn't find anything like that on other beginner tuts.:bart:

Pure Jenno

2008-08-22 01:59:01

Very nicely written tut, every step is very detailed and easy to follow.
This is a great tut for people that've just started learning the basics of scripting.
I especially like the part about Bitmaps, most beginner tut's don't explain anything about Bitmaps, but you've dedicated a whole post to them!
+rep and 5/5 from me ;)

Awkwardsaw

2008-08-24 10:23:21

program New;

const
Diameter = 3;

function GetCircumfrence(diameter:integer):extended;
var
pi: extended;
begin
result:= Diameter * pi;
end;

procedure TellCircumfrence;
begin
writeln('the circumfrence is: '+floattostr(GetCircumfrence(1.0)));
end;



begin
TellCircumfrence;
end.

i based that off of your miles to kilometers example, and i either keep getting a type mismatch, or it dosnt calculate

GhostofReality

2008-08-28 20:38:28

Great Tutorial! hoping to be making my own (decent) scripts soon :)

I do wish someone had told me about…

Write*Lowercase L*n
(Writeln)

…earlier had me confused for a good while :P

CallOfVideos

2008-09-02 14:36:19

thanks alot man. very helpfull

Accure

2008-09-04 11:14:46

Awsome tutorial. this has helped me alot!

Rct33

2008-09-04 12:33:59

I like the tutorial shame though, I just can't understand scar at all.

NCDS

2008-09-04 21:12:36

really really nice tut. by far one of the most helpful ive read.

NeoXeo

2008-09-05 10:21:29

Yayy Now I can bot :] Great guide.

elobire

2008-09-11 11:02:01

i got this message when i tried your bitmap tutorial

Line 9: [Error] (9:1): Identifier expected in script
————————————————
program New;

var
rs_bag: integer;
procedure loadbitmap;
begin;
rs_bag := BitmapFromString(1, 1, 'beNpjYGAAAAADAAE=');

procedure FBitmap;
var
begin;
FindBitmapToleranceIn(rs_bag, x, y, 560, 214, 734, 457, 25);
end;



begin
end.
—————————————
thats my script is there anything rong with it???

thematpan

2008-09-15 21:34:51

Thanks for the tutorial, heres my script so far, even though its pretty much the exact same as u posted on ur first page, but if I were to make this a firemaker, would i have to get bitmap for tinderbox as well?

program TheMatpansFirstScript;

var
WillowLog: integer;

procedure LoadBitmat;
begin
WillowLog := BitmapFromString(27, 23, 'beNrtlbFrg0AUxp/FgkO' +
'Ho9hyMZR2y9KpZMhg6Gu4EAMOZshQumgKxUCgpf//0Hd5yeuhQTQ4' +
'lR4fgnr+/N77vBPgf7Qb3l79jMeRAlCXcN3dQFUY6NQMRV2A6sa/V' +
'RCqQNkjhIg6S+5ctQd+b19Ir9nDOr0nCYFPRRY4Vm06KUBhsvgKa4' +
'XQ1eHnxzM/SHJRfBERZqBbZsFA16eIW7fAiIqdPIXqwp/jqKFqmmk' +
'wQrTMvPDY3kBZ4ZWmXOxdX1uBntuZYI/BaaubtwmVWRYx2UC0Ecxi' +
'LaJ3kTfEgRsQN5lO6UV14FeJZKzM98AEUhwbExkzFLkoaWwDcPc+J' +
'eBuM6UJeXKIZonVrCtxNwC3RSxACaUOrMe0OEU7tHEJVDJVSt12gV' +
'SgWyl/NqbD0vv9eLJjr5h5XHHn7DOuwwR72a88dtjr1uf9zZ/DD0d' +
'EmVY=');
end;

procedure FBitmap;
var
x,y :interger;
being
FindBitmapToleranceIn(WillowLog, x, y, 560, 214, 734, 457, 25);
end;

begin
end.

cookiedude1

2008-09-21 15:32:17

thanks, really helped me learn the basics:) :)

shatok

2008-09-26 07:54:12

thanks, didnt know most of the stuff u explainded

thank u

killerking 9

2008-09-27 19:18:03

hey where can i download common sense???? lol j/k man. this is a FANTASTIC tutorial for begginers. i had no clue what a bitmap was before this but now i do :D thanks man!

William

2008-09-27 20:37:13

great tutorial thank you so much

haseotod

2008-09-30 13:20:40

thanks for the great tut on the basics :D although i am having some trouble with the bitmap part but ive already posted in help section =/
http://www.villavu.com/forum/showthread.php?t=36023?p=473062#post473062

gl3nni

2008-10-06 20:03:00

Uhh, any way better to explain? :P

Im 14

gandalf3451

2008-10-09 02:53:19

Thx alot for the tut!

chaotikhell

2008-10-09 23:40:56

tyvm for tutorial!!! i read the first part so far and it is really good for a beginner like me!

autrefois

2008-10-09 23:55:38

Thanks, helped a lot. I now wished I took AP compsci, I would understand a lot of this language.

1337w33d

2008-10-11 18:20:15

Wow, very organized and easy to learn. Thanks for this tut, introducing me into SCAR.

lowell

2008-10-14 07:04:58

This tut helped me a lot, thanks!

Cstrike

2008-10-14 18:56:15

The image part was the best.

I had such a pain in the ass learning how to convert a bitmap to an image. Sad really, since it is so easy now. Of course to the outsider it looks hard, but with this piece I can now create an epic script.

crunkjmp007

2008-10-16 15:03:53

Great tutorial dude but I tried to do what you stated and for some reason i keep getting a line 6 [error]: Semicolon (';') expected in script its there but still wont compile.
maybe the mistake is obvious but i'm not seeing it

crunkjmp007

2008-10-16 15:26:24

Woo hoo I noticed my error the space created was effecting the semicolon, my first script works awesome, thanks. Hopefully I'll become better and be able to make some pretty intricate scripts and hopefully I will figure out the bitmaps.

crunkjmp007

2008-10-16 15:48:15

wow, im stupid just noticed all i had to do was click paste in paint screen… no problems anymore.

theo

2008-10-25 06:39:05

Great tut helped me on bitmaps and making my first script but…functions…you picked the worst example for me <.>

jondyr

2008-10-25 09:20:56

Thank you! that helped me alot!

aernout5

2008-10-26 07:27:02

can someone sell me how to get coords?
or where the dipper is on scar?

flaminhaz

2008-10-31 09:57:10

thanks great tut not sure i will be making amazing scripts yet but i didnt understand how you managed to get the coords in this bit
Integer; x1, y1, x2, y2: Integer; - These are the coordinates for the "box" that SCAR will search for the bitmap in. This is very useful to not only save time when searching for bitmaps (because SCAR has to search less of the selected client), but also reduces memory usage and lag. In our case, since we are searching for the willow logs in the inventory, we will be using the coordinateness 560, 214, 734, 457

godspower55

2008-11-01 11:21:48

tyvm this helped me so much in scripting

killerkorndog

2008-11-01 21:14:37

Thx

Tickyy

2008-11-05 08:08:46

Well, I will give it a try Later, Just don't have an idea what to make >.>

Btw, Hot tut bebe :D.

Skullfire987

2008-11-08 10:23:02

I have to say a huge thanks towards you, Bebe, looks like a giant and great tut. Still reading tho.

give an edit with a 10/10 prolly ina bit ty

The Platinum

2008-11-09 17:37:47

Great job, and a huge thanks to you. It's really hard to go around and try to find all of this information separately, and it's so nice and handy to have in one place.

EliteHacker

2008-11-09 22:05:39

OMG! Awesome Tutorial, there is soo much info i am going to have to go over it lots of times. Its very well explained and easy to understand. Good job :)

\±/EliteHacker\±/

LITTLEDUDE123131

2008-11-10 02:18:11

wow thanks man
im pretty new on here..or completly new, hope the tut helps me out in learning how to do this stuff, lol its got that overwhelmingly hard look to it…haha but one day , one day i might just get the hang of it, and it will be due to some of your help

kakka

2008-12-01 00:05:58

im finally learning something.

kakka

2008-12-01 00:08:07

i finally learned something

staffa

2008-12-05 05:13:12

Thanks for the tut. And would it be possible for the first part were you make a message script for it to work on something like notepad? Thanks

J4Ck

2008-12-09 22:45:46

That was very helpful.

Fayasmm

2008-12-10 05:46:36

Great one, learned alot.

Fayasmm.

Exuvium

2008-12-10 19:56:58

Thx for the help. First time reading this kinda stuff and it was kinda challenging. I dont know if i'll be able to do this in the long run. Cant wait till I git my runescape character unlocked the mess with the game. lol:stirthepot:

crazy_crabko

2008-12-11 10:58:34

thank you so much bebe best begginers tut ive read i liked the way u explained stuff thanks! :eek:

Draeg

2008-12-17 04:52:40

Awesome Tut, Thx! :D

designed by

2008-12-20 19:12:18

Thanks so much for this turtorial it is much easier to understand than the others. Another one with more advanced techniques would be greatly appreciated.

phoenixlament

2008-12-22 08:24:34

thanks for clearing me up on a lot of things. Your descriptions are concise and clear.

thumbs up :)

Unreal

2008-12-24 05:51:29

Tyvms!!!!!!!!!!!^.^

anandacote

2008-12-26 02:41:29

''CONGRATULATIONS! You have just made your very first script!''

Sweet!!! It actually works!! Its a good start but still have a lot to learn…So I'm going back to the classroom. :D

stencil

2008-12-26 12:57:11

nice tutotial bebe, tyvm.

ps: im really exited right now.

wabakoo420

2009-01-04 14:00:09

sweet tutorial

Phran6

2009-01-06 20:40:46

i have a question how we find coordinat for coordinate box

mormonman

2009-01-06 22:59:38

what do you mean? explain a little more.

omgwtfbbqlol

2009-01-07 18:35:36

thanks so much this guide is so descriptive


Edit: Rep++

joeyg37

2009-01-09 13:25:00

thanks or the tut came in handy

TheGreatBeast

2009-01-09 15:16:47

This might be the best tut ever made! So easy to understand! Now, it's time to move over to some more advanced stuff :cool:

SantaPker

2009-01-19 16:14:08

Very nice! I am sure im going to use this when i make my first script *Im hoping that's going to be in a month lol im not a fast learner* :)

Fosscape

2009-01-19 20:50:13

Thanks for that.

This si an awesome tut. Keep it up

vanaelajas

2009-01-21 13:16:36

Wow, thats a great guide.
I'll use it .

gamer0n1

2009-01-24 21:02:04

Okay so here is what i have entered into Scar
program script;

const
Message1='Hello world!';

procedure hello;
begin
Writeln(Message1);




End.

And here is the error message
Failed when compiling
Line 13: [Error] (13:4): Semicolon (';') expected in script
\
whats wrong?

r3dr4g0n

2009-01-24 22:02:40

program script;

const
Message1='Hello world!';

procedure hello;
begin
Writeln(Message1);
end;



Begin
hello;
End.

Fixed (I think)

spec2342

2009-01-27 05:17:35

thanks for the tutorial. i've learnt a few things off it and i find it less complex than the other ones. seems like it would take alot of time to learn the new language to be able to make whole scripts without resorting to tutorials, i'll try to stick in it and give something back to the community

cheese66

2009-01-27 18:40:55

dude u are a god now i wont have to look for any auto typers because i made one":eek: :google: :f: and btw im 12 years old lol really easy to understand:google: :fiery:

Q Golden Q

2009-02-01 17:42:45

Nice tut! Helped me a lot :)

Jmcver

2009-02-01 22:04:02

hey this is a wonderful tut it helps me understand a lot. i have a question though, what does the "bitmap" stuff do?

Maninpink5

2009-02-04 01:05:59

Im new to scripting myself. Thanks for the descriptive tut. Helped alot. Haven't made a useful script yet, though working on it. It's alot to take in.

thedetro125

2009-02-07 11:32:45

Thank you for putting the time into writing this guide. I tried reading other guides, until i was suggested this guide on IRC. It's made everything simple for me, and gotten me very excited about programing.

~thed

norbiux

2009-02-10 15:22:47

thx wery helpfull

radius50

2009-02-16 13:14:08

thanks this was very helpful to me

Sabzi

2009-02-21 12:57:27

5 stars! this is what I just searched for now I can start making scripts

1jonnny

2009-02-21 15:47:46

Hi!

im verry new on this i wanna use a script who auto mine/bank but i don't know how, can anyone plz tell me?

savyrulez

2009-02-23 16:41:47

Great tut!!! Really helped me understand the basics of scar and scripting =D.

andyk

2009-02-25 02:44:06

nice guide, love it.. its actually in a language i can understand…

Semtex

2009-02-28 08:46:24

One of the best guides for scar i read so far, you explain specificly step by step what to do and why you are doing that:). i learned alot from it. Thanks for it. Awsome guide

The Reeper

2009-03-04 04:00:03

Curious, you say that scar doesn't recognize black in its bitmaps, but could you use the magic eraser from photoshop to cut out the background color completely?

ian.

2009-03-04 04:08:23

bitmaps aren't that great tbh.. they are big bulky and slow.. ;) try DTMs.. depending on what you're finding

The Reeper

2009-03-04 05:42:25

Oh okay.
But still, would the magic eraser do the trick? Or would it give the EXACT SAME results, rendering it useless to take the extra time to do so?

SonicStrike

2009-03-08 03:33:58

Wow! Great Guide!

With it, I made my first script ever, that works! (I'm so proud):

program Alcher;

procedure Clicks;
begin
ClickMouse(576, 267, true);
wait(500+random(166));
ClickMouse(576, 267, true);
wait(3000+random(1000));
end;

begin
repeat
clicks;
until(false)
end.

but someone pointed out not to use ClickMouse "EVER" so I'll change that later.

uwish30

2009-03-09 16:27:12

wow, this really helped me out as a starter. thanks

Sophos

2009-03-11 22:51:34

Finally!
Somone who can explain things…
+Rep :)
thank you so much
be expecting a good script with your name as a Thanks!

elmotheskaat

2009-03-12 08:10:06

Great tut if your just starting =) (which I am)
Makes learning enjoyable =P

lychees

2009-03-29 06:19:09

gonna start now on my first script tanks to this tut

Clishem

2009-04-07 12:38:22

I'm going to try and make an SRL script.
Thanks very much for this and will be reading this over and over for a while :)

skvatboy

2009-05-14 12:27:26

NICE thx

LolL

2009-06-09 03:20:53

Sweet tutorial. :) Got me going with the weird SCAR syntax (from a java point of view, it looks like CraCkHeads.NET).

Babilo

2009-06-10 15:29:56

Nice tutorial, gonna help me much for later!

Caotom

2009-07-14 07:45:56

Thanks heaps for the guide, it's great. The section on Functions helped me the most as I originally started by reading WhoCares357's guide which did not cover that. I did see one thing (most likely because the thread is 2 years old :eek:) and that was:

Bebe
Originally posted by Bebe
const
Message1='Hello world!';

procedure Hello;
begin
[COLOR="Red"]wait(1000)[/COLOR]
Writeln(Message1);
end;


begin
repeat
hello;
until(false)
end.


According to Bam Bam's Official Standards (http://www.villavu.com/forum/showthread.php?t=3293)
Use semicolons at the end of the lines where appropriate. SCAR allows lines without semicolons but you should use them everywhere, except after var, begin, then, else repeat, do and before else.

As well as is WhoCares357's guide:
program NewExample;

procedure Stay;
begin
Wait(500);
end;

begin
Stay;
end.

Shouldn't Wait(XXX) have a ; ?

Sorry for the long-dragged out explanation of the problem :redface:
But otherwise a great guide, thanks!

~Caotom

Avenged7Fold

2009-08-05 06:10:17

read it for like a hour and did it several times, not to bad.
NICE GUIDE! + REP

Han

2009-08-06 16:59:03

Nice Tut! Detailed and not so hard..
I'm always messed up with these basic things, and thanks! It helps me a lot..

payton

2009-08-11 10:18:41

Thanks for the tut…i found i very easy to follow even with the few missing pictures…anyone els not seeing all the pics?

THANKS,
Payton

Hairy Pomegranate

2009-09-03 05:47:33

thanks for the tutorial. it will help me get used to scar syntax and some of the basic procedures :D

edtor

2009-09-12 07:45:48

Thanks for this useful tuto, this will helps me a lot to start my way to scrptin :)

chook

2009-12-01 12:21:32

I completed the tutorial, but still need to know a few things.. any other tutorials that will fill me in?

YoHoJo

2009-12-01 12:23:56

From: chook
I completed the tutorial, but still need to know a few things.. any other tutorials that will fill me in?


http://www.villavu.com/forum/forumdisplay.php?f=95
Beginners Tutorial Section, you'll find lots more in there, we also have Intermediate and Advanced tutorial sections too! Good Luck!

chook

2009-12-01 13:15:14

From: YoHoJo
http://www.villavu.com/forum/forumdisplay.php?f=95
Beginners Tutorial Section, you'll find lots more in there, we also have Intermediate and Advanced tutorial sections too! Good Luck!


Great thanks will get to reading.

CptTerrell

2009-12-10 11:21:10

Thanks for taking the time to write this helpful tutorial. I look forward to expanding my knowledge in creating my own scar script. Soon I will achieve my goal in making my own fisher :). Once again thanks for the tutorial I knew nothing about SCAR and this helped quite a bit

Cigue

2009-12-10 13:11:37

Ayyy good job Bebe :D

Bebe

2009-12-10 20:01:45

Thank you everybody. I'm in process of updating and releasing a fresh version of this tutorial. Completely rewritten with a lot more detailed content + pictures :)

Death-Magnetic

2009-12-20 10:33:48

Good tutorial, Bebe!

fanboy

2009-12-26 21:57:11

thank you so much this tut helped me out a lot!

Pompey

2010-02-17 18:39:59

Very good tutorial, just started to learn scar again, helped alot. Thank you. :)

Matsetst

2010-03-10 05:21:30

@Bitmaps you said

So now zoom in and use the select/cut tool to crop the image even closer. Here were my results:


I don't see your results ? Or was the result the willog log you posted above ?

this guide is awesome. :p

I dont understand the part about how to find FindBitmapToleranceIn.

I used an Iron ore as Loadbitmap but I dont know the coordinates. How to get the X and the Y coordinates ?

twobac

2010-03-18 20:51:40

From: Bebe
Thank you everybody. I'm in process of updating and releasing a fresh version of this tutorial. Completely rewritten with a lot more detailed content + pictures :)


Looking forward to it, this was great reading, but I still had issues with the execution of the code, e.g. Bitmaps, complies ok when run
[php][Runtime Error] : Exception: Access violation at address 006BE3E0 in module 'scar.exe'[/php]

Going to do some searching to try to find why this is happening?

:)

Bionicle

2010-03-18 22:06:34

From: twobac
Looking forward to it, this was great reading, but I still had issues with the execution of the code, e.g. Bitmaps, complies ok when run
[php][Runtime Error] : Exception: Access violation at address 006BE3E0 in module 'scar.exe'[/php]

Going to do some searching to try to find why this is happening?

:)


What version is your SCAR?
You should have 3.23

bion92

2010-05-19 14:28:34

This was very helpful!! I didn't know where to search but this was simply the best

magernub573

2010-09-05 21:06:02

he bebe, thank SO much for this tut! helped me get the basics down. However, i do have one question. for the function part, when we are doing a unit converter, i am a bit confused. If the input variable (miles) times 1.609 equals the output variable (kilometers), in the WriteLn it says "('1 mile is equal to '+floattostr(MilesToKilometers(1.0))+' kilometers');" if we want to change the input var it will still come out as "1 mile is equal" instead of the right amount. do you know how to write it so that it matches up with the variables? or am i going about this the wrong way? how do we write the input variables into the script? Also, what is the (1.0) for in the '+floattostr(MilesToKilometers(1.0))+' kilometers');

thanks again!

Yush Dragon

2011-01-11 11:23:53

Nice beginning tutorial, i understanded everything what's in there :D (first time i understand something … :P)

rep+

Dgby714

2011-01-11 11:27:36

From: Yush Dragon
Nice beginning tutorial, i understanded everything what's in there :D (first time i understand something … :P)

rep+


Unless you want to use SCAR, you should read Coh3n's Simba tut.

Bebe

2011-01-11 12:21:53

From: Dgby714
Unless you want to use SCAR, you should read Coh3n's Simba tut.


Same concept really, not much is different. But I should update this

Dgby714

2011-01-11 12:37:45

From: Bebe
Same concept really, not much is different. But I should update this


Yes there almost identical except Coh3n's tut also includes a bit about extensions.

RuNnNy

2012-01-07 10:50:17

Very helpful tutorial.
Thanks!

RuNnNy

2012-01-09 18:12:26

I can't get the Bitmaps part to work, Is it possible that it is outdated or something?

btraill

2012-01-14 21:22:18

Very nice! Thank you.

'Toxin

2012-01-18 12:21:03

From: RuNnNy
I can't get the Bitmaps part to work, Is it possible that it is outdated or something?


The only thing that may be outdated is the physical portion of the bitmap naming/functionality of the function. Try searching for the function in Simba to see if it matches.

fearlesskiller

2012-01-18 16:27:59

thanks for the guide :)

10wnu9

2012-01-19 18:21:01

GREAT BUT I AM ABOUT TO SMASH MY COMPUTER, IT TAKES TOOOOOO LONG TO MAKE A SCRIPT!!!!!!! I need to fucking smash my head of a wall :duh:!!

I suck.

data007

2012-01-22 06:02:16

Thank you for the tutorials, it was a great read.

joehartwig

2012-01-26 12:47:36

do i have to use scar or can i do it in simba

unteenager

2012-01-27 10:12:09

thanks helped alot =)

Sassakill

2012-01-28 16:22:29

Hm, URL for Scar Divi needs to be fixed: http://freddy1990.com/scar.php –> http://www.scar-divi.com/

tallmantreee

2012-02-01 22:05:29

Great tut i got it to work and thats shocking for me because i dont know any coding but this tut made it an easy concept to grasp now making one that actually runs haha thats a differnt story

snowshoes

2012-02-06 16:55:39

Thank you, this tutorial was very detailed and easy to understand. I have a little experience with this stuff from a robotics class I took in 11th grade, but that's been a long time ago and is kinda useless to me now.

Keep up the great work!

Love and light,

Bebe

2012-02-06 21:28:49

I appreciate that I could help so many people on their path towards learning to use/script with SCAR but I have sadly not been able to keep updated with the current trends withing the SRL community.

Thier has been a fundimental shift towards a new macro Simba. I implore everybody to have a look at Coh3n's THE Beginner's Simba Tutorial as he has been able to provide a more current `All In One`.

Thank you for the support.