seafight17 Posted September 28, 2012 Share Posted September 28, 2012 hallo the function > function CreateBitmapMaskFromText(Text: AnsiString; Chars: Integer): TSCARBitmap; what actially do? it we a text and ma ke the mask of it? and in cas the text is with bold..or underline ...how it will create.. ex.. in this picture..>> . Uploaded with ImageShack.us it will show me the bitmap (mask of bitmap) of the "(26)Xafies tou Xalbart " + if i try to make it using thme mask cretor... then which is the best gunctio to find it easy? Quote Link to comment Share on other sites More sharing options...
LordJashin Posted September 28, 2012 Share Posted September 28, 2012 (edited) [scar] FindBitmapMaskTolerance(Mask: TSCARBitmap; x, y, x1, y1, x2, y2, Tolerance, ContourTolerance: LongInt): Boolean [/scar] CreateBitmapMaskFromText, uses a FONT SET, OR FONT FAMILY you choose, or from your System. e.g. [sCAR] Bmp := CreateBitmapMaskFromText('TestText', UpChars); [/sCAR] Edited September 28, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
seafight17 Posted October 2, 2012 Author Share Posted October 2, 2012 I try this function but not detesk tthe mask ... any solousion? (SCAR Divi mask) >> [scar]program New; var x,y,x1,x2,y1,y2 : integer; var Mask :TSCARBitmap; procedure LoadBMP; begin Mask :=BmpFromStrLegacy(61, 17, 'beNrtlEEOgCAMBPk2v+fgBdOy' + '3RYwMdk5GNvoMlFoa0LU6BNMEz8TJqwcss58CHCwrzC2O5+ad17dM' + 'DlPOV9tv7ZJ/qVNJrjaeG+DcLc8rt0N4aIfa2f/eOpI8ie6MP1sP9' + 'R2SzwAr44aIYR4MQBiDqGn'); end; procedure Mouse(x, y: Integer); begin MouseBtnDown(x, y, mbLeft); Wait(100); MouseBtnUp(x, y, mbLeft); Wait(50); end; procedure find; begin if FindBitmapMaskTolerance(Mask, x, y, x1, y1, x2, y2, 0, 5) then Mouse(x, y); writeln('scar divi mask found!!'); end; begin LoadBMP; SetClient(TSCARWindowClient.Create(GetDesktopWindow)).Free; repeat find; until false; end. [/scar] Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted October 2, 2012 Share Posted October 2, 2012 (edited) You are not setting x1,y1,x2,y2 before calling FindBitmapMaskTolerance so it is searching the area (0,0) to (0,0) which I suspect is not what you want. Try this: [sCAR]program New; var x,y: integer; B: TBox; Mask: TSCARBitmap; procedure LoadBMP; begin Mask := BmpFromStrLegacy(61, 17, 'beNrtlEEOgCAMBPk2v+fgBdOy' + '3RYwMdk5GNvoMlFoa0LU6BNMEz8TJqwcss58CHCwrzC2O5+ad17dM' + 'DlPOV9tv7ZJ/qVNJrjaeG+DcLc8rt0N4aIfa2f/eOpI8ie6MP1sP9' + 'R2SzwAr44aIYR4MQBiDqGn'); end; procedure Mouse(x, y: Integer); begin MouseBtnDown(x, y, mbLeft); Wait(100); MouseBtnUp(x, y, mbLeft); Wait(50); end; procedure find; begin if FindBitmapMaskTolerance(Mask, x, y, B.x1, B.y1, B.x2, B.y2, 0, 5) then begin Mouse(x, y); writeln('scar divi mask found!!'); end; end; begin LoadBMP; SetClient(TSCARWindowClient.Create(GetDesktopWindow)).Free; B := GetClient.ImageArea; repeat find; until false; end.[/sCAR] Edit: What font is that? Would make helping you much easier if we knew. Edited October 2, 2012 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
LordJashin Posted October 2, 2012 Share Posted October 2, 2012 For the font in the OP's (seafight17) post, he/she would need to create his own font set probably. Or use a font set that supports those characters. It might just be Verdana for all I know. Find a font set that has a lot of characters and looks most similar to the text there. Unicode characters. Need to go look up character encoding again, and fonts, used to be an expert at this stuff... Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted October 2, 2012 Share Posted October 2, 2012 Based on Op's location I suspect he is using a non English locale (which would have a Greek font of some sort built-in). What font exactly would help. Quote Link to comment Share on other sites More sharing options...
seafight17 Posted October 3, 2012 Author Share Posted October 3, 2012 Bixby Sayz When i test the sript withe Scar divi mask it works fine..if i try to use any other mask (like the one i need for the game) it no detect it ..even with raisng the tolerance..? Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted October 3, 2012 Share Posted October 3, 2012 I have to confess I did not understand what you said there. Quote Link to comment Share on other sites More sharing options...
seafight17 Posted October 3, 2012 Author Share Posted October 3, 2012 When i "run" th sript.. it works fine... it detect (find) the "mask" (which is the mask of thw word >>"SCAR") IF i change the mask ..with onother one.. (pisture to string >mask editor) and replace it....The sctript no respond..no detech the new mask .. What i should d to detect it? Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted October 3, 2012 Share Posted October 3, 2012 It is always the exact same text or does the text vary? If so what is the possible text? Quote Link to comment Share on other sites More sharing options...
seafight17 Posted October 5, 2012 Author Share Posted October 5, 2012 when it is exatly the same it works ..but if it diference just a litle bit it no working ... Quote Link to comment Share on other sites More sharing options...