Results 1 to 17 of 17

Thread: Bitmap finder

  1. #1
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bitmap finder

    I'm sorry if this is in wrong section, but i tried to get into scripting by doin' bitmap finder tut.

    My problem: The tut is for older version of scar/srl.

    So could some one please make updated tutorial or post me how i should write bitmap finder script.

  2. #2
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    isn't it working anymore then?

    i think there is nothing changed about the bitmaps.

    (some-one correct me if i'm wrong)

    Gl scripting/botting!

  3. #3
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    bitmap find and stuff is almost the same i think its the same only you use other procedures functions, just read A tut about it and then use

    stuff like:---->
    SCAR Code:
    // * function FindBitmapsProgressiveTol(bmp1,bmp2,bmp3,bmp4,bmp5,tolmax,step,xs,ys,xe,ye:integer):boolean; // * by Stupid3ooo
    // * Function FindDeformed(var Xoff,Yoff: integer; BMP,a,b,c,d: integer): Boolean;                         // * by WT-Fakawi

    there are more Stuff like -->

    SCAR Code:
    FindBitmap(RedDot, x, y, 0, 0, 0, 0);//or somthing like that
    but i could find them for now, in the include im sorry

  4. #4
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    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: Integer; 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: Integer; 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.
    hermpie: SCAR CDE Manual

    press F1 in scar to view the SCAR CDE Manual

    EDIT: lol 1100 post

  5. #5
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default yeah, but...

    I used the most popular example from tutorial island, and i got this error while compiling: "unknown identifier 'x' in line 33"

    or something like that.

  6. #6
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You have that error because in the new srl (srl 4+) dont have the vars x and y declared.

    put under
    program <name>
    var
    x, y: Integer;

    then it will probably work

  7. #7
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok. that was what I meant....
    But thanks guys (and/or girls)

  8. #8
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program BitmapFinder;

    begin
      LoadBitmap;
      FBitmap;
      FreeBitmap(copper)
    end.

    procedure LoadBitmap;
    begin
     copper := BitmapFromString(32, 30, 'beNrllvFn1GEcx/f8FRGnOe' +
           'ecc865c+5sZtllsx3NXNq41qbOVleW1daaTTNKv6QfIiIiIiIREYl' +
           'IJJGIJPpbet3eu889z92Ju7afOh9fz909z+t5f9+fz/P5fgcG/o+P' +
           'a8ahwMsjydnxTHUy523hwugfXirEK6U08OsLJb5mBge5PjgVe1xNP' +
           'D2beDQXvzcT+4ctGuIFF5+4XY4Cf7aQfL+S+XWzwBbNffvhG1z8a2' +
           'MRxAN/W0//2Mr/3C4wtvvq3THnK5d4bHm9nP66kfu+mScY6y9ytFw' +
           'ZWpkbWa2O9uhYK62If1lLfbqa/XYjT7ALLvH7cCbKnULePHdiuzbO' +
           'Xt22cN0imCDbv6zn/FAZyMmdpYk7l8teMbTWFlIRZIzmYhNDCdI6f' +
           'Ty1JyPgv7mY/ryWU/gymAxfcGL3wmTId9nEUepQdT5fztdmily9mn' +
           'cbpcjzxaTPZLlC5uO84OLjkm8s4lXnYBdPFsgUV8Y2Z3fqGKlEP/k' +
           '1uC1nJsBb9SngXLkRT38jO4TEg0U8YrgyNv7d6Sh8zP9wJfNqKRWm' +
           'ximzyBY/FODwnDDx9dPDa/Nj3AJbGIfKgY/tJJSyeXfJrxCHHnIqf' +
           'mj+PpwCMGdMDGODcGbF17EiqFKvxhoD5bdNPGQVjDkjJQQ3YvwX55' +
           'NoRvnvnSJtAT5jtlD9M8GOcFtqVIokV+JxBhkK9jJ5iMd5mMAJ7oL' +
           'xx9Vs22EJ4Y2FVpYSTxkIziA86U4nCzJ8OoNOFh2JFnq/EiNBXc+s' +
           'n1ZsF1nBvbT1fAyBjDlc+VorHtkajzycjZMd/dLRSJ1sJ7BdWHaxM' +
           'H/kHgNsga/tOHSI50SQd37vymeVCtIn+64qNcxppqNVMxyKJ2cS+A' +
           'ZcHaOTzyrCIwcN0+DkoqPxOuCcNcHJNQXQ2RJRHmpu/UVdGdx7ELQ' +
           'm8JQx5d2K8++vB43U63mh1HjpaF9rva6XB2Wja/n8sCXuf3rHBqVl' +
           'fB2KvRQc2JuPTpwSBFyN6wD5el6rdIGr8R7Om2Ff2D8kdpEB');
    end;

    procedure FBitmap;
    begin
    FindBitmapToleranceIn(copper, x, y, 560, 214, 734, 457, 25);

    end.

    And now I have this error: Line 5: [Error] (4:11): Invalid number of parameters in script

  9. #9
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol! you can only call procdures declared above and if you look got your asking for fbitmap and that below and btw that the main loop..

    SCAR Code:
    program BitmapFinder;
     

    procedure LoadBitmap;
    begin
     copper := BitmapFromString(32, 30, 'beNrllvFn1GEcx/f8FRGnOe' +
           'ecc865c+5sZtllsx3NXNq41qbOVleW1daaTTNKv6QfIiIiIiIREYl' +
           'IJJGIJPpbet3eu889z92Ju7afOh9fz909z+t5f9+fz/P5fgcG/o+P' +
           'a8ahwMsjydnxTHUy523hwugfXirEK6U08OsLJb5mBge5PjgVe1xNP' +
           'D2beDQXvzcT+4ctGuIFF5+4XY4Cf7aQfL+S+XWzwBbNffvhG1z8a2' +
           'MRxAN/W0//2Mr/3C4wtvvq3THnK5d4bHm9nP66kfu+mScY6y9ytFw' +
           'ZWpkbWa2O9uhYK62If1lLfbqa/XYjT7ALLvH7cCbKnULePHdiuzbO' +
           'Xt22cN0imCDbv6zn/FAZyMmdpYk7l8teMbTWFlIRZIzmYhNDCdI6f' +
           'Ty1JyPgv7mY/ryWU/gymAxfcGL3wmTId9nEUepQdT5fztdmily9mn' +
           'cbpcjzxaTPZLlC5uO84OLjkm8s4lXnYBdPFsgUV8Y2Z3fqGKlEP/k' +
           '1uC1nJsBb9SngXLkRT38jO4TEg0U8YrgyNv7d6Sh8zP9wJfNqKRWm' +
           'ximzyBY/FODwnDDx9dPDa/Nj3AJbGIfKgY/tJJSyeXfJrxCHHnIqf' +
           'mj+PpwCMGdMDGODcGbF17EiqFKvxhoD5bdNPGQVjDkjJQQ3YvwX55' +
           'NoRvnvnSJtAT5jtlD9M8GOcFtqVIokV+JxBhkK9jJ5iMd5mMAJ7oL' +
           'xx9Vs22EJ4Y2FVpYSTxkIziA86U4nCzJ8OoNOFh2JFnq/EiNBXc+s' +
           'n1ZsF1nBvbT1fAyBjDlc+VorHtkajzycjZMd/dLRSJ1sJ7BdWHaxM' +
           'H/kHgNsga/tOHSI50SQd37vymeVCtIn+64qNcxppqNVMxyKJ2cS+A' +
           'ZcHaOTzyrCIwcN0+DkoqPxOuCcNcHJNQXQ2RJRHmpu/UVdGdx7ELQ' +
           'm8JQx5d2K8++vB43U63mh1HjpaF9rva6XB2Wja/n8sCXuf3rHBqVl' +
           'fB2KvRQc2JuPTpwSBFyN6wD5el6rdIGr8R7Om2Ff2D8kdpEB');
    end;
     
    procedure FBitmap;
    begin
      FindBitmapToleranceIn(copper, x, y, 560, 214, 734, 457, 25);
    end.

    begin
      SetupSrl;
      LoadBitmap;
      FBitmap;
      FreeBitmap(copper)
    end.

  10. #10
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK.... now i feel ebarrased....

  11. #11
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And now I got this: Line 6: [Error] (6:1): Unknown identifier 'copper'

  12. #12
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program whatever;

    var
    copper : integer
    {rest of code}
    ~ Metagen

  13. #13
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program BitmapFinder;

    var
    copper : integer

    procedure LoadBitmap;
    begin
     copper := BitmapFromString(32, 30, 'beNrllvFn1GEcx/f8FRGnOe' +
           'ecc865c+5sZtllsx3NXNq41qbOVleW1daaTTNKv6QfIiIiIiIREYl' +
           'IJJGIJPpbet3eu889z92Ju7afOh9fz909z+t5f9+fz/P5fgcG/o+P' +
           'a8ahwMsjydnxTHUy523hwugfXirEK6U08OsLJb5mBge5PjgVe1xNP' +
           'D2beDQXvzcT+4ctGuIFF5+4XY4Cf7aQfL+S+XWzwBbNffvhG1z8a2' +
           'MRxAN/W0//2Mr/3C4wtvvq3THnK5d4bHm9nP66kfu+mScY6y9ytFw' +
           'ZWpkbWa2O9uhYK62If1lLfbqa/XYjT7ALLvH7cCbKnULePHdiuzbO' +
           'Xt22cN0imCDbv6zn/FAZyMmdpYk7l8teMbTWFlIRZIzmYhNDCdI6f' +
           'Ty1JyPgv7mY/ryWU/gymAxfcGL3wmTId9nEUepQdT5fztdmily9mn' +
           'cbpcjzxaTPZLlC5uO84OLjkm8s4lXnYBdPFsgUV8Y2Z3fqGKlEP/k' +
           '1uC1nJsBb9SngXLkRT38jO4TEg0U8YrgyNv7d6Sh8zP9wJfNqKRWm' +
           'ximzyBY/FODwnDDx9dPDa/Nj3AJbGIfKgY/tJJSyeXfJrxCHHnIqf' +
           'mj+PpwCMGdMDGODcGbF17EiqFKvxhoD5bdNPGQVjDkjJQQ3YvwX55' +
           'NoRvnvnSJtAT5jtlD9M8GOcFtqVIokV+JxBhkK9jJ5iMd5mMAJ7oL' +
           'xx9Vs22EJ4Y2FVpYSTxkIziA86U4nCzJ8OoNOFh2JFnq/EiNBXc+s' +
           'n1ZsF1nBvbT1fAyBjDlc+VorHtkajzycjZMd/dLRSJ1sJ7BdWHaxM' +
           'H/kHgNsga/tOHSI50SQd37vymeVCtIn+64qNcxppqNVMxyKJ2cS+A' +
           'ZcHaOTzyrCIwcN0+DkoqPxOuCcNcHJNQXQ2RJRHmpu/UVdGdx7ELQ' +
           'm8JQx5d2K8++vB43U63mh1HjpaF9rva6XB2Wja/n8sCXuf3rHBqVl' +
           'fB2KvRQc2JuPTpwSBFyN6wD5el6rdIGr8R7Om2Ff2D8kdpEB');
    end;

    procedure FBitmap;
    begin
    FindBitmapToleranceIn(copper, x, y, 560, 214, 734, 457, 25);

    end.

    Line 7: [Error] (6:1): Semicolon (';') expected in script

    I really feel like stupid noob!

  14. #14
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    just like it says...put a semicolon after integer



    SCAR Code:
    program BitmapFinder;
     
    var
    copper : integer;  // <--- here
     
    procedure LoadBitmap;
    begin
     copper := BitmapFromString(32, 30, 'beNrllvFn1GEcx/f8FRGnOe' +
           'ecc865c+5sZtllsx3NXNq41qbOVleW1daaTTNKv6QfIiIiIiIREYl' +
           'IJJGIJPpbet3eu889z92Ju7afOh9fz909z+t5f9+fz/P5fgcG/o+P' +
           'a8ahwMsjydnxTHUy523hwugfXirEK6U08OsLJb5mBge5PjgVe1xNP' +
           'D2beDQXvzcT+4ctGuIFF5+4XY4Cf7aQfL+S+XWzwBbNffvhG1z8a2' +
           'MRxAN/W0//2Mr/3C4wtvvq3THnK5d4bHm9nP66kfu+mScY6y9ytFw' +
           'ZWpkbWa2O9uhYK62If1lLfbqa/XYjT7ALLvH7cCbKnULePHdiuzbO' +
           'Xt22cN0imCDbv6zn/FAZyMmdpYk7l8teMbTWFlIRZIzmYhNDCdI6f' +
           'Ty1JyPgv7mY/ryWU/gymAxfcGL3wmTId9nEUepQdT5fztdmily9mn' +
           'cbpcjzxaTPZLlC5uO84OLjkm8s4lXnYBdPFsgUV8Y2Z3fqGKlEP/k' +
           '1uC1nJsBb9SngXLkRT38jO4TEg0U8YrgyNv7d6Sh8zP9wJfNqKRWm' +
           'ximzyBY/FODwnDDx9dPDa/Nj3AJbGIfKgY/tJJSyeXfJrxCHHnIqf' +
           'mj+PpwCMGdMDGODcGbF17EiqFKvxhoD5bdNPGQVjDkjJQQ3YvwX55' +
           'NoRvnvnSJtAT5jtlD9M8GOcFtqVIokV+JxBhkK9jJ5iMd5mMAJ7oL' +
           'xx9Vs22EJ4Y2FVpYSTxkIziA86U4nCzJ8OoNOFh2JFnq/EiNBXc+s' +
           'n1ZsF1nBvbT1fAyBjDlc+VorHtkajzycjZMd/dLRSJ1sJ7BdWHaxM' +
           'H/kHgNsga/tOHSI50SQd37vymeVCtIn+64qNcxppqNVMxyKJ2cS+A' +
           'ZcHaOTzyrCIwcN0+DkoqPxOuCcNcHJNQXQ2RJRHmpu/UVdGdx7ELQ' +
           'm8JQx5d2K8++vB43U63mh1HjpaF9rva6XB2Wja/n8sCXuf3rHBqVl' +
           'fB2KvRQc2JuPTpwSBFyN6wD5el6rdIGr8R7Om2Ff2D8kdpEB');
    end;
     
    procedure FBitmap;  // <--- if this is your main loop then delete it...(if not then change the end. to end;
    begin
    FindBitmapToleranceIn(copper, x, y, 560, 214, 734, 457, 25);
     
    end. // <---- change to semicolon if its not your main loop
    METAL HEAD FOR LIFE!!!

  15. #15
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    LOL i thought that looked wrong when i wrote it... im like ummm

    copper : integer... looks kindof plain.

    soz about that m8
    ~ Metagen

  16. #16
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    that bitmap is much number and stuff thats an ''integer'' so you need it to declare like an integer

    Copper: integer; <---- like the others said dont forget that!

  17. #17
    Join Date
    Sep 2007
    Location
    Finland
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    K m8.

    If u see more things i should/could correct just tell me!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating a pick head finder, and gas finder
    By Tom_Gower in forum OSR Help
    Replies: 7
    Last Post: 11-07-2008, 07:06 AM
  2. Find Bitmap in Bitmap file
    By fORCE_wORKS in forum RS3 Outdated / Broken Scripts
    Replies: 8
    Last Post: 12-13-2007, 11:04 PM
  3. Replies: 5
    Last Post: 10-30-2007, 08:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •