SRL Archive - OSR Intermediate Scripting Tutorials

[scar] Fun with Bitmaps


MujaheD

2006-06-08 09:37:03

This is one part of my SCAR tutorial series. My tutorials havent come out yet though i do have a flash one in development. Now to begin.

What is a Bitmap?
Assuming that you already know things about colours, a bitmap is more like a picture. It's a group of colours put together that form to make a picture.

Basic information on bitmaps.
Bitmaps are very basic and easy to understand. All you need to do is declare a bitmap and as soon as you have done that you can use it's functions. In this tutorial i will explain how to get the mouse to click on a bitmap

Bitmap Functions
SCAR can do many more things than just click a bitmap, it can use tolerences, specify boxs and many more things. Here is a list of bitmap functions:(NOTE: it is not neccessary to read the functions however it is recommeneded)

function FindBitmap(bitmap: Integer; var x, y: Integer): Boolean; - search for the bitmap in client window. If found coordinates are returned in x,y. bitmap contains handle to bitmap generated by LoadBitmap.

function FindBitmapIn(bitmap: Integer; var x, y, x1, y1, x2, y2: Integer): Boolean; - search for the bitmap in coordinates specified by x1, y1, x2, y2. bitmap contains handle to bitmap generated by LoadBitmap.

function FindBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer): Boolean - Works like FindBitmapIn but with a tolerance parameter for finding any similar colored bitmap. Tolerance is used to find a colored bitmap in range of the bitmap you are looking for. The greater color range you want, the higher the tolerance parameter should be.

function FindBitmapSpiral(bitmap: Integer; var x, y, x1, y1, x2, y2: Integer): Boolean; - search for the bitmap in coordinates specified by x1, y1, x2, y2 starting from x, y. bitmap contains handle to bitmap generated by LoadBitmap.

function FindBitmapSpiralTolerance(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; Tolerance: Integer): Boolean - Works like FindBitmapSpiral but with a tolerance parameter for finding any similar colored bitmap. Tolerance is used to find a colored bitmap in range of the bitmap you are looking for. The greater color range you want, the higher the tolerance parameter should be.

function FindBitmapMaskTolerance(mask: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; Tolerance, ContourTolerance: Integer): Boolean - Essentially it works like FindBitmapIn except it identifies using the masks/shape of an object in the bitmap. Masks are specified by the colors black and white. ContourTolerance is the minimal tolerance for color difference between shape of a mask and the background in a bitmap, It makes sure the shape differs from the background.
<– sample mask for finding letter A in any color.

function FindDeformedBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; var accuracy: Extended): Boolean; - Works similar to FindBitmapToleranceIn but allows searching for partially covered or transformed bitmaps. If range is 0, it checks pixels at positions that match bitmap we are looking for; if Range ir 1, it checks neighbor pixels as well, if range is bigger, it checks further. AllowPartialAccuracy allows accuracy that is not 100% match. accuracy returns accuracy of found bitmap to bitmap we are looking for. accuracy = 1.0 means it was 100% perfect match.

function FindDeformedBitmapToleranceRotationIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; var accuracy: Extended; AngleIntervals: Extended; StartAngle, MaxAngle: Extended; var angle: Extended): Boolean; - Works similar to FindDeformedBitmapToleranceIn but allows searching for rotated bitmaps as well. Basically it rotates bitmap, searches in target image, then rotates again, searches again. AngleIntervals specifies by how much it rotates every time, StartAndge specifies initial rotation angle, MaxAngle specifies how far it rotates and angle returns angle of found image. All angles are specified in radians (Pi = 180&#730;)

function RotateBitmap(bitmap: Integer; angle: Extended): Integer; - Rotates bitmap by specified angle in radians (Pi = 180&#730;)


In this tutorial i will only be teaching you how to click on a bitmap ( will update in the near future)

Retrieving a bitmap
Your probably wondering, how the hell am i suposed to get a bitmap! well dont worry its not rocket science. To get a bitmap simply
  • Make sure the bitmap you want is visble on the screen
  • Press the print screen key
  • Press cntrl + C
  • open ms paint
  • press cntrl + v
  • crop out the image. NOTE: when cropping the image, crop the middle of it because not all of it is needed, look at the picture if your confused.)
  • save it somewhere you can remember
Here are some images to aid you:







Converting a Bitmap
Well since SCAR doesnt allow you to paste pictures in the CDE (Cheat Development Environment) you must let SCAR know what the picture looks like, to do this we need to change the picture into a peice of code. The code type we are using is a Variable (numbers). To do this we must:
  • In scar, goto script
  • goto Bitmapt to string
  • Load your image
  • click ok
  • Now look in the debug box, you will see a few lines of code
  • it should look somthing like this:

Bitmap := BitmapFromString(18, 15, 'z78DA655459926D2908DC92' + 
'03027E32B9FF25756A9D57DDF1FA545486815E9221417BDA11E56' +
'C653142AA6DF393C6947CFAEAC035D3BD623693EAC376660CD927' +
'CF70E352A09601A9F6306B257853C523ADD79E647CDA04C959BB8' +
'515C58A9DA1E491BC2CD7E914D90FCD650A9F4B9BF3E8EC3B81B2' +
'790C51EF8336E5F57C8AC67EFEF7F65A1FC265E9ECB8F5A9A6678' +
'485A70AC10DAD483A830AB9C864F3EA73CAB4CE5D6837150D2365' +
'3DA632157632E95B07AB45FEB218187D2B30402FA360BFD9F52AE' +
'9BE722CFC7F1593597E4E1B2C62B60EC319C2E98889833262C7CA' +
'1D8AB3EDB0E6BE04F56860595960F92FD7C502A3CEB1A36251542' +
'1A09423847EA13BE4A302054C210955EB7E8BC72160C9C7A5E05D' +
'69A8FCCC54DDE4345267E8974B6CBEFD02CA38C03D276208E432C' +
'1D2830E4F763D7D14AA67E88B6E9BC567DB629D3E40A14EDCD49C' +
'81FBA13AE3961CC1EA0A877F81FFDCEB6504E5CC06CBC7855C2EC' +
'BF285BA1DCB4A280AB743D153486073FAE00D51E13C70D6DDA1C3' +
'FD6103A2ED99C865E2FD9F5CD663F9C948A00D41D70A155B5F2EF' +
'1580CBA1D4F51FFEACA81B7FEFE6276E8BC1E22E777D687F2EBFF' +
'0F0B8385E1E84C4CC141248F0532C0FB8D5C04F15BCD41EAB9809' +
'C1D4A939C90B926B4AD1BF68B880476465E7C95FF303E44C147E1' +
'D6E750CB33590B59FFCC237E8AF86F0C0348593D1853DDA11DD5D' +
'1966A0D147AB741C0FE17DAC3FD6E15C8C03E041650E1CD1A4865' +
'CBCB85918B221774E72155EF469D4D277438DDFCCD21F609FA1F2' +
'D27CA792EE27C6F26309EDDA3273D0BE13CF07EE30C39DF49B93B' +
'E7F5453F168CC2C38E677DD39E567EE70BC3E44F026041911E5EA' +
'EB6D70E9F745030A625EE49248695B5608170A1CF4EAE11770AE2' +
'EEB437779785C0BEEECE41CD1BB3F066C805338B6FC509022383B' +
'7727AC162D2143EC741A7127A80CC3E5588356CC2303B0BE110D6' +
'4DFBFBEFE7430C578D2E196B297608F6DA3E2E580C07523A18171' +
'1ECABC7824ACEAEE7ED07C59666EB60C1323FB49AD78148B07CE3' +
'FCEFFBE59A2550EFB83B4DEF6E6439C134B4C79C8E15114F6985E' +
'DDA1F8B3D9679FA3CD8EA84513960914440364E3BF50F89B57509' +
'');
All those weird characters you see there are codes for every pixel in the bitmap. Here are some images to aid you:







How to Use a Bitmap in SCAR
Now for the fun part. First off i will show you how to get SCAR to click on the very bitmap you just created. We will firstly need to put in some variables as follows (x,y,Bitmap:integer;) (x,y) will be where SCAR will store the coordinates of the bitmap (if it finds it). ie will be the code of the bitmap you have created. you code should look somthing like this:

program MUJTUT;// name of your program here

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers
In this program we are going to be using procedures, please veiw starter tutorials if you dont know what that means. To click a bitmap we will be using three basic procedures (DeclareBMPs,FindBMPS,ClickBMPS). In DeclareBMPS we will be declaring the bitmap, what that means is that we will be loading the picture into your computer's memory so it know what to look for. In FindBMPS we will be coding the procedures to find the bitmap. In ClickBMPS we will be putting basic code to click on the Bitmap. Your code should look something like this:

program MUJTUT;// name of your program here

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers

procedure DeclareBMPS;
begin
end;

procedure ClickBMPS;
begin
end;


Procedure FindBMPS;
begin
end;


Declare the Bitmap
Its fairly simple to declare a Bitmap in scar. In the DeclareBMP procedure after begin, put this in. Bitmap :=BitmapFromString(INSERT CODE HERE). In the insert code section simply copy and paste the code which SCAR generated from our picture. Heres what your code should look like:

program MUJTUT;// name of your program here

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers

procedure DeclareBMPS;
begin
Bitmap := BitmapFromString(18, 15, 'z78DA655459926D2908DC92' +
'03027E32B9FF25756A9D57DDF1FA545486815E9221417BDA11E56' +
'C653142AA6DF393C6947CFAEAC035D3BD623693EAC376660CD927' +
'CF70E352A09601A9F6306B257853C523ADD79E647CDA04C959BB8' +
'515C58A9DA1E491BC2CD7E914D90FCD650A9F4B9BF3E8EC3B81B2' +
'790C51EF8336E5F57C8AC67EFEF7F65A1FC265E9ECB8F5A9A6678' +
'485A70AC10DAD483A830AB9C864F3EA73CAB4CE5D6837150D2365' +
'3DA632157632E95B07AB45FEB218187D2B30402FA360BFD9F52AE' +
'9BE722CFC7F1593597E4E1B2C62B60EC319C2E98889833262C7CA' +
'1D8AB3EDB0E6BE04F56860595960F92FD7C502A3CEB1A36251542' +
'1A09423847EA13BE4A302054C210955EB7E8BC72160C9C7A5E05D' +
'69A8FCCC54DDE4345267E8974B6CBEFD02CA38C03D276208E432C' +
'1D2830E4F763D7D14AA67E88B6E9BC567DB629D3E40A14EDCD49C' +
'81FBA13AE3961CC1EA0A877F81FFDCEB6504E5CC06CBC7855C2EC' +
'BF285BA1DCB4A280AB743D153486073FAE00D51E13C70D6DDA1C3' +
'FD6103A2ED99C865E2FD9F5CD663F9C948A00D41D70A155B5F2EF' +
'1580CBA1D4F51FFEACA81B7FEFE6276E8BC1E22E777D687F2EBFF' +
'0F0B8385E1E84C4CC141248F0532C0FB8D5C04F15BCD41EAB9809' +
'C1D4A939C90B926B4AD1BF68B880476465E7C95FF303E44C147E1' +
'D6E750CB33590B59FFCC237E8AF86F0C0348593D1853DDA11DD5D' +
'1966A0D147AB741C0FE17DAC3FD6E15C8C03E041650E1CD1A4865' +
'CBCB85918B221774E72155EF469D4D277438DDFCCD21F609FA1F2' +
'D27CA792EE27C6F26309EDDA3273D0BE13CF07EE30C39DF49B93B' +
'E7F5453F168CC2C38E677DD39E567EE70BC3E44F026041911E5EA' +
'EB6D70E9F745030A625EE49248695B5608170A1CF4EAE11770AE2' +
'EEB437779785C0BEEECE41CD1BB3F066C805338B6FC509022383B' +
'7727AC162D2143EC741A7127A80CC3E5588356CC2303B0BE110D6' +
'4DFBFBEFE7430C578D2E196B297608F6DA3E2E580C07523A18171' +
'1ECABC7824ACEAEE7ED07C59666EB60C1323FB49AD78148B07CE3' +
'FCEFFBE59A2550EFB83B4DEF6E6439C134B4C79C8E15114F6985E' +
'DDA1F8B3D9679FA3CD8EA84513960914440364E3BF50F89B57509' +
'');
end;

procedure ClickBMPS;
begin
end;


Procedure FindBMPS;
begin
end;


Find the Bitmap
to find the bitmap in scar we simply use one of the procedures mension previoulsy in the tutorial. In this case i will be teaching you how to use the 'FindBitmap' function. However in this case we will be using an 'IF' statement, what that means is we will be telling scar only to click it if the bitmap is found. Put this in the FindBMPS; procedure,
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
This tells scar that if it finds the bitmap it will run the ClickBMPS; procedure.
Your code should look somthing like this:

program MUJTUT;// name of your program here

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers

procedure DeclareBMPS;
begin
Bitmap := BitmapFromString(18, 15, 'z78DA655459926D2908DC92' +
'03027E32B9FF25756A9D57DDF1FA545486815E9221417BDA11E56' +
'C653142AA6DF393C6947CFAEAC035D3BD623693EAC376660CD927' +
'CF70E352A09601A9F6306B257853C523ADD79E647CDA04C959BB8' +
'515C58A9DA1E491BC2CD7E914D90FCD650A9F4B9BF3E8EC3B81B2' +
'790C51EF8336E5F57C8AC67EFEF7F65A1FC265E9ECB8F5A9A6678' +
'485A70AC10DAD483A830AB9C864F3EA73CAB4CE5D6837150D2365' +
'3DA632157632E95B07AB45FEB218187D2B30402FA360BFD9F52AE' +
'9BE722CFC7F1593597E4E1B2C62B60EC319C2E98889833262C7CA' +
'1D8AB3EDB0E6BE04F56860595960F92FD7C502A3CEB1A36251542' +
'1A09423847EA13BE4A302054C210955EB7E8BC72160C9C7A5E05D' +
'69A8FCCC54DDE4345267E8974B6CBEFD02CA38C03D276208E432C' +
'1D2830E4F763D7D14AA67E88B6E9BC567DB629D3E40A14EDCD49C' +
'81FBA13AE3961CC1EA0A877F81FFDCEB6504E5CC06CBC7855C2EC' +
'BF285BA1DCB4A280AB743D153486073FAE00D51E13C70D6DDA1C3' +
'FD6103A2ED99C865E2FD9F5CD663F9C948A00D41D70A155B5F2EF' +
'1580CBA1D4F51FFEACA81B7FEFE6276E8BC1E22E777D687F2EBFF' +
'0F0B8385E1E84C4CC141248F0532C0FB8D5C04F15BCD41EAB9809' +
'C1D4A939C90B926B4AD1BF68B880476465E7C95FF303E44C147E1' +
'D6E750CB33590B59FFCC237E8AF86F0C0348593D1853DDA11DD5D' +
'1966A0D147AB741C0FE17DAC3FD6E15C8C03E041650E1CD1A4865' +
'CBCB85918B221774E72155EF469D4D277438DDFCCD21F609FA1F2' +
'D27CA792EE27C6F26309EDDA3273D0BE13CF07EE30C39DF49B93B' +
'E7F5453F168CC2C38E677DD39E567EE70BC3E44F026041911E5EA' +
'EB6D70E9F745030A625EE49248695B5608170A1CF4EAE11770AE2' +
'EEB437779785C0BEEECE41CD1BB3F066C805338B6FC509022383B' +
'7727AC162D2143EC741A7127A80CC3E5588356CC2303B0BE110D6' +
'4DFBFBEFE7430C578D2E196B297608F6DA3E2E580C07523A18171' +
'1ECABC7824ACEAEE7ED07C59666EB60C1323FB49AD78148B07CE3' +
'FCEFFBE59A2550EFB83B4DEF6E6439C134B4C79C8E15114F6985E' +
'DDA1F8B3D9679FA3CD8EA84513960914440364E3BF50F89B57509' +
'');
end;

procedure ClickBMPS;
begin
end;


Procedure FindBMPS;
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
begin
end;


How to get the mouse to click on the Bitmap
We're almost there. Now all we have to do is tell Scar how to click on the Bitmap. Add this to the ClickBMPS section.
wait(300+random(32))
movemousesmooth(x,y)
wait(32+random(16))
clickmouse(x,y,true)
This tells SCAR to wait 300 miliseconds along with a random number between 1 to 32 in miliseconds. It will then move the mouse smoothly to the position of the Bitmap, it waits another 32ms along with a random number of ms between 1 and 16. it will then click on the position of the Bitmap. You maybe wondering why we put in the waits, well thats so that you dont lag out. Your code should look somthing like this:

program MUJTUT;// name of your program here

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers

procedure DeclareBMPS;
begin
Bitmap := BitmapFromString(18, 15, 'z78DA655459926D2908DC92' +
'03027E32B9FF25756A9D57DDF1FA545486815E9221417BDA11E56' +
'C653142AA6DF393C6947CFAEAC035D3BD623693EAC376660CD927' +
'CF70E352A09601A9F6306B257853C523ADD79E647CDA04C959BB8' +
'515C58A9DA1E491BC2CD7E914D90FCD650A9F4B9BF3E8EC3B81B2' +
'790C51EF8336E5F57C8AC67EFEF7F65A1FC265E9ECB8F5A9A6678' +
'485A70AC10DAD483A830AB9C864F3EA73CAB4CE5D6837150D2365' +
'3DA632157632E95B07AB45FEB218187D2B30402FA360BFD9F52AE' +
'9BE722CFC7F1593597E4E1B2C62B60EC319C2E98889833262C7CA' +
'1D8AB3EDB0E6BE04F56860595960F92FD7C502A3CEB1A36251542' +
'1A09423847EA13BE4A302054C210955EB7E8BC72160C9C7A5E05D' +
'69A8FCCC54DDE4345267E8974B6CBEFD02CA38C03D276208E432C' +
'1D2830E4F763D7D14AA67E88B6E9BC567DB629D3E40A14EDCD49C' +
'81FBA13AE3961CC1EA0A877F81FFDCEB6504E5CC06CBC7855C2EC' +
'BF285BA1DCB4A280AB743D153486073FAE00D51E13C70D6DDA1C3' +
'FD6103A2ED99C865E2FD9F5CD663F9C948A00D41D70A155B5F2EF' +
'1580CBA1D4F51FFEACA81B7FEFE6276E8BC1E22E777D687F2EBFF' +
'0F0B8385E1E84C4CC141248F0532C0FB8D5C04F15BCD41EAB9809' +
'C1D4A939C90B926B4AD1BF68B880476465E7C95FF303E44C147E1' +
'D6E750CB33590B59FFCC237E8AF86F0C0348593D1853DDA11DD5D' +
'1966A0D147AB741C0FE17DAC3FD6E15C8C03E041650E1CD1A4865' +
'CBCB85918B221774E72155EF469D4D277438DDFCCD21F609FA1F2' +
'D27CA792EE27C6F26309EDDA3273D0BE13CF07EE30C39DF49B93B' +
'E7F5453F168CC2C38E677DD39E567EE70BC3E44F026041911E5EA' +
'EB6D70E9F745030A625EE49248695B5608170A1CF4EAE11770AE2' +
'EEB437779785C0BEEECE41CD1BB3F066C805338B6FC509022383B' +
'7727AC162D2143EC741A7127A80CC3E5588356CC2303B0BE110D6' +
'4DFBFBEFE7430C578D2E196B297608F6DA3E2E580C07523A18171' +
'1ECABC7824ACEAEE7ED07C59666EB60C1323FB49AD78148B07CE3' +
'FCEFFBE59A2550EFB83B4DEF6E6439C134B4C79C8E15114F6985E' +
'DDA1F8B3D9679FA3CD8EA84513960914440364E3BF50F89B57509' +
'');
end;


procedure ClickBMPS;
begin
wait(300+random(32))
movemousesmooth(x,y)
wait(32+random(16))
clickmouse(x,y,true)
end;


Procedure FindBMPS;
begin
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
end;


The Loop

Now we come to our main loop. Here we want to tell SCAR to begin the program. simply enter this in the code:
begin
repeat
wait(1300)
DeclareBMPS;
FindBMPS;
until(false)
end.
Your Code should look somthing like this:
program MUJTUT;// name of your program here

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers

procedure DeclareBMPS;
begin
Bitmap := BitmapFromString(18, 15, 'z78DA655459926D2908DC92' +
'03027E32B9FF25756A9D57DDF1FA545486815E9221417BDA11E56' +
'C653142AA6DF393C6947CFAEAC035D3BD623693EAC376660CD927' +
'CF70E352A09601A9F6306B257853C523ADD79E647CDA04C959BB8' +
'515C58A9DA1E491BC2CD7E914D90FCD650A9F4B9BF3E8EC3B81B2' +
'790C51EF8336E5F57C8AC67EFEF7F65A1FC265E9ECB8F5A9A6678' +
'485A70AC10DAD483A830AB9C864F3EA73CAB4CE5D6837150D2365' +
'3DA632157632E95B07AB45FEB218187D2B30402FA360BFD9F52AE' +
'9BE722CFC7F1593597E4E1B2C62B60EC319C2E98889833262C7CA' +
'1D8AB3EDB0E6BE04F56860595960F92FD7C502A3CEB1A36251542' +
'1A09423847EA13BE4A302054C210955EB7E8BC72160C9C7A5E05D' +
'69A8FCCC54DDE4345267E8974B6CBEFD02CA38C03D276208E432C' +
'1D2830E4F763D7D14AA67E88B6E9BC567DB629D3E40A14EDCD49C' +
'81FBA13AE3961CC1EA0A877F81FFDCEB6504E5CC06CBC7855C2EC' +
'BF285BA1DCB4A280AB743D153486073FAE00D51E13C70D6DDA1C3' +
'FD6103A2ED99C865E2FD9F5CD663F9C948A00D41D70A155B5F2EF' +
'1580CBA1D4F51FFEACA81B7FEFE6276E8BC1E22E777D687F2EBFF' +
'0F0B8385E1E84C4CC141248F0532C0FB8D5C04F15BCD41EAB9809' +
'C1D4A939C90B926B4AD1BF68B880476465E7C95FF303E44C147E1' +
'D6E750CB33590B59FFCC237E8AF86F0C0348593D1853DDA11DD5D' +
'1966A0D147AB741C0FE17DAC3FD6E15C8C03E041650E1CD1A4865' +
'CBCB85918B221774E72155EF469D4D277438DDFCCD21F609FA1F2' +
'D27CA792EE27C6F26309EDDA3273D0BE13CF07EE30C39DF49B93B' +
'E7F5453F168CC2C38E677DD39E567EE70BC3E44F026041911E5EA' +
'EB6D70E9F745030A625EE49248695B5608170A1CF4EAE11770AE2' +
'EEB437779785C0BEEECE41CD1BB3F066C805338B6FC509022383B' +
'7727AC162D2143EC741A7127A80CC3E5588356CC2303B0BE110D6' +
'4DFBFBEFE7430C578D2E196B297608F6DA3E2E580C07523A18171' +
'1ECABC7824ACEAEE7ED07C59666EB60C1323FB49AD78148B07CE3' +
'FCEFFBE59A2550EFB83B4DEF6E6439C134B4C79C8E15114F6985E' +
'DDA1F8B3D9679FA3CD8EA84513960914440364E3BF50F89B57509' +
'');
end;

procedure ClickBMPS;
begin
wait(300+random(32))
movemousesmooth(x,y)
wait(32+random(16))
clickmouse(x,y,true)
end;


Procedure FindBMPS;
begin
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
end;

begin
repeat
wait(1300)
DeclareBMPS;
FindBMPS;
until(false)
end.
Now test your code and leave me alone…
I meant ask for help if you need it.

SCAR is copyright to kaitnieks (what ever his real name is)
I did this for many reasons,
Gain respect
Share knowledge
Make SCAR more popular
Teach
Become an SRL member
Please help me out by posting comments

~MuJ

MujaheD

2006-06-08 09:44:20

There are a few errors it took hours to do this and i need to sleep now. Make sure to name the bitmap in the variable as "bitmap" and not variable

EDIT*: I think i fixed everything now. Please take the tutorial even if you know how to use bitmaps just so you can rate it for me.

Upcoming tutorials:
How to use Bitmaps in rs
Dtms
Starter tutorial
Set up SRL
How to make your first runescape script
Normal colour finding (all types of procedures)
The rest of the functions with bitmaps.
Next tutorials are intended to be in flash or in video with voice. They might however be just like this depending on my situation at the time. Please post comments

The Un-Named

2006-06-08 11:02:00

You forgot one important thing: large bitmaps LAG. To reduce the size of the bitmaps, black out what isn't needed. A better IE bitmap would be: but then that takes it's toll.

  ie := BitmapFromString(10, 7, '64D6F151D6F53DBBEC30A7E12A9D' + 
'DC279FDF2BA6E82BA8EA2BA4E92AA0E74CD1F435A8DF237FB51E6' +
'99B1C64951F76B02494D72A9FE4299EE6299BE536ABE122699A24' +
'4E792B55822B58852756832158882388CC299BE5299AE62375A82' +
'1436A35669A00000000000000000030609226659C2995DE2B9AE6' +
'1849712A5581376AA00000000000000000000000002D5D8D257EC' +
'42C99E71C65991F5C8F24659E2666A02666A22766A22764A12666' +
'A12681C92D97E7289FE22796DB2692DA2792DB2891DC2991DC299' +
'0DC2A8FDD2C93E22D96E7');

MujaheD

2006-06-09 02:21:29

I would have changed it but when i was making this it was like 1 am here and i had an exam the next day, i was kind of cranky. I dont think i will be able to change it but thanks for the comments, i want everyone to comment please

Janilabo

2006-06-09 02:33:00

There was couple typos.. (like movmousesmooth instead of movemousesmooth) But apart from that… DAMN NICE TUTORIAL ON BITMAPS! :p

Love it. Good job man!

…I learned couple new things with it. :)

