Rune Hacker
04-10-2007, 08:13 AM
Bitmaps!!!!!!!!
I use bitmaps every chance I have and I love them, so I decided to share the magic of bitmaps with
everyone!!!!!!! I hope you all enjoy, and I made it very easy to unserstand for everyone.
First of all, you will need photoshop to do this tutorial.
What are bitmaps?
A bitmap is a picture, but all of its pixels are turned into a bunch of numbers that scar can read.
Are they hard to make?
They are extremely easy to make, just read the tutorial below and you will see for yourself.
In this tutorial, I will be making a bitmap of the Chop Down option for choping down a tree.
1.) To start, be signed onto runescape and right click on a tree. After that,
push the Print Screen button on your keyboard which is near the top right of your keyboard.
http://img366.imageshack.us/img366/8667/rightclickingtreeyi3.png
2.) Now open up paint and either push Ctrl + v or go to Edit and click on Paste. You will now see
a picture of the screen at the excect moment you pushed Print Screen. You need to save this
now so go to File and click on Save As (make sure you remember where you save it) You can
now close Paint because you wont need it anymore.
http://img366.imageshack.us/img366/7039/saveasrightclickjw7.png
3.) Now open up your photoshop, "Adobe Photoshop Elements 2.0" in my case. Go to File and click on Open. Go to where you saved the picture from the previous step and open it. I like to use a grid while making bitmaps so I will tell you how. Click on "View" on the top menu bar and click on Grid so it will have a check next to it. You now a grid on your picture to help. (To change your grid preferences, go to Edit --> Preferences --> Grid Below is a picture of my personal grid preferences.
http://img366.imageshack.us/img366/5768/turninggridonbw5.png
http://img207.imageshack.us/img207/6572/gridpreferencestg9.png
4.) Now, zoom in so you can see the pixels easier by either pushing Ctrl + + or go to View and click on Zoom In. I like to zoom in as much as possible to help me see the pixels(max I can go is 1600%).
http://img366.imageshack.us/img366/5968/zoomedinclosedu8.png
5.) Now, click on the tool that selects parts of a picture http://img366.imageshack.us/img366/679/pixelboxselectorgt4.png . You
should always select as few pixels as possible to prevent lag. So never choose the entire
picture, only a small piece of it.
http://img366.imageshack.us/img366/2309/selectedpixelszj1.png
6.) Now, once you have selected what you wanted, go to image and click on Crop. Now you will only see the selected pixels you wanted.
http://img150.imageshack.us/img150/7964/cropedimagees8.png
7.) Go to File and click on Save As and name is whatever you want(ChopDown in my case), and
click Save(make sure you save it as a BMP). Save it onto your Desktop and a window will pop up. On this window, choose 32 bit. See the picture below for what it should
look like.
http://img150.imageshack.us/img150/367/box32bitkh6.png
8.) Now open up scar and click on Script and then on Picture To String.
http://img150.imageshack.us/img150/1253/stringtopictureen5.png
9.) Now a little window will pop up called Bitmap Loader. Click on the Open button and go to where you saved the picture from step 6. Click on it once and then click Open. There will not be a picture of it in the middle of the window.
http://img150.imageshack.us/img150/3138/pictureinbitmapcentertr3.png
10) Now just click Ok and you will see the bitmap on the bottom of your scar window.
http://img150.imageshack.us/img150/5503/bitmapdonepo5.png
11.) Now just use this in your script and your done!
Here is one way you could use it in a script:
Program ChopDownTree;
{.include SRL/SRL.scar}
var
ChopDown : Integer;
Procedure LoadBitmaps; //this loads the bitmaps so they can be used later in the script.
begin
ChopDown := BitmapFromString(54, 1, 'z78DA737343000324E0862' +
'16EEA626A62624E6B715CA41BDDDD096113A30B008C164C9F ');
end;
Procedure ChopTheTree; //this procedure will chop down a tree
begin
if(Findcolor(x,y,TreeColor,MSX1, MSY1, MSX2, MSY2))then //finds the color of the tree(TreeColor)
begin
Mouse(x, y, 2, 2, False); //right clicks the tree
end;
if(FindBitmap(ChopDown, x, y))then //finds the bitmap
begin
Writeln('Starting to chop down the tree now.'); //sends a message if the bitmap is found
Mouse(x, y, 1, 1, True); //left clicks the bitmap
end;
FreeBitmap(ChopDown) //frees the bitmap to prevent lag after the bitmap is used once
end;
begin //main loop (you should know what this is by now)
LoadBitmaps;
ChopTheTree;
end.
The bitmap(s) you use must always be put in as variables at the top.
This little script finds the tree and right clicks is.
Then it looks for the bitmap we made, left clicks that, and types in a message saying we found it.
Then we use FreeBitmap to prevent lag(use this for all bitmaps you use after they are used in the script)
Bitmaps can be used for much more than this, but the picture you make a bitmap of must always be exact because bitmaps look for specific pixels in an exact order.
I use bitmaps all I can because they are so easy to make and work every time.
I hope this helped everyone who didn't completely understand how to make and use bitmaps.
Also some useful tips:
- You can fill in parts of the picture you dont want scar to look for by making them black.
- Bitmaps are great for finding symbols on the minimap
- Finding items in your inventory if you dont know how to use DTMs
- They can be used main screen, but you must be facing the exact same direction as when you made it for it to work.
- Much, much more.:)
There are many more ways to find a bitmap though such as these(using the bitmap we made):
- FindBitMapToleranceIn(ChopDown, x, y, MSX1, MSY1, MSX2, MSY2, 3);
- FindBitMapTol(x, y, ChopDown, MSX1, MSY1, MSX2, MSY2);
- FindBitMapTolRaiser(ChopDown, x, y, 1, 5, MSX1, MSY1, MSX2, MSY2);
- FindDeformed(x, y, ChopDown, MSX1, MSY1, MSX2, MSY2): Boolean;
There is much more information about how these are used in the SRL manual HERE (http://www.villavu.com/forum/showthread.php?t=2802?t=3410).
(incase you don't know, MSX1,MSY1,MSX2,MSY2 are the pre-set coords for the main screen, There are also ones for the minimap, inventory, chat, or you set your own coords for it to look. It will look for the bitmap in the coords you set)
If you liked this tutotial, it would be nice to leave it a 5 star and leave me rep:rolleyes:
And if you have any problems, feel free to send me a private message or post here. I will always be glad to help. Hope this helped everyone learn more about bitmaps.
I use bitmaps every chance I have and I love them, so I decided to share the magic of bitmaps with
everyone!!!!!!! I hope you all enjoy, and I made it very easy to unserstand for everyone.
First of all, you will need photoshop to do this tutorial.
What are bitmaps?
A bitmap is a picture, but all of its pixels are turned into a bunch of numbers that scar can read.
Are they hard to make?
They are extremely easy to make, just read the tutorial below and you will see for yourself.
In this tutorial, I will be making a bitmap of the Chop Down option for choping down a tree.
1.) To start, be signed onto runescape and right click on a tree. After that,
push the Print Screen button on your keyboard which is near the top right of your keyboard.
http://img366.imageshack.us/img366/8667/rightclickingtreeyi3.png
2.) Now open up paint and either push Ctrl + v or go to Edit and click on Paste. You will now see
a picture of the screen at the excect moment you pushed Print Screen. You need to save this
now so go to File and click on Save As (make sure you remember where you save it) You can
now close Paint because you wont need it anymore.
http://img366.imageshack.us/img366/7039/saveasrightclickjw7.png
3.) Now open up your photoshop, "Adobe Photoshop Elements 2.0" in my case. Go to File and click on Open. Go to where you saved the picture from the previous step and open it. I like to use a grid while making bitmaps so I will tell you how. Click on "View" on the top menu bar and click on Grid so it will have a check next to it. You now a grid on your picture to help. (To change your grid preferences, go to Edit --> Preferences --> Grid Below is a picture of my personal grid preferences.
http://img366.imageshack.us/img366/5768/turninggridonbw5.png
http://img207.imageshack.us/img207/6572/gridpreferencestg9.png
4.) Now, zoom in so you can see the pixels easier by either pushing Ctrl + + or go to View and click on Zoom In. I like to zoom in as much as possible to help me see the pixels(max I can go is 1600%).
http://img366.imageshack.us/img366/5968/zoomedinclosedu8.png
5.) Now, click on the tool that selects parts of a picture http://img366.imageshack.us/img366/679/pixelboxselectorgt4.png . You
should always select as few pixels as possible to prevent lag. So never choose the entire
picture, only a small piece of it.
http://img366.imageshack.us/img366/2309/selectedpixelszj1.png
6.) Now, once you have selected what you wanted, go to image and click on Crop. Now you will only see the selected pixels you wanted.
http://img150.imageshack.us/img150/7964/cropedimagees8.png
7.) Go to File and click on Save As and name is whatever you want(ChopDown in my case), and
click Save(make sure you save it as a BMP). Save it onto your Desktop and a window will pop up. On this window, choose 32 bit. See the picture below for what it should
look like.
http://img150.imageshack.us/img150/367/box32bitkh6.png
8.) Now open up scar and click on Script and then on Picture To String.
http://img150.imageshack.us/img150/1253/stringtopictureen5.png
9.) Now a little window will pop up called Bitmap Loader. Click on the Open button and go to where you saved the picture from step 6. Click on it once and then click Open. There will not be a picture of it in the middle of the window.
http://img150.imageshack.us/img150/3138/pictureinbitmapcentertr3.png
10) Now just click Ok and you will see the bitmap on the bottom of your scar window.
http://img150.imageshack.us/img150/5503/bitmapdonepo5.png
11.) Now just use this in your script and your done!
Here is one way you could use it in a script:
Program ChopDownTree;
{.include SRL/SRL.scar}
var
ChopDown : Integer;
Procedure LoadBitmaps; //this loads the bitmaps so they can be used later in the script.
begin
ChopDown := BitmapFromString(54, 1, 'z78DA737343000324E0862' +
'16EEA626A62624E6B715CA41BDDDD096113A30B008C164C9F ');
end;
Procedure ChopTheTree; //this procedure will chop down a tree
begin
if(Findcolor(x,y,TreeColor,MSX1, MSY1, MSX2, MSY2))then //finds the color of the tree(TreeColor)
begin
Mouse(x, y, 2, 2, False); //right clicks the tree
end;
if(FindBitmap(ChopDown, x, y))then //finds the bitmap
begin
Writeln('Starting to chop down the tree now.'); //sends a message if the bitmap is found
Mouse(x, y, 1, 1, True); //left clicks the bitmap
end;
FreeBitmap(ChopDown) //frees the bitmap to prevent lag after the bitmap is used once
end;
begin //main loop (you should know what this is by now)
LoadBitmaps;
ChopTheTree;
end.
The bitmap(s) you use must always be put in as variables at the top.
This little script finds the tree and right clicks is.
Then it looks for the bitmap we made, left clicks that, and types in a message saying we found it.
Then we use FreeBitmap to prevent lag(use this for all bitmaps you use after they are used in the script)
Bitmaps can be used for much more than this, but the picture you make a bitmap of must always be exact because bitmaps look for specific pixels in an exact order.
I use bitmaps all I can because they are so easy to make and work every time.
I hope this helped everyone who didn't completely understand how to make and use bitmaps.
Also some useful tips:
- You can fill in parts of the picture you dont want scar to look for by making them black.
- Bitmaps are great for finding symbols on the minimap
- Finding items in your inventory if you dont know how to use DTMs
- They can be used main screen, but you must be facing the exact same direction as when you made it for it to work.
- Much, much more.:)
There are many more ways to find a bitmap though such as these(using the bitmap we made):
- FindBitMapToleranceIn(ChopDown, x, y, MSX1, MSY1, MSX2, MSY2, 3);
- FindBitMapTol(x, y, ChopDown, MSX1, MSY1, MSX2, MSY2);
- FindBitMapTolRaiser(ChopDown, x, y, 1, 5, MSX1, MSY1, MSX2, MSY2);
- FindDeformed(x, y, ChopDown, MSX1, MSY1, MSX2, MSY2): Boolean;
There is much more information about how these are used in the SRL manual HERE (http://www.villavu.com/forum/showthread.php?t=2802?t=3410).
(incase you don't know, MSX1,MSY1,MSX2,MSY2 are the pre-set coords for the main screen, There are also ones for the minimap, inventory, chat, or you set your own coords for it to look. It will look for the bitmap in the coords you set)
If you liked this tutotial, it would be nice to leave it a 5 star and leave me rep:rolleyes:
And if you have any problems, feel free to send me a private message or post here. I will always be glad to help. Hope this helped everyone learn more about bitmaps.