MeLlamoRaul Posted March 5, 2012 Share Posted March 5, 2012 I'm new to SCAR and need a lot of help. I've written a basic script with movements for a game. Now I want to add a scan to detect when the botcheck arrives. The check is always in the same location and consists of a constant line of text with a variable color (Please click the *** square to continue) with a box of randomly arranged colored squares directly below the text. I need to know how to make the script detect when the check appears, detect the variable color listed in the text, and then select the square that contains that color from the box. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 5, 2012 Share Posted March 5, 2012 hmm i dont think im qualified to answer this, but you are going to get a lengthy explanation from anyone else. ( you would be require to make mask for you text, load them ect....) but instead of focusing on the text why not focus on the shapes? Try to think out of the 'box' to speak and im sure you could find a simpler method =p Quote Link to comment Share on other sites More sharing options...
MeLlamoRaul Posted March 5, 2012 Author Share Posted March 5, 2012 I think I could use the shapes as an initial detector of the botcheck, but I can't think of a way to select the correct square of color without being able to determine the color listed in the text. Could I do screen captures and treat the color listed in the text as a bitmap and have scar search for a match? Screen Capture 2-1.bmp Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 5, 2012 Share Posted March 5, 2012 You just have to use the OCR to read what color you need to look for and then retrieve the appropriate color code from a list and then use FindColorTolerance or something similar to find the position. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 5, 2012 Share Posted March 5, 2012 I think I could use the shapes as an initial detector of the botcheck, but I can't think of a way to select the correct square of color without being able to determine the color listed in the text. Could I do screen captures and treat the color listed in the text as a bitmap and have scar search for a match? [ATTACH]347[/ATTACH] I did not realize what you meant with the screen capture this is more apparent, reading the text would be the best but as ive said im not the best with the text functions. ( I have no clue how to make the text mask for using with OCR, But once you figure out how to load the text the rest is pretty easy.) Quote Link to comment Share on other sites More sharing options...
MeLlamoRaul Posted March 5, 2012 Author Share Posted March 5, 2012 I've been thinking about using OCR, but can't find the correct functions or tutorials. Can somebody link me to a tutorial that describes the process or a simple list of relevant functions and parameters? Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 5, 2012 Share Posted March 5, 2012 I've been thinking about using OCR, but can't find the correct functions or tutorials. Can somebody link me to a tutorial that describes the process or a simple list of relevant functions and parameters? open scar and press "F1" that opens then the new manual, heres the old manual some of the functions do not work but it has abetter list of available functions as the new manual is not done. Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 5, 2012 Share Posted March 5, 2012 If there's not too many colors, you could technically just search for bitmaps of the color text rather than use OCR Quote Link to comment Share on other sites More sharing options...
MeLlamoRaul Posted March 6, 2012 Author Share Posted March 6, 2012 I've converted the bitmap of the word "Orange" to string and have been able to successfully locate it using FindBitmap. I've added an if statement so that if the bitmap is found on the screen then it will search within designated coordinates for a color of orange I selected using ACA and then clicks on the color if found. This works in testing but when I try it with the real coordinates and the image present, the mouse moves to the upper left and hangs out on the orange Firefox label. It's also not writing failure... Procedure ClickOrange; begin FindColorSpiral2(a,b,754400,550,239,787,309); ClickWindMouse(a,b,10,10,False); end; Procedure FindBMP; begin if(FindBitmap(Orange,x,y))then ClickOrange else WriteLn('failure...'); end; Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 6, 2012 Share Posted March 6, 2012 Use FindBitmapIn, FindBitmap searches in the entire client area. Quote Link to comment Share on other sites More sharing options...
MeLlamoRaul Posted March 6, 2012 Author Share Posted March 6, 2012 It's finding the bitmap correctly. It's failing to find the color within the coordinates denoted in FindColorSpiral2 after the condition of finding the bitmap. Instead the cursor is moving to the upper left of the screen and staying on the orange box around firefox without clicking. It doesn't type failure... in comments so I'm confused on what is actually happening. Will the use of FindBitmapIn change the outcome of the ClickOrange procedure? Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 6, 2012 Share Posted March 6, 2012 Sorry, I misunderstood. Even so, you shouldn't use FindColorSpiral2. Use FindColoredAreaTolerance. Quote Link to comment Share on other sites More sharing options...
MeLlamoRaul Posted March 6, 2012 Author Share Posted March 6, 2012 Thanks for the help so far, haven't been able to test FindColoredAreaTolerance yet, but hoping to get a chance soon. Now I need assistance with a Numbered bot. I can get the script to detect the bot using FindBitmap, but have no idea how to get Scar to read the numbers and enter them in the designated location. Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 6, 2012 Share Posted March 6, 2012 I'm not sure how you intend to detect those numbers with bitmaps, I'm assuming they're generated randomly... Quote Link to comment Share on other sites More sharing options...
MeLlamoRaul Posted March 6, 2012 Author Share Posted March 6, 2012 Not detect the numbers, just detect that the bot is present using the bitmap of the white text. I have no idea how to detect the numbers and their values. Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 6, 2012 Share Posted March 6, 2012 Well, that's something pretty complicated... I think your best bet is a decaptcha service... Quote Link to comment Share on other sites More sharing options...