MujaheD

2006-06-09 02:43:54

Happy to help and as for the typos ill see if i can find any now, people please keep commenting.
EDIT*: fixed

Jagex_Fagex

2006-06-09 03:25:47

looks good, are you the guy from kaitnieks?

Janilabo

2006-06-09 03:57:28

From: Jagex_Fagex
looks good, are you the guy from kaitnieks?

Oh yes he is. :p

MujaheD

2006-06-09 07:53:16

From: Jagex_Fagex
looks good, are you the guy from kaitnieks?

I was a member at kaitnieks 2 years before it got "cut off". You might have mistaked me for somone else though, either your comment is appreciated :D everyone comment please!

Bam Bam

2006-06-17 07:11:08

Nice TUT Mujahed…

I remember you from Kaitnieks also…

Sk84lifesam

2006-06-19 04:05:06

wow great tut ive always wanted to know how to put bitmaps in, but never found a tut for it :)

right so here is my first ever script using a bitmap could you perhaps tell me why it just leaves the mouse in the top corner of the game and doesnt actually click the bitmap?
{for game http://igol.be/index.php?option=com_mamboflashgames&Itemid=999&task=view&catid=0&id=51}
program reflexgame;

var
x,y,Bitmap:integer;

procedure DeclareBMPS;
begin
Bitmap := BitmapFromString(56, 54, 'z78DAED9B498E83301045' +
'AFD4811060E9F1FE476A4121D98898FCB20D98A1175FBD48ECE25' +
'1934921FE863FC1D5D7A07DEFFE2F5FCBB7F6E1599C856A50F51E' +
'54CB414D3BA8B53CA56FD10AB41AAD7C719E1F77BDB68EE1C6D6D' +
'AEDD8DB4BF0248663DAB5FD2E0C43DA394BC8AA73F1945D010C43' +
'3A5A25C9FE2AABE6E539DE77F32A926128F792E56D1E9EC4245D2' +
'9FF1B99E91AA936358066DD91AE228943F2BD9075425C8F39418F' +
'2A93EF2FAD40ABD1CA9179A0DE200F203C6D54A51EBFAB1AB742A' +
'E1899A975BBD08EDCAE20570680B465C61AD556B531C375B68AE7' +
'B746EF4795D1755779F252DE3C8F7B2C5DA9A86165921C6F1A23C' +
'31FE08DB0C7E2F1A55F4CAA804AC18B6ED11449D2F7D586970188' +
'402E9E944F2092AA74925F32400767D464921AEECFE94C741692B' +
'35EABDB25F6E133A33E2D495F7587F6A84486CB73EADF80182FB4' +
'EE44D52924F689CC1639535E83A41FFB7877FA5E6888A7B999674' +
'679A9B001AA0B55406FA6ABCB91F47329D0F3132584A701563B57' +
'5F14D947AD477D85F2446AFA5549FA0AD57A84E7FA7D69EEC2D30' +
'01DCE3A49E45C798D6E3357472AA53BBDC6F154EA2E3C9562F25C' +
'A8940FCF87E7C3F3363C9BA71E31EB51B3C653344FBFC4EC973E9' +
'E8678D64F3F0FFF12FAF9AD06E0F99C370DCC13791AF03C0FA1CF' +
'203CE507FD2DF8B2910EF0941F9427299245EFF93C3994397F745' +
'FCD1DBD14F14C15E8707E78A9449FDD5DA3C347BA77EB55AB691A' +
'C7579F5EFB5D353CF175DE8A8F54F3A906D56BAC20A5BDDE70EC9' +
'F2BA35A78A2E9BDEA994C55F80C953C0955E61493AAF2909CC5BE' +
'41772F79F646306717E9AAF392F463DF9C962A97245D69AE180FA' +
'96C9933D5DDF1E7A9E9BC83DBECCD35095CE3A87A5EC79D9CA77C' +
'B5CFE418EDC27E67218E64B24E11A4991960394B9F6B0EDC9FEBA' +
'E62EC99A25BEF4D72C6B34BA6BAF05EED715E57FA64FA5B33C792' +
'FCC2D3A3AA93A9EEA9BA0092419E9EAA94F7927679DF50D5C733C' +
'479CE3CB62BC61B3DAB44BF816ECDB3737BD17B67BADFD16F7BB7' +
'E3F46B4E5FAEF6C92B50C45106CB50CB8C5B6D8AE5ACD696CF33A' +
'4D2F0F4586BCBE7795E6BFF0187347E5D');
end;

procedure ClickCircle;
begin
wait(10)
movemouse(x,y)
wait(10)
clickmouse(x,y,true)
end;


Procedure FindCircle;
begin
if(FindBitmap(Bitmap,x,y))then
ClickCircle;
end;

begin
repeat
wait(10)
DeclareBMPS;
FindCircle;
ClickCircle;
until(false)
end.

MujaheD

2006-06-22 02:03:45

That does happen sometimes. look at the bottom left hand corner of scar, you will see the coordinates of your mouse, just make sure it isnt an ab-normal number. if it is just make the desktop as your client window and all should go fine :).

