Sign in to follow this  
Followers 0
Azu

if pixelgetcolor...

6 posts in this topic

#1 ·  Posted (edited)

Can somebody please tell me why this if statement never works? I've checked those pixels manually with AU3Info.exe and they seem to fulfill the if statement.. except that they don't.. anyone have any idea why?

#include<guiconstants.au3>
adlibenable ("_blah")
func _blah()
if pixelgetcolor(950,90)=0 and pixelgetcolor(56,74)>15000000 and pixelgetcolor(56,74)<20000000 then
send("{ctrldown}")
quickclik(1250,214)
send("{ctrlup}")
endif
endfunc
func quickclik($a,$b)
local $pos=mousegetpos()
mouseclick("left",$a,$b,1,0)
mousemove($pos[0],$pos[1],0)
sleep(random(200,400,1))
endfunc
while 1
sleep(10000000)
wend

Edit: Fixed evil typos.

Edited by Azu

Share this post


Link to post
Share on other sites



Can somebody please tell me why this if statement never works? I've checked those pixels manually with AU3Info.exe and they seem to fulfill the if statement.. isn't that they don't.. anyone have any idea why?

#include<guiconstants.au3>
adlibenable ("_blah")
func _blah()
if pixelgetcolor(950,90)=0 and pixelgetcolor(56,74)>15000000 and pixelgetcolor(56,74)<20000000 then
send("{ctrldown}")
quickclik(1250,214)
send("{ctrlup}")
endif
endfunc
func quickclik($a,$b)
local $pos=mousegetpos()
mouseclick("left",$a,$b,1,0)
mousemove($pos[0],$pos[1],0)
sleep(random(200,400,1))
endfunc
while 1
sleep(10000000)
wend
just for kicks, try getting them in a variable

$color1=PixelGetColor(950,90)

then do

if $color1=0 Then
;do whtever
Endif

Share this post


Link to post
Share on other sites

(PixelGetColor(950, 90) == 0x000000)
Try that.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Tried changing the if to

if 1 then
and it still doesn't work =/

Share this post


Link to post
Share on other sites

Tried changing the if to

if 1 then
and it still doesn't work =/
If 1 Then MsgBox(64, 'Info:', 'This statement works')
If you run this by itself it works, what did you get your coords with, let's assume it was AutoInfo.exe ... Are you getting Screen / Client / Window coords?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

OH I found the problem.. I had the coordinate wrong by 1 and it made the whole thing not work.. got it working now lol.. thanks for the replies, I probably would have just gave up without them..

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