Jump to content

if pixelgetcolor...


 Share

Recommended Posts

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
Link to comment
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
Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
Share on other sites

  • Moderators

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?

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.

Link to comment
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..

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...