Eleflump Posted November 7, 2011 Share Posted November 7, 2011 (edited) Would this work Program new; If (FindColor(x, y,color, 0,100,100,100)); Then ClickMouse(x, y) end; I am trying to find a color and if it is there, click on another coordinate If not how could I do this preferably in a simple way(I found out about this today) And also if I do a new program and start with an if then can I do end; and continue with a begin or will that finish the whole program Edited November 7, 2011 by Eleflump Sudden realiztion of my stupidity Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 7, 2011 Share Posted November 7, 2011 Can you please be more specific? Do you know where the color you want to find it at and where you want to click if you've found it? Also, your structure is a bit off... begin-end; are blocks of code. Your script's main method is signified by "begin end.", the dot is very important and this block of code is always at the end of your script. If you want to use an if statement, you have to put then at the end. if booleanstatement then. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 8, 2011 Share Posted November 8, 2011 First lets fix up your code a bit so we can see what is going on. program new; var X, Y: Integer; Color: Integer; begin Color := 0; // Change this to the color you are looking for // (Use color picker to find) // This will search in area (0,100) to (100,100) for color // and must find the exact color. if FindColor(X, Y, Color, 0, 100, 100, 100) then ClickMouse(X, Y, TRUE); // This will search the same area with a little tolerance. // Good if colors change from session to session if FindColorTolerance(X, Y, Color, 0, 100, 100, 100, 10) then ClickMouse(X, Y, TRUE); // Also exact coord clicking is not recommended. It is very // bot like. May want to vary click by +/- a few pixels. end; Some context of what you are using this for goes a long ways towards helping. Could we have some more details? Quote Link to comment Share on other sites More sharing options...
Eleflump Posted November 8, 2011 Author Share Posted November 8, 2011 (edited) alright so i know the color i want and i know how to make the box to look for it in but i dont know what the 1st x, y means after FindColor(this one in these brackets) any help greatly appreciated ---MERGED--- also how to variate which coord it clicks on (bixby's post) ---MERGED--- is this slightly closer program test; begin if FindColor(424, 5, 15063191, 404, 10, 434, 10); then ClickMouse(328, 858, true); end. Edited November 8, 2011 by Freddy Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 8, 2011 Share Posted November 8, 2011 The X and Y are populated by the find function. It tells you where it found the color by stuffing those values into X and Y so leave those as variables. Really need some real examples of what you are doing (with real numbers). The made up numbers you are using make it more confusing than it needs to be. This is actually quite simple. for find color you pass in: two variables that it populates (initial values ignored), the color you are searching for, the x,y of upper left corner of search area, the x,y of lower right corner of search area. Pass the x,y that it populated for you to your clickmouse & magic happens! Quote Link to comment Share on other sites More sharing options...
Eleflump Posted November 8, 2011 Author Share Posted November 8, 2011 but it comes up with compiling error unknown identifier when i have it as x/y Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 8, 2011 Share Posted November 8, 2011 Take a closer look at what I posted. You have to declare the variables. var X, Y: Integer; Color: Integer; Quote Link to comment Share on other sites More sharing options...
Eleflump Posted November 8, 2011 Author Share Posted November 8, 2011 i was looking for a shorter version like without specifying the variables Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 8, 2011 Share Posted November 8, 2011 You can't call FindColor without specifyng at least 2 integer variables Quote Link to comment Share on other sites More sharing options...
Eleflump Posted November 8, 2011 Author Share Posted November 8, 2011 (edited) ty so much ily <33 --MERGED--- 1 more thing if it doesnt't find it how can i tell it to look for it in a diff place and click on a diff place too --MERGED--- my god its saying compiling error line 4 program new; var x, y: 739, 390; Color: 2971289; if FindColor(X, Y, Color, 371, 362, 772, 359) then MoveMouseSmooth(732, 358); ClickMouse(732, 358); is it possible to then say or Movemousesmotth(537, 510); ClickMouse(537, 510); Edited November 8, 2011 by Freddy Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 8, 2011 Share Posted November 8, 2011 Why don't just just look at Bixby's example... Your color variable is defined wrong. It should be defined as "Color: Integer;". On the next line you should but "begin". On the line after that you can assign the color value to it with " Color := 2971289;". [wiki=ClickMouse]ClickMouse[/wiki] also requires a third argument. True for left button, False for right button. Quote Link to comment Share on other sites More sharing options...
Eleflump Posted November 8, 2011 Author Share Posted November 8, 2011 (edited) Sorry for the newbie questions So to get this straight Program new; Var x, y:[coord]; Color:; begin Color:=; if FindColor(x, y, Color, xs, ys, xe, ye); Then MoveMouseSmooth([coords]); ClickMouse([same coords], [true/false]); else MoveMouseSmooth([alternate coords]); ClickMouseSmooth([alternate coords]); end. Do not post if it's right Edited November 8, 2011 by Eleflump Quote Link to comment Share on other sites More sharing options...
zippoxer Posted November 9, 2011 Share Posted November 9, 2011 Mmm you better take a beginner's tutorial to SCAR or Pascal. I think this is a great tutorial (although it's old): http://forums.freddy1990.com/index.php/topic,243.0.html If you follow carefully and test things you think you understand during the tutorial, you'll get to know SCAR and easily write possible bots. Quote Link to comment Share on other sites More sharing options...