Sign in to follow this  
Followers 0
sofakingdom

multiple "if" statements with one "then"

3 posts in this topic

OK! so, I am working on a small easy starter autoit program, but am not used to programming in autoit... the logic seems to be a bit different than what I am used to. anyways, heres my dilema. I have pixel search running for 3 rectangular areas, and if they all have the containing color, then it will mouse click in one of those pixel search areas.

the code resembles this:

$a=pixelsearch(1,2,3,4,*red*)

$b=pixelsearch(2,3,4,5,*red*)

$c=pixelsearch(4,6,8,*red*)

if isarray$a=1

&

if isarray$b=1

&

if isarray$c=1

then

mouseclick(left,$a[0],$a[1],1,0)

obviously this isn't the exact syntax, but I don't have access to my file right now... I just need to understand the syntax of autoit to know how to have (if in the event of 3 exact things being true) one solution... hopefully someone can help... I know it is probably very hard to understand what I mean... if you need any clarification, please let me know.

Thanks for your time.

Share this post


Link to post
Share on other sites



try something like

$a=pixelsearch(1,2,3,4,0xFF0000)
$b=pixelsearch(2,3,4,5,0xFF0000)
$c=pixelsearch(4,6,8,6,0xFF0000)

if isarray($a) AND isarray($B) AND isarray($c) then
    mouseclick('left',$a[0],$a[1],1,0)
EndIf
thanks for the speedy reply, but i think i got it... i did something along the lines of...

$a.....(...000)

if isarray($a) then

$b.....(....000)

if isarray($:)....

....

...

..

endif

endif

endif

I think it is performing correctly... for a bit there i had to think if it was continuing through the loops even if the "if" wasn't met, but I'm pretty sure it runs correctly... thanks again for the help... topic may be closed ;D

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