PanClon Posted December 27, 2007 Posted December 27, 2007 Hello...I´m new here...I learning AutoIT for 3 weeks..creating game bot...but still need some help..=) So my idea is... I need check one specific pixel in dec (16776960) on coordinates x=635 y=310...every 10 second....if the pixel will not (False) be found then keep searching every 10s...if will be found (true) then stop searching and do some stuff... It sounds easy...but I still can´t figure it out..pls help me =) Regards
Achilles Posted December 27, 2007 Posted December 27, 2007 (edited) $found = False While Not $found Sleep(10000) $pass = PixelSearch(635, 310, 635, 310, 16776960) If IsArray($pass) then;The color is there! $found = True EndIf WEnd EDIT: I didn't test this... You might need to change a few things... Edited December 27, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
PanClon Posted December 27, 2007 Author Posted December 27, 2007 well that´s not exactly what I looking for...but thx anyway... I need something simple....it´s not necessary to use True and False....my opinion for the CODE is: PixelSearch(635, 310, 635, 310, 16776960) $color = 16776960 If $color = 16776960 Then Sleep(10000) MouseClick("Left", 500, 500,1) If NOT $color = 16776960 Then Do PixelSearch(635, 310, 635, 310, 16776960) Until $color = 16776960 EndIf well any ideas....? PS: Dunno maybe the If...ElseIf...Else... maybe help...
Bowmore Posted December 27, 2007 Posted December 27, 2007 well that´s not exactly what I looking for...but thx anyway... I need something simple....it´s not necessary to use True and False....my opinion for the CODE is: PixelSearch(635, 310, 635, 310, 16776960) $color = 16776960 If $color = 16776960 Then Sleep(10000) MouseClick("Left", 500, 500,1) If NOT $color = 16776960 Then Do PixelSearch(635, 310, 635, 310, 16776960) Until $color = 16776960 EndIf well any ideas....? PS: Dunno maybe the If...ElseIf...Else... maybe help... Piano_Man's script will give you what you asked for but if it's not to your liking here is a slightly different method. $iColour = PixelGetColor(635, 310) ;Get the colour of the specified pixel While $iColour <> 16776960 Sleep(10000) ; Wait 10 seconds before checking again $iColour = PixelGetColor(635, 310) Wend ; do your stuff "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
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