phantombmx

2006-06-22 02:23:16

also, use a smaller bitmap ;)

it is WAY too big.. try making it 10 by 10.. or even smaller.. just make sure its somethin unique..

WT-Fakawi

2006-06-22 03:16:45

cupped and stickyfied. GJ!

MujaheD

2006-06-26 04:13:35

My first sticky and im cupped! thankyou very much fakawi, as for the mouse in the top left corner that is a common problem, try and re specify the client window because after you pick coordinates or colors scar sometimes stuffs up the client window. Comments appreciated greatly, Thanks!

Oh and as for the images being too large i will fix it in the furture (working on one hell of a big script), thanks for your suggestions

Sk84lifesam

2006-07-01 05:41:43

no thank you for all your help ;P

axel2

2006-09-15 15:20:12

gr fudging scar wont let me copy and paste the bitmap code, and im not about to sit there and type it out. Anyone know why it wont let me?

edit:: nevermind

Cheesehunk

2006-09-16 00:32:27

From: axel2
gr fudging scar wont let me copy and paste the bitmap code, and im not about to sit there and type it out. Anyone know why it wont let me?

edit:: nevermind

CTRL+C = Copy.
CTRL+V = Paste.

axel2

2006-09-16 09:12:32

lol im not that bad at scripting cheesehunk : P and i figured it out

