Jump to content
UBot Underground

Logical operators


Recommended Posts

Hello guys,

I have come across a small problem, can i insert logical operators like OR AND IF NOT etc??

The or, and are really important. Let me know. I want to use it in a if statement like

 

IF .... OR ....

Link to post
Share on other sites
  • 1 year later...

But what if i need to use multiple OR operators? such as

 

if sky is blue {

then {

grass is green OR sun is yellow OR plane is white OR i am fat OR you are fat}

}

 

 

how do i use multiple OR operators, other that keep inserting $either(which only limits for just 2 elements)

Link to post
Share on other sites

But what if i need to use multiple OR operators? such as

 

if sky is blue {

then {

grass is green OR sun is yellow OR plane is white OR i am fat OR you are fat}

}

 

 

how do i use multiple OR operators, other that keep inserting $either(which only limits for just 2 elements)

 

There are two ways to do it.

 

Right now $either only supports 2 conditions which will eventually get fixed. But a workaround for that is to put an $either inside the 2nd condition, then it will support 3 conditions, and you can continue that to support as many conditions as you want.

 

The other way is to just write out the conditions as shown in this video:

 

http://screencast.com/t/L7UR89vJQaSV

 

Keep in mind for checking equality to words you would need to do #x = "cat" OR #y = "dog" with the quotation marks if you want to do it this way.

Link to post
Share on other sites
  • 4 years later...

I wouldnt suggest this but I guess it works,as described,to check for multiple conditions nested inside of it,but sucks really,this example tests 4 conditions if any true returns true,can nest more

 

can also modify it to input more Conditions

 

"Right now $either only supports 2 conditions which will eventually get fixed." its end of 2016 and it looks there are still only 2 conditions in $either.

define $EitherOr(#ConditionOne, #ConditionTwo) {
    if($comparison(#ConditionOne,"=",$true) OR $comparison(#ConditionTwo,"=",$true)) {
        then {
            return($true)
        }
        else {
            return($false)
        }
    }
}
navigate("http://www.ubotstudio.com/resources","Wait")
wait for browser event("Everything Loaded","")
alert($EitherOr($EitherOr($exists(<title="Home">), $exists(<id="upgrade_notif_content">)), $EitherOr($exists($element offset(<tagname="h1">,1)), $exists(<title="Contact">))))

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...