1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SCAR Bitmaps Tutorial - Kane

Discussion in 'Code Snippets and Tutorials' started by Anonymous, Dec 22, 2006.

  1. Anonymous

    Anonymous Guest

    SCAR Bitmaps Tutorial

    CREATED BY KANE

    Getting Your Image
    To make a bitmap you have to get the image first. This can be done by taking a screenshot of the screen. Go to where the bitmap is, then, on your keyboard there should be a key that says something around Print Screen, Press it. Now the screen well be saved into the Clipboard. As you can see in the image below, I will be using Scars play button as my image. Just pretend i just took a screenshot of scar, continue below.


    [​IMG]

    Cropping + Saving The Image
    Now that you have the image saved to the clipboard, go to MSPaint or whatever program you use as imaging software, Then click Edit, Then Paste. Your screen or image should be there. Crop around your image ( Cropping Is Cutting around it ), So it's just the image. Now copy the image you have, Open up a new MSPaint Document ( or other imaging program ) Document and Click Edit then paste. Now the small version of the image should be there. This is your bitmap. If you want scar to find just the bitmap then you color the bitmaps background black, but leave the bitmap the same. ( I didn't color the background in myne ), Now click File, save as and save the image wherever you want, Name the image anything.

    Getting The Bitmap Into Scar
    Now that you've saved the bitmap, we need to get it into scars code. Go into scar, Click script then click Picture to String like below :


    [​IMG]

    One you've clicked that a pop-up should come up, click Open:

    [​IMG]

    Once you have clicked Open another pop-up should come up. Find where you saved the image, select it and then click open.

    [​IMG]

    Now you should have some coding in the debug box of scar. This is the code that scar has generated from the bitmap. Scar recognizes this as an image and can re-generate it back to an image via Clicking Edit > String To Picture

    [​IMG]

    Placing The Bitmap Into Scar
    By now you should have Saved your bitmap, opened your bitmap into scar And this is what you should have (Image above). Now, select everything from the bottom of the bitmap up to where its name is "BitmapsName := ". Remember, if you saved the image with a different name it will have the name of your bitmap instead of "BitmapsName", i only have this because thats what i saved it as. Now copy from the bottom to the name and paste it between "Begin" and "End.", or wherever you want it to go. You should have this:


    [​IMG]

    Declaring The Bitmap
    Since we have now put the bitmap into scar we have to tell scar what it is. This can be done by declaring it as an Integer variable.


    [​IMG]

    Whatever the name of your bitmap is, thats what the integer is called. If your bitmap was named "Deathader" then you would do this :
    Code (Text):
    1.  
    2. var
    3. Deathader: Integer;
    Using The Bitmap In A Script
    Now, In this example script i'm going to be using "FindBitmap", this is a function that, if it finds the bitmap, will return as true. To use this, we need to declare x and y as a variable.

    [​IMG]

    These are the co-ordinate variables of the location of the Bitmap. If it is left as x and y and no numbers are in there then it will search the whole client for the bitmap. If they're are numbers in there and it's not left as x and y it will not need the variables x and y declared. Below we will make it that if it finds the bitmap it will write in the debug box "Found The Bitmap.".

    [​IMG]

    Now that that's done, we can finally play the script and see if it works. But before that we need to select the client of where we want to find the bitmap, this can be done by using the crosshairs.

    [​IMG]

    Click and drag them over the client, then release. 2 Box's overlapping each other will square the client. Now you have specified it and told the script this is where I want the script to focus on.

    After Specifing The Client With The Crosshairs Click Play

    Clicking Play Will Start The Script. I specified where the play button is for me.


    [​IMG]

    Now the script should start, Below is my result:

    [​IMG]

    This means that my script has found the bitmap!. If your script just says

    Code (Text):
    1. Successfully Compiled
    2. Successfully Executed
    This means that your script hasn't found the bitmap.

    --------------------------------------------------------------------------------


    If you do use this tutorial, Remember to crop the image smaller. I made that bitmap way to big, afterall, this is about 5 months old. When cropping get the most detailed pixels of the bitmap.

    If it's blended with other things, try and get as much detail of just those pixels whilst trying to keep the bitmap small, but if you must, you can go big.

    Bigger bitmaps will take more seconds to load and find, though.


    CREDITS
    • Kane (another forum)
      Expon
      My best friend (taught me SCAR)
      Kaitnieks (Creator of SCAR)
     
  2. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Great work!!! Thanks, I think I'll start making SCAR scripts
     
  3. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    great guide
    going to use it as soon as i need to
     
  4. Anonymous

    Anonymous Guest

    thanks.

    and congratz on level 2.
     
  5. Underground_Secrets

    Joined:
    Dec 22, 2006
    Messages:
    626
    Likes Received:
    1
    Gender:
    Female
    Location:
    West Coast in USA
    wat does finding bitmap do? wats its perpouse?
    Do not gravedig. L.scorpio
     
  6. Anonymous

    Anonymous Guest

    gravedig/10

    a bitmap is a pcture a script looks for.


    eg.
    If I made an auto login, I would make my script look of the button that says "login", then make it click it.