Jump to content
MeLlamoRaul

Script to read text and click listed color.

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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;

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

 

NumberBotCrop2.png

 

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...