Jump to content

If then


Recommended Posts

Dim $green = 10
Dim $red   = 20
Dim $blue  = 10




If $green > $red & $green > $blue Then
                ;MsgBox ( 0, "$loop_point", $loop_point )
                ;$degree = IniRead (  "radar_loc.ini", "degree", 'rim_point_' & $loop_point, "default" )
                MsgBox ( 0, "before return" , "green" )
                ;Return ;
                EndIf

I need multiple condition to be true, but I guess I messed up.

Please correct me :)

Link to comment
Share on other sites

I'm writing in Autoit for long time (2 months is long i think), i just have'nt acc on this board... and, yes this is the au3 script and it will be working, for ex.

Dim $jeden=4

Dim $dwa=3

Dim $trzy=6

if $jeden > $dwa AND $jeden > $trzy then

Msgbox(0,"","jeden is the biggest value")

endif

if $jeden > $dwa AND $jeden < $trzy then

Msgbox(0,"","trzy is the biggest value")

endif

if $jeden < $dwa AND $jeden > $trzy then

Msgbox(0,"","dwa is the biggest value")

endif

p.s-yes, yes i now that the dim's prefix arent nesseseary...

Edited by Uriziel01
Link to comment
Share on other sites

If $green > $red Then

If $green > $blue Then

;MsgBox ( 0, "$loop_point", $loop_point )

;$degree = IniRead ( "radar_loc.ini", "degree", 'rim_point_' & $loop_point, "default" )

MsgBox ( 0, "before return" , "green" )

;Return

EndIf

EndIf

Put the second inside the other one =P

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Yeap, Autoit help is the best "source" of knowledge and code.

I can't tell you how true that statement is. If you have a question spend a while looking through the help file. Even if you don't find what you are looking for right away you will end up finding new ways to do things and in some cases you will even find ways to solve other problems that you have.

It is important that you(anybody who is reading this post) don't use the forum every time you have the smallest problem because then other people get irritated with you and stop looking at your posts and threads.

Use the forum as a last resort when there is no other way.

That is just my $0.02 as we like to say.

- The Kandie Man ;-)

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Dim $green = 10
Dim $red   = 20
Dim $blue  = 10

If $green > $red AND $green > $blue Then
                ;MsgBox ( 0, "$loop_point", $loop_point )
                ;$degree = IniRead (  "radar_loc.ini", "degree", 'rim_point_' & $loop_point, "default" )
                MsgBox ( 0, "before return" , "green" )
                ;Return ;
EndIf

AutoIt uses different logical operators from other languages:

Logical Operators:
&& => And
|| => Or
! => Not
Binary Operators:
& => BitAnd(a, b)
| => BitOr(a, b)

#)

Edited by nfwu
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...