WhiteShadow
2006-05-14 04:14:19
Bitmaps Tut By White
In this tutorial you will learn about bitmaps. It is fairly simple. You should have some knowledge of scripting before reading this though.
First Off
You have to declare your Bitmap! So Scar can store your Bitmap in a variable.
You can make it a global variable or local variable depending on your script.
Example:
//Global, this bitmap can be reached from anywhere in your script.
//Local, only this procedure or function can reach this bitmap.
2nd Off //You should do this with me to learn it maximunly.
Getting your bitmap.
1)Login to Runescape and find something distinct.
2)Press PrtSc, Print Screen whatever it may be on your board.
3)Open Paint Program - Press Ctrl + v
4)Now do this :

After you crop something, right click and click cut.
Then do File > New + Ctrl + v
Change the background black, bitmaps are found more easily when the background is black. Save it.
How to change bg black:

Yea so Click the bucket select black in bottom and click the background.
3rd off
A picture into something that can be stored??How?? I'll teach ya.

Script > Picture to string Click those. Then Click Open > Find your pic > Click Ok.
You will see code in the bottom of SCAR now, aka the "debug"
Like this :

copy all of that and paste it.
//Global Example
if you want a global one then you have to do that^ then load it. You load it simply by calling that procedure in your mainloop ot setup procedure.
//local example since this bitmap is only reached in this procedure you will be using the FindBitmap function right in here.
Some different FindBitmap functions


The difference is that thesecond one finds the Bitmap in a boxed area.
Example:
that would be a local example since the variable is right in the procedure.
a global one would just be that you don't have to declare any variables since its already global.
More Examples
Possible Errors?
Oop you didn't declare variable right.
Well that's it I guess. Post anything relative to this.
~WhiteShadow
In this tutorial you will learn about bitmaps. It is fairly simple. You should have some knowledge of scripting before reading this though.
First Off
You have to declare your Bitmap! So Scar can store your Bitmap in a variable.
You can make it a global variable or local variable depending on your script.
Example:
//Global, this bitmap can be reached from anywhere in your script.
program New;
{.include SRL/SRL.Scar}
var
BmpNam : Integer;//Change BmpNam to what you want//Local, only this procedure or function can reach this bitmap.
procedure BmpTut;
var
BmpNam : Integer;//Change BmpNam to what you want2nd Off //You should do this with me to learn it maximunly.
Getting your bitmap.
1)Login to Runescape and find something distinct.
2)Press PrtSc, Print Screen whatever it may be on your board.
3)Open Paint Program - Press Ctrl + v
4)Now do this :

After you crop something, right click and click cut.
Then do File > New + Ctrl + v
Change the background black, bitmaps are found more easily when the background is black. Save it.
How to change bg black:

Yea so Click the bucket select black in bottom and click the background.
3rd off
A picture into something that can be stored??How?? I'll teach ya.

Script > Picture to string Click those. Then Click Open > Find your pic > Click Ok.
You will see code in the bottom of SCAR now, aka the "debug"
Like this :

copy all of that and paste it.
//Global Example
procedure LoadBmps;
begin
//Paste all code here
end;if you want a global one then you have to do that^ then load it. You load it simply by calling that procedure in your mainloop ot setup procedure.
//local example since this bitmap is only reached in this procedure you will be using the FindBitmap function right in here.
Some different FindBitmap functions


The difference is that thesecond one finds the Bitmap in a boxed area.
Example:
procedure LoadBmps;
var
BMpName : Integer;
begin
//Paste All Code Here.
if(FindBitmap(x, y, BmpName))then
begin
Mouse(x, y, 1, 1, true);//Moves Mouse and clicks it
end;
end;
that would be a local example since the variable is right in the procedure.
a global one would just be that you don't have to declare any variables since its already global.
More Examples
procedure ClickMimiMap;
begin
if(FindBitMapIn(BmpName, x, y, 5, 5, 515, 340))then
begin
Mouse(x, y, 1, 1, true);
end;
end;Possible Errors?
Line 3: [Error] (3:15): Unknown identifier 'BmpName' in script Oop you didn't declare variable right.
Well that's it I guess. Post anything relative to this.
~WhiteShadow