Results 1 to 5 of 5

Thread: Bitmap help

  1. #1
    Join Date
    Apr 2007
    Location
    Estonia
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default Bitmap help

    Hey, made script to identify different bitmaps on a flash game, but later discovered that sometimes it founds it and sometimes not, so the problem seems to be that sometimes the numbers change a bit:

    800% zoom:
    m7qw.png

    Normal:
    qulz.png

    Pixels shifted a little, that might be the problem why it doesn't find it sometimes?
    Any ideas what method I can use to successfully find it every time?

    Script I used:

    Code:
    program birmap;
    {$i srl/srl.simba}
    
    Var //Variables are declared here
    blk2, blk3, blk4, blk5, blk6, blk7, blk8, blk8, blk9, blk10:Integer;
    
    
    begin
      cleardebug;
      MouseSpeed := 19;
      blk3 := BitmapFromString(6, 11, 'meJx79OiRhcX3np7XDx48uH///r1' +
            '794AkA8P//Px3d8Hgzp075ubfgCLS0r/MzL6ZmX0FIiAXDS1a9BBI' +
            'BgR8WLDgganpF17eP9euXQOKZGW92rnzJpCRmfniypUrEIaJyWcpq' +
            'Z+HD1+6ePEiUATIBZKNjQ/PnTt3/vx5iIFqal/PgMHZs2chIjNn3j' +
            'gDA8bGn3x8XsO5ACjNcpI=');
    
      if (FindBitmapToleranceIn(red4, x, y, 0, 0, 700, 700, 80)) then
        begin
          Writeln('Found red 4')
          Mouse(x, y, 5, 5, 0);
      end;
    
    FreeBitmap(blk3);
    
    End.
    ROCK IS NOT A DEVILS WORK, ITS MAGICAL AND RAD!

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    So you're saying that sometimes the spacing between the two sixes (in your specific example) changes from time to time making your bitmap not work?

    This is similar to uptext on RS (when you hover over an item the text on the top left of the scree has dynamic spacing, very noticeable).

    I THINK if you make your own font of those letters, you will be able to use Simba/SRLs text finding functions, some of which are very powerful and can account for odd shits and changes in the text/font and solve your problem.

    It's not too difficult to do, but I'm not sure if there are super many resources on how to make your own font and use use the text finding functions.

    Try searching SRL(or google for results on SRL) for how to make your own font.
    Then check in text.simba file for functions that might be of use to use and have nice parameters for text that moves/has odd spacing.

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    In actionscript 3/FLEX the coordinates aren't integers but numbers(Extended, Double, Real). An effect is that numbers are not alligned perfectly at certain pixels. What you see here is that the number moved, the six is no longer at an exact position. The difference you see is created by the smoothing system.

    Solutions can be to search for a deformed bitmap or use DTMs.
    Working on: Tithe Farmer

  4. #4
    Join Date
    Apr 2007
    Location
    Estonia
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    YoHoJo, no the left 6 is what i used for bitmap and it didn't find the right one. Was thinking about creating new font also but too much work, maybe trying DTMs


    masterBB, tried deformed bitmaps also, still missed some if (FindDeformedBitmapToleranceIn(nlk3, x, y, 0, 0, 700, 800, 20, 1, acc)) then ...

    EDIT: DTMs finds it but also missclicks to other numbers, they are too small to create accurate DTMs that doesn't mix with other numbers
    Last edited by neeger; 07-22-2013 at 06:11 PM.
    ROCK IS NOT A DEVILS WORK, ITS MAGICAL AND RAD!

  5. #5
    Join Date
    Aug 2013
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default

    You should rather create custom font and use OCR

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
  •