bellmi

2006-09-17 20:47:29

program desertminer;
var
x,y,Bitmap:integer;

procedure DeclareBMPS;
begin
Bitmap := BitmapFromString(42, 25, 'z78DAED974B7283300C40' +
'AF84247FC8D27C7CFF23C58358A815A2CE00835BEAC54B2693603' +
'F242425E73B974FD463F2448441D30D382348C6310CD433217553' +
'D797DF0324C9F80AE5D3DCFCF2913CF6FB7419333AEDAEAD258F9' +
'F4DEE6591660C306906A401C77DFEE0CED167F7851CD3E2E6BAC9' +
'745F76BFDADDB40EE575AEE19AF39A3AEEC2DDDA57F2067771E7D' +
'7F85AEE3A07F41D10CF3E5BB7E0BEB1234186C8EF1D61BF137D2B' +
'FF33A56F54D638C304EE2E77F692D4E7711147C8CC8D3CD78E9A4' +
'BB64BEBFA885FE12E8DF86CC53C0230BFB88BAEF471AC0D779957' +
'9A3A2267B9B3857CFAB8D2AEF5569F4454A78FB37D79D275C4B5D' +
'D3EAFC8799E28987A476B4A9157D8BF03DABADE3DE4D01185E04B' +
'5D38D75DC6DADADDEAD49651CD19ACBD2206222F195E3E61E6B89' +
'CE5CE57E39AC634DD8D7EBD4E6587DDB52F5366E315EE5C6D4CEB' +
'DDBA7DC49DBFB9E6B3A0F695316A676ED7B3593D6B7CAF98E75B7' +
'0AFF76DD37DA3F27F98F9BF773DDA5DFF2B5FE6C347B8CB7E277B' +
'D683DDCF9A3F9B76E72EAFEA3C77AEBFED6E756D9E979EE32E679' +
'527B8FFAFD6D61BB4FF29F7');
end;

