Results 1 to 16 of 16

Thread: I'm having Bitmap Detection issues. What am I doing wrong?

  1. #1
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default I'm having Bitmap Detection issues. What am I doing wrong?

    I tried to make a simple little detection program just to detect this button here on a firefox webpage. But I am having problems because my script can't find this bitmap.


    SCAR Code:
    program New;// Trying to detect the button through bitmap.

    var BattlegroundsN: integer;


    procedure Setup;
    begin
      BattlegroundsN := BitmapFromString(23, 11, 'beNpjYPhPMWBgABnyfi4vMnoxhYc' +
           'BCUAE0bjICGLIg4kouuBcAzY2NBFkNciCQEPuTEBRA+Fy83BjCiJz' +
           'kUWAhlztQVF/rpkLSPLwgtx5vgUqhaYGyEUWARpypBHBhbMFODiQu' +
           'UDGQUYuZGXIuoCG7K/lQrYFmQtkIyM0cWRDtleAuNasrBARCBcINh' +
           'dywtlbirjgbIgaZC7QkAUFnMgugXOBDGQpNDYyF5JaBh4AAChnsJA' +
           '=');
    end;

    procedure ClickBattlegrouds;
    var
      x,y:integer;
    begin
      if(FindBitmapToleranceIn(BattlegroundsN,x,y,0,0,900,900,5)) then
      begin
        writeln('found');
      end else
      begin
        writeln('not there');
      end;
    end;

    begin
      Setup;
      ClickBattlegrouds;
    end.

    I thought I did something wrong somewhere, and went back to the beginner tuts. I then tried out one of Bebe's example program. Which looked exactly the same as mine, except that one actually works.

    SCAR Code:
    program New;

    var
     WillowLog2: integer;

    procedure LoadBitmap;
    begin
     WillowLog2 := BitmapFromString(31, 25, 'beNqtlkFLAzEUhJujWBS' +
           'V6qUHeyhqUcuKFUUKVihUFEVRoSAUPPn/f4GzjAyv+zZpsLvMoTTd' +
           'L5O8eUlbrfWesKymnpJ22N3o9zYH/fbwZOvyfLshfhBzPNq9Lnagb' +
           'HhIC5zJzR6wVnnw8l1YguANDmUS9gAB1isPHt4eBx/Pp1/vw+m4Q3' +
           'mUhjRK+EGnneSH7/kF9XC37/kWa0U4VpcPt3yJ31sJvnJbBF98Fpb' +
           'vmRJWhHKssl0PT4g7RtsoeryV/mImuN2cGJPxZq6gyW3vqug6fmAj' +
           'QAmyiissxReZdtNNnCI8TY+wCWoHkm0aGXuPUuxVFzs7p0C2AQdt/' +
           'nrGH5Msbx7rw+l3jPCfxYhWBUcfvcyOKw3urfp8erjiITjnwhSxro' +
           'kl38PBIRwfaDuW9pyGqsBh2MJtYBLwvIYqCyo4bOc4r00pc8iz1KS' +
           '95MM/hBXN7vu1fZooH5S88paGYq1kz0kHzL3FrHOZ19G99o0cKtvS' +
           'BLPKp+Gm/zlUCvGv5xdCwRWZ');
    end;

    procedure FBitmap;
    var
     x, y :integer;
    begin
     if(FindBitmapToleranceIn(WillowLog2, x, y, 0, 0, 900, 900, 25)) then
     writeln('found');
    end;

    begin
      LoadBitmap;
      FBitmap;
    end.

  2. #2
    Join Date
    Jun 2007
    Location
    US
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is that bitmap within the range you specified (0, 0, 900, 900)?

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Based on what information has been given, I am almost certain that the problem lies in the tolerance which you specify.

    In the first example you have '5' whilst in the second there is '25'.

  4. #4
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could also try resizing the bitmap to make it smaller and easier to find.

  5. #5
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    @bloooblooo. yes it is within range. (the button is in the top right corner of web.).

    @NaumanAkhlaQ. I took an exact copy of part of the bitmap as I see it (the picture NEVER CHANGES)I just used tolerance because maybe it would work. But the basic "Findbitmap" should work for this, yet it doesn't.

    @r!ch!e. The bitmap is already pretty tiny. you can do string to bitmap and take a look

    It's on this site. http://www.warstorm.com

    When you login into the game you will be able to see the button. you can use my login to check.
    email: personaltest@live.com
    pass: 123abc
    Last edited by mrpickle; 08-15-2009 at 12:16 AM.

  6. #6
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use FindColorTolerance with a really high tolerance .

  7. #7
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Try using this procedure:

    SCAR Code:
    Procedure ClickBGButton;
    Begin
      If FindBitmap(BitmapFromString(7, 3, 'beNrj519TwAlBs3y4/bm57bm4Jtlxr' +
           'cjjBKLpXlw1QrxKPDxhPLwzA7haVLhqhXlDBPjVBASFhEX0BIUiAB' +
           'HuDlw='), x, y) Then
      ClickMouse(x, y, True);
    End;

    Begin
      ClickBGButton;
    End.

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

    Default

    Try ActivateClient; .
    Could solve the problem, since the focus sometimes messes up.
    ~Hermen

  9. #9
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Tried adding Activate client, tried increasing more tolerance (it only says found when I put it as 274 or higher) just to detect the picture I posted on the board here. Can't find it.

    does this work for any of you guys? i'm started suspect my computer to have issues.

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

    Default

    Site? Then I can try something...
    ~Hermen

  11. #11
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I tried different things and nothing worked. It always moves the mouse to (0,0). Try testing things out on less Flash based websites/buttons. Try the Wikipedia or Google logo for example and see if you can get it to work.

    Edit: Herman, he said the website was http://www.warstorm.com

  12. #12
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    ah. well, i would love it if there is a way to get the bitmap detection working. That way I dont have to just rely on coordinate clicking all the time.

    @r!ch!e I have tried out on regular things such as Runescape, My desktop, and Magic Online (yes, a sudden interest in card games). Worked fine .

    I tried on google, wiki logos. Both did not work for me.
    I guess Scar just can't detect this yet then? =\

    eg.
    SCAR Code:
    //www.wikipedia.org
    Procedure look;// doesn't say 'found =[

    var x,y:integer;

    Begin
      If FindBitmap(BitmapFromString(41, 4, 'beNrFUD2qg2AQ/BAR8RQWHiB4gGBj' +//part of wiki's logo
           'nzPYi1dQEUmZQrAVsc8BgqAm4g8iImqw8im+wlu8QXm5QqZYZvebb' +
           '2d3Cfnd8bNjmibE9/sdBIGqqrIs3263vu89zxMEIQzDbdu6rkPxfD' +
           '7XdT3Pc1EUTdNUVXW/3zVNcxxnWZa2bfM8L8sSr8/nEx/TNH29XnE' +
           'c67oeRdHj8SCErOsKzvP85XIxDMOyrOv1Sv7BcRzENE2DQzaOI4wk' +
           'SUKKGVBB+okoKooCMgwDrEGOCFNYg9i2jW5wQYSYoiiWZUGwl+/72' +
           'DragRnYHXhiGAbiJEk+FqZpwhpplmWo4ALHRsfAaIKVUcfWiBCLoo' +
           'hWp9MJGtd1cRbyRfwBizDNkA=='), x, y) Then
      writeln('found');
    End;

    Begin
      look;
    End.

  13. #13
    Join Date
    May 2008
    Location
    Oregon, USA
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are you sure the bitmap was made correctly? are there problems with it possibly? that could be the source of your error.

  14. #14
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by mrpickle View Post
    ah. well, i would love it if there is a way to get the bitmap detection working. That way I dont have to just rely on coordinate clicking all the time.

    @r!ch!e I have tried out on regular things such as Runescape, My desktop, and Magic Online (yes, a sudden interest in card games). Worked fine .

    I tried on google, wiki logos. Both did not work for me.
    I guess Scar just can't detect this yet then? =\

    eg.
    SCAR Code:
    //www.wikipedia.org
    Procedure look;// doesn't say 'found =[

    var x,y:integer;

    Begin
      If FindBitmap(BitmapFromString(41, 4, 'beNrFUD2qg2AQ/BAR8RQWHiB4gGBj' +//part of wiki's logo
           'nzPYi1dQEUmZQrAVsc8BgqAm4g8iImqw8im+wlu8QXm5QqZYZvebb' +
           '2d3Cfnd8bNjmibE9/sdBIGqqrIs3263vu89zxMEIQzDbdu6rkPxfD' +
           '7XdT3Pc1EUTdNUVXW/3zVNcxxnWZa2bfM8L8sSr8/nEx/TNH29XnE' +
           'c67oeRdHj8SCErOsKzvP85XIxDMOyrOv1Sv7BcRzENE2DQzaOI4wk' +
           'SUKKGVBB+okoKooCMgwDrEGOCFNYg9i2jW5wQYSYoiiWZUGwl+/72' +
           'DragRnYHXhiGAbiJEk+FqZpwhpplmWo4ALHRsfAaIKVUcfWiBCLoo' +
           'hWp9MJGtd1cRbyRfwBizDNkA=='), x, y) Then
      writeln('found');
    End;

    Begin
      look;
    End.
    Its not SCAR, its you. Your proberly just not doing the bitmaps properly.

  15. #15
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    your prolly right, but I cant seem to fix my problem =\. i've done bitmaps the same way I've always done it. it worked before...

  16. #16
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    mrpickle, I love you.



    PS, FindColorsTolerance

Thread Information

Users Browsing this Thread

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

Posting Permissions

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