sheeple Posted May 21, 2009 Posted May 21, 2009 Really basic macro, want it to press F1 when the pixel is white, if not, delay 3000 and run agian in a loop. Its coming up with an error "Else statement with no matching If statement... First time using autoit and trying to write a simple macro, used ACTool forever but I think its time to move on. -.- while 1 = 1 $var = PixelGetColor( 628 , 282 ) if Hex($var, 6) = FFFFFF Then Send ("{f1}") else sleep (3000) endif Wend
dorkbrains Posted May 21, 2009 Posted May 21, 2009 try this. sleep(5000) ;gives you time to only open what you want the pixel color of while 1 ;this only needs to be one If Hex($var) = FFFFFF Then Send ("{f1}") ;after "Then" start a new line else sleep (3000) endif Wend
sheeple Posted May 21, 2009 Author Posted May 21, 2009 Added PixelGetColor back in and its giving me the following error "Error parsing fuction call" sleep(5000);gives you time to only open what you want the pixel color of while 1;this only needs to be one $var = PixelGetColor( 628 , 282 ) If Hex($var) = FFFFFF Then Send ("{f1}");after "Then" start a new line else sleep (3000) endif Wend
oMBRa Posted May 21, 2009 Posted May 21, 2009 (edited) EDIT: I misread sorrybtw: If Hex($var) = 0xFFFFFF Then Edited May 21, 2009 by oMBRa
ProgAndy Posted May 21, 2009 Posted May 21, 2009 (edited) You can check the Return value in 2 different ways: ;A) If Hex($var) = "FFFFFF" Then ;B) If $var = 0xFFFFFF Then Edited May 21, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Bam Posted May 22, 2009 Posted May 22, 2009 Some one else that used ACtools Some differences between ACtools and AutoIt, Thiers not a "Beautify" button but, you can get Tidy witch is just as nice if not nicer sense it backs up your scripts. When trying to find out the color of a pixel you can't as easly get the RGB. But once you get to know AutoIt, it becomes real nice. GL
Ixidior Posted May 23, 2009 Posted May 23, 2009 try this.sleep(5000) ;gives you time to only open what you want the pixel color ofwhile 1 ;this only needs to be oneIf Hex($var) = FFFFFF Then Send ("{f1}") ;after "Then" start a new lineelsesleep (3000)endifWendyou can use the IF BOOLEAN THEN WHATEVER only when you WON'T use any ELSE or END IF
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