Sign in to follow this  
Followers 0
adrian1386

Need help! :/

6 posts in this topic

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. :P

-also please dont flame about double posting, this is a different question than my original in a different post.

Your Favorite Noob :lmao:

Share this post


Link to post
Share on other sites



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. :P

-also please dont flame about double posting, this is a different question than my original in a different post.

Your Favorite Noob :lmao:

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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???

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0