-
2 Attachment(s)
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:
Attachment 21947
Normal:
Attachment 21948
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.
-
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.
-
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.
-
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
-
You should rather create custom font and use OCR