Procedure ClickBMPS;
begin
wait(300+random(100)
,movemousesmooth(x,y)
,wait(32+random(43)
,clickmouse(x,y,true)
end;

Procedure FindBMPS;
begin
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
end;

begin
repeat
wait(5400)
DeclareBMPS;
FindBMPS;
until(false)
end.

invisible

2006-09-26 06:59:03

Line 3: [Error] (3:1): Identifier expected in script

Identifier is
var

gangstaaa

2006-09-27 14:00:52

tyvm! this is a very helpfull TUT :spot:

imported_snu_woods

2006-09-27 16:02:13

I agree with you Gangstaaa! This was extremely helpful…I learned yet another technique!:spot:

bbri06

2006-10-08 22:57:00

this helped me a ton and cleared up a lot of things thanks for writing and im looking forward to the others

da_professa

2006-10-12 21:16:40

great tut man… I am gettin closer and closer to making my first script..thx alot

mohua

2006-10-20 09:12:31

Well, I tried it a couple of time and it did not work, but I relized that my background and the background of the person who made this tut is different so that why it wasn't finding the icon.
I tried it on several things on my destop and they worked well. However when ever I try it in the RuneScape MiniMap it never finds it. I have tried alot of different things in RS minimap including trees, bridges, etc.
Any idead as to why it isnt working?
P.S. I do drag the cross hairs.

Rohan

2006-11-27 01:16:45

Thanks for this :)

Bitmaps are only covered breifly in the Scar manual so this really helped me.

Thanks for writing this.

twobac

2006-12-19 04:50:35

Thanks for writing this, I now understand so much more about bitmaps

Cheers

MujaheD

2006-12-20 11:17:18

From: mohua
Well, I tried it a couple of time and it did not work, but I relized that my background and the background of the person who made this tut is different so that why it wasn't finding the icon.
I tried it on several things on my destop and they worked well. However when ever I try it in the RuneScape MiniMap it never finds it. I have tried alot of different things in RS minimap including trees, bridges, etc.
Any idead as to why it isnt working?
P.S. I do drag the cross hairs.


Well this can happen for many different reasons, but the two main ones are that the colors in rs changed or you changed the angle* . Im a bit rusty now and this tut was written very long ago so im unfamilier how people use the minimap these days, ill post here as soon as i can invextigate how.

Drakan

2006-12-21 21:15:51

This is a VERY helpful tutorial. I got it in 15 minuets :) Thank you because now i have more knowledge of bitmaps.

brand3n

2006-12-24 04:07:55

Yeah thanks this is great, im trying to make it so it maximizes the scar window but something goes wrong once it tries to click the maximize thing

heres my script

var
x,y,Bitmap:integer;
a,b,Bitma:integer;

procedure DeclareBMPS;
begin
bitmap := BitmapFromString(6, 7, 'z78DA658EC10900300803570A' +
'587400C1FD472A18A4A1DE23603851E091690654B94F2AFF3C54C' +
'3DD6DB267C35413EB7A34DBD77F4E1382FAEA28EAD3B932E43307' +
'');
end;

procedure ClickBMPS;
begin
wait(500+random(60))
Movemousesmooth(x,y)
wait(50+random(50))
clickmouse(x,y,true)
end;


Procedure FindBMPS;
Begin
if(findbitmap(bitmap,x,y))then
ClickBMPS;
end;

Procedure declareMax;
Begin
bitma := BitmapFromString(65, 12, 'z78DAED97D109C0201043577' +
'20AF71FC901A4F224A6BDAB97AF524B083E2FD2DE4B51D404D5EE' +
'FD83C2DACD475CF18C93273B8598B3F02D05FEFC34BF24DBDA7F7' +
'623FEA425488764A440F2108E6475370FF9929F9CF729ECBE51CE' +
'988302CF999D82B2DB3E0A7ACF44A3E098715F23F176CAD548CAA' +
'42BB7B342E1D4ED5C7F6DA59B3500F0EEAE75');
end;

procedure Clickmax;
begin
wait(500+random(60))
Movemousesmooth(a,b)
wait(500+random(50))
clickmouse(a,b,true)
end;

Procedure Findmax;
Begin
if(findbitmap(bitma,a,b))then
Clickmax;
end;




begin
repeat
wait(1000)
DeclareBMPS;
FindBMPS;
wait(1000)
declaremax;
findmax;
until(false)
end.

anandacote

2006-12-26 03:07:39

I can't see the images…:S

Macro_FTW

2007-01-13 22:12:47

GREAT Tutorial. I learned alot using it. Now I can use bitmaps to help me build up my first script! :) *adds to rep*

MujaheD

2007-01-14 11:34:27

From: brand3n
Yeah thanks this is great, im trying to make it so it maximizes the scar window but something goes wrong once it tries to click the maximize thing

heres my script

var
x,y,Bitmap:integer;
a,b,Bitma:integer;

procedure DeclareBMPS;
begin
bitmap := BitmapFromString(6, 7, 'z78DA658EC10900300803570A' +
'587400C1FD472A18A4A1DE23603851E091690654B94F2AFF3C54C' +
'3DD6DB267C35413EB7A34DBD77F4E1382FAEA28EAD3B932E43307' +
'');
end;

