Jump to content

"OR" Condition


lightningstar

Recommended Posts

Hi, Just started using Wrobot. I want to know how to write "OR" in the conditions of the spell

for example: if my health < 90

                              or

                    if target health > 50

                    then use XYZ

So I was talking about the "or" in the above example

Link to comment
Share on other sites

there are two ways...
1.

if(condition)
{
   // Do something
}
else
{
   // Do something else
}


2.

if(condition1 || condition 2)
{
   // Do something
}

For your example i would use 

if((health < 90) || (health > 50))
{
   // Do something
}

Hope that helped.

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
×
×
  • Create New...