xProgrammer89x Posted December 14, 2013 Share Posted December 14, 2013 Hi all, I'm learning to use scar divi, that looks like Pascal language, and I had a problem during a little script developing. I need to write a procedure that hold spacebar, or left click of mouse, until a color in X;Y coords, be orange. A better explaination, I have a blank progress bar, that can be green, orange, and red when I hold spacebar, and I need a script that keep the spacebar orange (medium status) holding and releasing spacebar, when X;Y coords are orange, and blank. Here is a photo of full progress bar. Can someone help me? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Turbine1991 Posted December 26, 2013 Share Posted December 26, 2013 I would use GetColor for this example, but generally a tolerance is a lot easier to please rather than compare the value to a specific color, requiring 100% accuracy. Here's a possibility, this is just checking for 1 color at a position, holding down space until it's found. Another color could easily be added. program Test;var xCheck, yCheck, xOut, yOut: Integer; col1: Integer; begin xCheck := 10; yCheck := 10; col1 := 6908408; KeyDown(VK_SPACE); repeat Wait(1); until (FindColorTol(xOut, yOut, col1, xCheck, yCheck, xCheck, yCheck, 5)); KeyUp(VK_SPACE); end. Quote Link to comment Share on other sites More sharing options...