procedure ClickBMPS;
begin
wait(500+random(60))
Movemousesmooth(x,y)
wait(50+random(50))
clickmouse(x,y,true)
end;


Procedure FindBMPS;
Begin
if(findbitmap(bitmap,x,y))then
ClickBMPS;
end;

Procedure declareMax;
Begin
bitma := BitmapFromString(65, 12, 'z78DAED97D109C0201043577' +
'20AF71FC901A4F224A6BDAB97AF524B083E2FD2DE4B51D404D5EE' +
'FD83C2DACD475CF18C93273B8598B3F02D05FEFC34BF24DBDA7F7' +
'623FEA425488764A440F2108E6475370FF9929F9CF729ECBE51CE' +
'988302CF999D82B2DB3E0A7ACF44A3E098715F23F176CAD548CAA' +
'42BB7B342E1D4ED5C7F6DA59B3500F0EEAE75');
end;

procedure Clickmax;
begin
wait(500+random(60))
Movemousesmooth(a,b)
wait(500+random(50))
clickmouse(a,b,true)
end;

Procedure Findmax;
Begin
if(findbitmap(bitma,a,b))then
Clickmax;
end;




begin
repeat
wait(1000)
DeclareBMPS;
FindBMPS;
wait(1000)
declaremax;
findmax;
until(false)
end.


Please tell me exacly what went wrong so i can help you fix the problem.

phonokin

2007-01-18 06:40:43

my test script to see if i could get bitmaps to work for me my script succesfully compile and then i run it but it dosent do any thing
the mouse just stays were it is

EDIT:dosent matter i didnt specify rs window it real late were i am
EDIT2:ok still dosent do anything

MujaheD

2007-01-19 00:17:28

From: phonokin
my test script to see if i could get bitmaps to work for me my script succesfully compile and then i run it but it dosent do any thing
the mouse just stays were it is

EDIT:dosent matter i didnt specify rs window it real late were i am
EDIT2:ok still dosent do anything


Ok i had a look at your bitmaps and it seems the bitmaps them selves are a little bit wrecked. Retake the bitmaps and restart the script. Also it would be better gor you to declare all your bitmaps in one procedure, find them in one procedure as well. I could do this for you but it might be better for you to learn, if you need me to tidy up your procedures, kindly ask ;).

Gwallunit

2007-02-19 16:27:09

nice tutorial mate :D

macromacro123

2007-03-02 21:04:39

thx by the way what the heck is a print key

macromacro123

2007-03-02 21:25:32

i created a bitmap and it shows the code on debug box but it wont copy paste…wat im goin to do? i wont just stand there and retype it!

legendaryhero90

2007-03-02 21:26:48

its on your key board or at least it should be

tylanbo

2007-03-13 21:31:15

Not that it makes too much of a difference….but I want it clarified that

random(32)

does NOT make a random number between 1 and 32. It is actually a random between 0 and 31.

Just a heads up..

gsquare567

2007-03-16 23:22:12

From: tylanbo
Not that it makes too much of a difference….but I want it clarified that

random(32)

does NOT make a random number between 1 and 32. It is actually a random between 0 and 31.

Just a heads up..


i figured that out the hard way. im almost finished my ranging script, and its like 1000 lines. i made everything using randoms, but for things like waits it wasnt important that it went 1 below, just for arrays… i hit the run button and i always get 0 when i ask for random(1)… i say, ok, probably just chance, 50/50 can end up that way, its very possible, but like 20 runs later, random(1) = 0. finally, i change about 50 of them to random(1) + 1 so its all good now =) [/offtopic]
ownage leet insane tutorial. :spot: its amazing. i leant so much more than i expected in 3 minutes of my life. i'll post any questions i have after i try it if thats ok. but i gotta say one thing, might sound bad i just wanna make sure u dont miss this:

THE PICTURES OF BMPS DID NOT SHOW UP

great tut, just need a pic or two that work and i'll be able to grasp it full. thanks a lot!
edit: the pic comes after
Retrieving a bitmap
Your probably wondering, how the hell am i suposed to get a bitmap! well dont worry its not rocket science. To get a bitmap simply

* Make sure the bitmap you want is visble on the screen
* Press the print screen key
* Press cntrl + C
* open ms paint
* press cntrl + v
* crop out the image. NOTE: when cropping the image, crop the middle of it because not all of it is needed, look at the picture if your confused.)
* save it somewhere you can remember

Here are some images to aid you:

(this is the invisible pic)

tylanbo

2007-03-17 00:59:58

OMFG!!!!

I have been trying to do bitmaps for a long time and I was always so angry because it never worked :p

Thank you so much I can actually do map walking now lol

EDIT:


Not that it makes too much of a difference….but I want it clarified that

random(32)

does NOT make a random number between 1 and 32. It is actually a random between 0 and 31.

Just a heads up..


I thought I should explain. Maybe it is coded different in SCAR though..but I doubt it :p
Random(32) picks one random number. but it doesnt start at one. Ex:

Random(5) can equal all the following:

0,1,2,3,4

it is 5 numbers, but doesn't start at 0 :)

Hugolord

2007-04-05 08:26:33

ty for script i finally get it tyvm! but one question how do i make script stop after first click? cz it just keeps clicking..

Inf456

2007-05-18 07:23:50

Thanks, this really helped me to understand bitmaps. I will be using this guide to put bitmaps into my first script =]

skibby

2007-05-25 09:48:25

very nice

Tazzie 02

2007-06-13 02:31:27

Nice tut! It really helped me. One thing, I don't know if its been said or not, but you shouldn't use MoveMouseSmooth or ClickMouse. Use Mouse and MMouse. Just make sure that you include SRL though. I know that you guys would know that but, just for the beginners if you know what I mean.

Tazzie

Stevee

2007-06-29 12:42:53

helped me some,,, alot actually lol.

Zeta

2007-08-01 00:30:00

From: phonokin
my test script to see if i could get bitmaps to work for me my script succesfully compile and then i run it but it dosent do any thing
the mouse just stays were it is

EDIT:dosent matter i didnt specify rs window it real late were i am
EDIT2:ok still dosent do anything


same problem here.. my script is

program new;

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers

