dimitri66 Posted January 19, 2013 Share Posted January 19, 2013 Hello I have no idea about scripting and I need help for a simple (I think) script I want a key stroke when an image apears in the screen. Thank you Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2013 Share Posted January 19, 2013 We need more information.. 1. Is there just 1 image or multiple? 2. Can you show pictures (.png's or .bmp's, for quality) of the image(s)? 3. What keystroke(s) do you want SCAR to hit when image appears in screen? Quote Link to comment Share on other sites More sharing options...
dimitri66 Posted January 19, 2013 Author Share Posted January 19, 2013 We need more information.. 1. Is there just 1 image or multiple? Yes is one small image 2. Can you show pictures (.png's or .bmp's, for quality) of the image(s)? If I have the scrip I can load bitmap on the write place 3. What keystroke(s) do you want SCAR to hit when image appears in screen? number 0 Thank you Quote Link to comment Share on other sites More sharing options...
Ranqers Posted January 19, 2013 Share Posted January 19, 2013 (edited) [scar]program findBMP; var x,y,IMG: Integer; procedure LoadBMP; begin IMG := TSCARBitmap.Create('deNpjZGBk+P//PwAGDQMA'); //Change this with the BMP code you made for your image (Using Tools>Picture to String) end; begin LoadBMP; //Loads the BMP if FindBitmap(x,y,IMG,Xs,Ys,Xe,Ye) then //Searches for Bmp IMG in area Xs,Ys,Xe,Ye (if Found then) begin //Begins KeyDown(Chr(13)); //Presses and Holds ENTER key Wait(500); //Waits some amount of time KeyUp(Chr(13)); //Releases ENTER key end else //if does NOT find then begin //Begins writeLn('IMG Bmp NOT FOUND!'); //alerts.("IMG Bmp NOT FOUND!") end; end. [/scar] Your virtual key code table can be found here: http://delphi.about.com/od/objectpascalide/l/blvkc.htm You can use KeyDown(VK_RETURN) instead of KeyDown(Chr(13)); If you need anymore help, feel free to ask! Edited January 19, 2013 by Ranqers Quote Link to comment Share on other sites More sharing options...