gunnagitcha Posted December 18, 2006 Share Posted December 18, 2006 well basically i need it to find the color of a certain location and click it if it is one color and if it is another color to click another location and loop this action... i figured id take a stab in the dark and attempt to see if i could make some halfass thing work and it didnt so im bringing it here to ask......this is the information and hopefully yall can see what i was trying to do and fix it up for me if PixelGetColor(595,511) = 2C375A then mouseclick("left" [,595,511] if PixelGetColor(595,511) = 292929 then mouseclick("left" [,594,556] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 18, 2006 Share Posted December 18, 2006 then should be on the same line as the if , and MouseClick should be like such MouseClick("left",595,511), if u keep the mouseclick on the same line as the then , its ok. But for longer if statements ull have to have an endif as such If Blah = Blah then do some code more code more code endif Link to comment Share on other sites More sharing options...
gunnagitcha Posted December 18, 2006 Author Share Posted December 18, 2006 when i changed the script and attempt to run it it gets this errorif PixelGetColor(595,511) = 2C375Aif PixelGetColor(595,511) = ^ERRORerror: Unable to parse line. Link to comment Share on other sites More sharing options...
theguy0000 Posted December 18, 2006 Share Posted December 18, 2006 (edited) try, if PixelGetColor(595,511) = Dec(0x2C375A) edit: just to clarify why...you got the error because hex values have to start with 0x and had you read the help file, you would know that PixelGetColor returns decimal anyway. Edited December 18, 2006 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
MadBoy Posted December 18, 2006 Share Posted December 18, 2006 when i changed the script and attempt to run it it gets this errorIf PixelGetColor(595,511) = 2C375A Then ; SOME CODE HEREEndIf My little company: Evotec (PL version: Evotec) Link to comment Share on other sites More sharing options...
theguy0000 Posted December 18, 2006 Share Posted December 18, 2006 (edited) If PixelGetColor(595,511) = 2C375A Then ; SOME CODE HEREEndIfno, like i said above, hex values must begin with 0x, and pixelgetcolor returns decimal anyway, so that would never work. Edited December 18, 2006 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
gunnagitcha Posted December 21, 2006 Author Share Posted December 21, 2006 well this is what ive managed to piece together but am still not able to get it working.......it opens the window, but then doesnt ever perform the mouseclicks >.< im an autoit noob and need some help lol if PixelGetColor(595,511) = Dec(0x2C375A) then ; sleep(1000) ; MouseClick("left",595,511) EndIf if PixelGetColor(595,511) = Dec(0x292929) then ; sleep(1000) ; MouseClick("left",595,511) EndIf Link to comment Share on other sites More sharing options...
FreeFry Posted December 21, 2006 Share Posted December 21, 2006 (edited) $Color = PixelGetColor(595, 511) If $Color = 0x2C375A Then MouseClick("left", 595, 511) ElseIf $Color = 0x292929 Then MouseClick("left", 594, 556) EndIfIf you are not using Scite when you are coding, I advice you to:http://www.autoitscript.com/cgi-bin/getfil...iTE4AutoIt3.exe Edited December 21, 2006 by FreeFry Link to comment Share on other sites More sharing options...
theguy0000 Posted December 21, 2006 Share Posted December 21, 2006 well this is what ive managed to piece together but am still not able to get it working.......it opens the window, but then doesnt ever perform the mouseclicks >.< im an autoit noob and need some help lol if PixelGetColor(595,511) = Dec(0x2C375A) then ; sleep(1000) ; MouseClick("left",595,511) EndIf if PixelGetColor(595,511) = Dec(0x292929) then ; sleep(1000) ; MouseClick("left",595,511) EndIfyou do know that putting semicolons in the beginning makes the line a comment...right? Remove the semicolons... The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
exodius Posted December 21, 2006 Share Posted December 21, 2006 Welcome to AutoIt, you should check this post out to learn the ins and outs specific to it. Link to comment Share on other sites More sharing options...
gunnagitcha Posted December 24, 2006 Author Share Posted December 24, 2006 Welcome to AutoIt, you should check this post out to learn the ins and outs specific to it.yea im usin that now ive had scite for a while and i got the script up and 100% fool proof thanks all for helping a noob out Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now