procedure DeclareBMPS;
begin
Bitmap := BitmapFromString2(True, 'aA1AB578DAED98D9728' +
'42010457F89A6179C4706F5FF3F292C260341465C92B22AE1E1D6' +
'148A1EDBEEDB384A29D0A2FC988292D35EF939059D862F1508F33' +
'20425FD9A611BE7C97AD50385197641E770350907153B137ECF0F' +
'AF46BB97F21C740A4759BD66640C33C662F82DCF78DF70FDFFF19' +
'706BCD59BD26AEB6B6944A51D001A545E1D323069B430DC8D7985' +
'D3128225C1198645AF2787339A78589178CE44DBD22BC997FBA62' +
'82D9AE29662584732452F9224DA1EBD941C04D8A21162870F798A' +
'46C74416C6427BD8EA55D5DA9C5C2B18E14CB582013138E7CA862' +
'6ADBAF85BB40DCDC9D3BBFB11F2167FADF9F92DADC84F7BE30AB9' +
'4CC23836F97B386B4DD912ABE374B4F7901FD32CC78A3C89957EA' +
'82B15AB6AF266E6ECE5CCDCBBF0ABA8FECC87768438A7BDDF063F' +
'141D21EA41E6AA726BDA42F3FBE6DEFEBD37ADBC057E3221A54CA' +
'8BB43912D0D6FCCDDBE8BAA76FBBA5E1ACF9EF32FBE1DC9139B18' +
'51585C39675E895B076D977376E4584E6E4446C23CAA2BE4B11FF' +
'1C882BCD1C17BA2DAE39F3DE4957BD4E4C573A5A7D8D96B767B7E' +
'4FB6449E823CE54616EDDDDE7E5187DA208F116E91B71CE620F9A' +
'51D2A55684DBEECB5AE8A79B797166E9FED4B1BDEFEB9338CF14F' +
'BA549961856A473F3D567D514F7CE53557EDEE4A8DFD6407E1C5D' +
'F62AD98AF44BEDA75DFE01B19DE67CB6D3837F8F308DFFE3F87F7' +
'15F1ABE303122');
end;

procedure ClickBMPS;
begin
wait(300+random(32))
movemousesmooth(x,y)
wait(32+random(16))
clickmouse(x,y,true)
end;


Procedure FindBMPS;
begin
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
end;

begin
repeat
wait(1300)
DeclareBMPS;
FindBMPS;
until(false)
end.

Nose Smasher

2007-08-10 08:28:13

Great TUT Muj. I just recently learned about DTM's, so I decided to learn some about Bitmaps too… ;)

alfonso1024

2007-08-12 15:39:15

hellow i wanted to repeat this bitmap 2 times but like the fisrt time click bank second one click funr examplebut i dont know how X.X does this will work need help thank you!

var//means that these are variables
x,y,Bitmap:integer;//x,y and ie are integers

procedure DeclareBMPS;
begin
Bitmap:= BitmapFromString2(False, 'a621FF78DA95965B76C3200' +
'C44B7041260F3E957F7BFA40243DAA1326EF233E1C880ACCB20C7' +
'39E74E29E2D6AD488C47D5FD2A9AE25AC75FA96A68913651D6F03' +
'BB33D453CADF5277DE5A2CB5EE72C7AD6C8E2EB78A9730E57E7F8' +
'5D42D6538EE0344A82EAAE22016A231F68522732EC269A5F5982D' +
'724B9670FBAC9D61511568ECFE6B022CBE3FCE882CA157D88AA7D' +
'3CD150D814C5AA36FFF4FBB21CD0C5C72BBCAA432E54C779896DA' +
'FDAEA3B9CAF5A97AE72FAEB862A3262371E4F6A9F12667AB35596' +
'2A471AB1CE9695983355BCE7EA52610DAAFBB1C545AC3786AA69A' +
'D2569B570BB7EDC88B1CA21CEBA94239D86A56ADD8B8AB82E1E5B' +
'9F13B17FD8B2CEB2043DD50F8EA52CBBE4236DDDB1A5BC10B1B60' +
'CBD6426C39572448FC2706397DEF816FBC09F6088FD8D9387BB60' +
'99CC28C145396C1A6FEE2F7CF5CCD09E08DF1D5ADB77D6B0BE727' +
'557DB93B2DD09F4C85D834340BEB1BAE9B7E4AE72DFD732B3919F' +
'F6649C0B9334F54EFB9BED7EA8B7114E3E5CBA75DAC4FCC681CF8' +
'4EDADB1E7CB1D63D69D66ACC0B3B11A3AB0A1347469FA120D0CD9' +
'0FCF3CD98DA496DBF0C5793C85815E7B93A12E76E0AC52BE5FC67' +
'53767F4C617B9D313D9FCD9D549F207B4B83CFABD47F0141D8023' +
'AC78CABD8215B7C67CE33EFE4F62B3A023B57189E63FB5F03BD87' +
'7FEAF965F457690C9223EF55C767FA2F70DE28');
end;

procedure ClickBMPS;
begin
wait(300+random(32))
movemousesmooth(x,y)
wait(32+random(16))
clickmouse(x,y,true)
end;


Procedure FindBMPS;
begin
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
end;

begin
repeat
wait(1300)
DeclareBMPS;
FindBMPS;
until(false)
end;

procedure DeclareBMPS;
begin
Bitmap:= BitmapFromString2(False, 'a83A6C78DAEDCDDB0DC430' +
'0844D196885FC49FB113F75FD2325E294DE49E8F31C208CCCC1E8' +
'FB0EB88C87D46D6F144B67AAA5E4D59762769F098AAD359D4AFF3' +
'9DF9FF96FDB4D5237D68C6F3AD8E6BBFEF5329AB1E5DFB7D691B0' +
'00000000000000000000000000000F0593F624');
end;

procedure ClickBMPS;
begin
wait(300+random(32))
movemousesmooth(x,y)
wait(32+random(16))
clickmouse(x,y,true)
end;


Procedure FindBMPS;
begin
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
end;

begin
repeat
wait(1300)
DeclareBMPS;
FindBMPS;
until(false)
end.


when i press run it says
Line 49: [Error] (49:4): period ('.') expected in script





aw and really nice tut omg! i been trying to learn this and now u came up like an angle lol thank you so much ur so cool!!!!!! and if someone can helmp me thank you i be able =) ty

n3ss3s

2007-08-12 16:34:56

Alfonso, bitmaps dont have to be declared every time you use them.
Except for, if you use FreeBitmap(Bitmap: Integer), which is very recommended for antilagg, then you have to load again.

And do you have the "program BlaBlaBla;" at the top of the script?

wabakoo420

2009-01-04 15:28:58

nice tutorial

Kaede

2009-03-10 23:44:16

Useful tut
thanks for this

Ogre

2009-04-01 00:00:14

Is there a bitmap function that clicks on a random place in the found bitmap? because I'm pretty sure it clicks on the same spot each time if you do FindBitamp then Mouse.

mormonman

2009-04-01 00:01:26

… use randomness in your mouse function
Ex:
Mouse(x, y, 5, 5, True);

ian.

2009-04-01 02:20:04

>.>

grave digs :o?