So when I was trying to learn I had the hardest time figuring out bitmaps with the current guides out, and every member that I asked could never get them to even work for themselves. Bitmaps are extremely usefull and better then DTM's (In my opinion) becasue you do not ever have to worry about item clipping. Just follow these extremely simple steps below and you will be one step closer to making your own script.
I use the Snipping Tool found in Start-up > All Programs > Accessories, for taking my snap shots.
How To Make A BitMap
Step 1) Figure out which item you want to make a bitmap for, in this tutorial I am going to use the ring of kinship.
Step 2) Log in to Runescape and have the item you are making a bitmap for in your inventory or bankscreen, then open the Snipping Tool and select the area around it. Picture Below:
^^ After you have selected your image copy it by going to Edit > Copy on the Snipping Tool Menu Bar, Shown Above.
Step 3) After you have copied the image, open up " Paint " which is found under Startup > All Programs > Accessories. After Paint has opened drag the white window box cross hairs all the way to the top right, then paste your image.
Picture Below:
Step 4) Now your going to want to go to view then zoom all the way in on the picture.
Picture Below:
Step 5) Now were going to go back to the " Home Tab " and use the " Select Tool ", then choose a unique area of the item and cut a small piece off. The more unique colors, pattern, and smaller size of a snip the more accurate your bitmap will be.
For this item I am going to snip off a piece under the triangle getting the red (or orange whatever you want to call it), gray and yellow in my snip.
Picture Below:
After you do this you want to cut that piece off make a new paint window, then paste your snip into the new window, make sure the picture is snug and there is no white background.
Picture Below:
Now After you have this go to File > Save As, IMPORTANT: Make sure you save the file as a " 24-bit Bitmap (*.bmp*.dib) " as shown above ^, then save to your Desktop or I recommend making a new folder just for bitmaps.
How To Implement Into Your Script:
Step 6) Now we are going to open up a blank Simba client or you can use my sample below, and were going to make a bitmap from string. After you have a blank window open go to Tools > Bitmap Conversion.
After this a box will open up, next you choose " Open", then find the bitmap file you just saved, and open it.
Picture Below:
Step 7) After you have opened your bitmap file, were now going to press that button " To String " on the Bitmap Conversion Box Shown Below. Then It will give you the bitmap string in the debug box.
Step 8) Now that we have the string we are going to make a procedure. First we will start by making 2 procedures for calling and free-ing the bitmaps.
To stay simple we will name these procedures " CallThings " and " FreeThings "
Code Below:
Simba Code:
Program TestBitmap;
{$DEFINE SMART}
{$i srl/srl.Simba}
{Script Variables Here}
Var
Ring: Integer;
{This Will Handle Calling The Bitmaps | DTM's}
Procedure CallThings;
Begin
{Going to Name the Bitmap string " Ring ", and declare the variable under Var}
Ring := BitmapFromString(4, 11, 'meJxTDfjV//uvasAv1cDfQCRuNFf' +
'cZJFq4N+bj+9fuXvz7LVLxy+cWb9987qtm1ZtWr98/Zrsgryqhlpb' +
'O/eq/Te9SloMfcNNg+MsIlIiuub6lLd7l7UGN01Jm79F3HiBuPE8I' +
'EqZs1FAtYhL3J1L3DNp5logo/D4CSCZOH1NwbHjQARkAwDryT7e');
End;
{This Is going to handle Free-ing the Bitmaps on Terminate}
Procedure FreeThings;
Begin
FreeBitMap(Ring);
End;
Begin
Smart_Server := 18;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
{Always going to call the bitmaps under SetupSRL}
CallThings;
{Now were going to add the procedure FreeThings on terminate}
AddOnTerminate('FreeThings');
Repeat
Until(Not(LoggedIn))
{Call Free Things After you get logged out to properly Free Bitmap}
FreeThings;
Terminatescript();
End.
After you have done the above we will create a procedure just to test our bitmap out to see if we properly cut a good unique piece out.
Note: 25-45 Tolerance is ideal and should not go anyhigher.
Simba Code:
Procedure Teleport;
Begin
{First we are going to want to go to the gametab inventory if the ring is equipped}
GameTab(Tab_Equip);
{Will search for your bitmap in the main inventory with a tolerance of 65, < This
Is a High tolerance I only prefere 25-45 but it will work for this tutorial}
If FindBitMapToleranceIn(Ring, X, Y, MIX1, MIY1, MIX2, MIY2, 65) Then
{If It Finds The Bitmap It Will Debug It}
WriteLn('Debug: We Found The Ring Of Kinship');
{Movies The Mouse To The Item With A Randomness Pixel Shift of 3}
MMouse(X, Y, 3, 3);
{Right Clicks The Item}
ClickMouse2(False);
{Chooses The Option Teleport}
WaitOption('eleport to Dae',250);
End Else
{If it cant find the ring it will debug this, then you will need to change tolerance, or use another piece of the item that's more unique.}
WriteLn('Debug: We Could Not Find The Ring');
End;
{You will also need to declare X, Y variables}
Now You should have something like this below.
Simba Code:
Program TestBitMap;
{$DEFINE SMART}
{$i srl/srl.Simba}
Var
X, Y, Ring: Integer; {All the script variables were declared here}
Procedure CallThings;
Begin
Ring := BitmapFromString(4, 11, 'meJxTDfjV//uvasAv1cDfQCRuNFf' +
'cZJFq4N+bj+9fuXvz7LVLxy+cWb9987qtm1ZtWr98/Zrsgryqhlpb' +
'O/eq/Te9SloMfcNNg+MsIlIiuub6lLd7l7UGN01Jm79F3HiBuPE8I' +
'EqZs1FAtYhL3J1L3DNp5logo/D4CSCZOH1NwbHjQARkAwDryT7e');
End;
Procedure FreeThings;
Begin
FreeBitMap(Ring);
End;
Procedure Teleport;
Begin
GameTab(Tab_Equip);
If FindBitMapToleranceIn(Ring, X, Y, MIX1, MIY1, MIX2, MIY2, 65) Then
Begin
WriteLn('Debug: We Found The Ring Of Kinship');
MMouse(X, Y, 3, 3);
ClickMouse2(False);
WaitOption('eleport to Dae',250);
End Else
WriteLn('Debug: We Could Not Find The Ring');
End;
Begin
Smart_Server := 18;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
CallThings;
AddOnTerminate('FreeThings');
ClickNorth(SRL_ANGLE_HIGH);
Teleport; {Teleport Procedure Goes here so it will only be called once for testing purposes}
Repeat
Until(Not(LoggedIn))
FreeThings;
Terminatescript();
End.
Step 9) What to do if its picking up other items, or searching in the wrong places on the main-screen while trying to withdraw from bank etc or inventory. This usually happens with grey items such as Rune Essence + Steel | Iron bars etc.
If you fiddled around with your tolerance and its still picking the wrong area what you need to do is drag the cross-hairs onto the client, then pick the color picker and find the coordinates of the main-screen or inventory.
Pictures Below:
Now to get the coordinates of the Bankscreen or Inventory.
Step 10) Now after getting the coordinates of where you want to search for your object were going to change where where it will search for the bitmap.
Code Below:
Simba Code:
{This will search the whole main screen}
FindBitMapToleranceIn(Ring, X, Y, MSX1, MSY1, MSX2, MSY2, 45)
{This will search inside the coords for the bank screen}
If FindBitMapToleranceIn(Ring, X, Y, 29, 89, 477, 287, 45)
{This will search the whole inventory, including the poles on the sides}
If FindBitMapToleranceIn(Ring, X, Y, MIX1, MIY1, MIX2, MIY2, 45)
{This will search just the inside of the inventory where items are}
If FindBitMapToleranceIn(Ring, X, Y, 727, 458, 724, 455, 45)
Congratulations If you followed the script you will of learnt how to create a bitmap and how to implement the bitmap string into a script. If you need any help feel free to post here with questions.