adrian1386 Posted January 10, 2006 Share Posted January 10, 2006 Ok all I want to happen is this. A mouse moves across the screen when the pixel underneath at the mouses x and y coordinates changes to a certain color than it performs a number of actions. This is what I had in mind but it doenst work. $moving = mousemove(115, 706,100) $var = PixelGetColor($moving) If $var = 0x000000 Then Send('{TAB}') Else Send('{F1}') EndIf I know some of you know a way this can be done. -also please dont flame about double posting, this is a different question than my original in a different post. Your Favorite Noob Link to comment Share on other sites More sharing options...
John Posted January 10, 2006 Share Posted January 10, 2006 Ok all I want to happen is this. A mouse moves across the screen when the pixel underneath at the mouses x and y coordinates changes to a certain color than it performs a number of actions. This is what I had in mind but it doenst work. $moving = mousemove(115, 706,100) $var = PixelGetColor($moving) If $var = 0x000000 Then Send('{TAB}') Else Send('{F1}') EndIf I know some of you know a way this can be done. -also please dont flame about double posting, this is a different question than my original in a different post. Your Favorite Noob Pass the color as a string like; $moving = mousemove(115, 706,100) $var = PixelGetColor($moving) If $var = "0x000000" Then Send('{TAB}') Else Send('{F1}') EndIf Link to comment Share on other sites More sharing options...
adrian1386 Posted January 10, 2006 Author Share Posted January 10, 2006 I wish it was that simple. I know the code can not work as I have written it, I'm just using it as an example so this forum can see what I'm trying to achieve. I just don't know enough about AutoIT or any language to wrap my head around this one. Hopefuly someone can figure this out, its really the last peice of the puzzle for my script. Link to comment Share on other sites More sharing options...
John Posted January 10, 2006 Share Posted January 10, 2006 Maybe I misunderstood your question. I thought you couldn't get the $var to return the pixel color.. but apparently the program flow is the issue??? Link to comment Share on other sites More sharing options...
adrian1386 Posted January 10, 2006 Author Share Posted January 10, 2006 Well first of all , I have no idea if my syntax is right, which I'm pretty sure its not. once again, what I want to happen exactly is... The mouse is moving across the screen, while its moving across the screen if at any point it lands on the color black it will perform the actions given if not it will do the else statement and thats what I want to happen. Link to comment Share on other sites More sharing options...
John Posted January 10, 2006 Share Posted January 10, 2006 Maybe something like this??? While 1 $cur = MouseGetPos() $pxl=PixelGetColor($cur[0] ,$cur[1]) Select Case $pxl=0x000000 MsgBox(0,"color","Black") Exit Case $pxl=0xFFFFFF MsgBox(0,"Color","White") Exit Case Else ToolTip(PixelGetColor($cur[0] ,$cur[1])) EndSelect WEnd I put it all inline in the while loop for speed but there's probably a better way depending on how many cases you need to check. 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