Sign in to follow this  
Followers 0
sheeple

Stupid Basic Question

8 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

EDIT: I misread sorry

btw: If Hex($var) = 0xFFFFFF Then

Edited by oMBRa

Share this post


Link to post
Share on other sites

Hex() returns a string.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You can check the Return value in 2 different ways:

;A)
If Hex($var) = "FFFFFF" Then 
;B)
If $var = 0xFFFFFF Then
Edited 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

Share this post


Link to post
Share on other sites

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 :party:

Share this post


Link to post
Share on other sites

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

you can use the IF BOOLEAN THEN WHATEVER only when you WON'T use any ELSE or END IF

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