Jump to content
Sign in to follow this  
qwertylol

If then

Recommended Posts

qwertylol

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

Share this post


Link to post
Share on other sites
Uriziel01

just use logical AND for multiple, OR for one of few. ex. If $green > $red & $green AND $red & $green > $blue Then...


Share this post


Link to post
Share on other sites
qwertylol

just use logical AND for multiple, OR for one of few. ex. If $green > $red & $green AND $red & $green > $blue Then...

uh, could you clarify?

is that au3 you are posting?

Share this post


Link to post
Share on other sites
qwertylol

your quite amazing, having joined 50minutes ago.

Share this post


Link to post
Share on other sites
Uriziel01

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

Share this post


Link to post
Share on other sites
Uriziel01

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


Share this post


Link to post
Share on other sites
Vindicator209

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]

Share this post


Link to post
Share on other sites
The Kandie Man

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

Share this post


Link to post
Share on other sites
Gif

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

yeap agreed, also Au3Lib and functions page here pretty same the help file

Share this post


Link to post
Share on other sites
nfwu

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

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  

×