Jump to content
Sign in to follow this  
Eliwood407

A list with all == , != , && , etc?

Recommended Posts

Hello there, I am slowly getting more efficient and better at SLS.

I do have a question about certain "if" and "else" possibilities.
Is there a list that shows all options like the ones I listed below?
I know a few, but I would like to know if there is a "or" possibility.

 

            if(llDetectedName(i) == "Bullet")
//means that if the object is called Bullet it will:...

            if(llDetectedName(i) != "Bullet")
//means that if the object is not called Bullet it will not:...

            if(llDetectedName(i) == "Bullet" && "Cody")
//Despite it not being possible; means that if the object is called Bullet AND Cody it will:...

//---------------What I would like to know:

            if(llDetectedName(i) == "Bullet" OR "Cody")

            if(llDetectedName(i) == "Bullet" AND NOT "Cody")

 

I hopy my question is clear enough.

Share this post


Link to post
Share on other sites

Hello there, I am slowly getting more efficient and better at SLS.

I do have a question about certain "if" and "else" possibilities.
Is there a list that shows all options like the ones I listed below?
I know a few, but I would like to know if there is a "or" possibility.

 

            if(llDetectedName(i) == "Bullet")
//means that if the object is called Bullet it will:...

            if(llDetectedName(i) != "Bullet")
//means that if the object is not called Bullet it will not:...

            if(llDetectedName(i) == "Bullet" && "Cody")
//Despite it not being possible; means that if the object is called Bullet AND Cody it will:...

//---------------What I would like to know:

            if(llDetectedName(i) == "Bullet" OR "Cody")

            if(llDetectedName(i) == "Bullet" AND NOT "Cody")

 

I hopy my question is clear enough.

Share this post


Link to post
Share on other sites

The OR would be:

if(llDetectedName(i) == "Bullet" || llDetectedName(i) == "Cody")// means that if the object is called Bullet OR Cody it will:...

 The NOT is expressed via "!" as in

 

integer running = TRUE;integer error = FALSE;if( running && !error ) {    // do stuff if running is active and no error occured up to now}

 So the list you look for contains:

comparison operators: == != < <= > >=

logical operators: && || !

bitwise operators: & | ~ ^

Full list with some info for you at http://wiki.secondlife.com/wiki/LSL_Operators

 

Edit: I'm too slow at typing :-/

  • Like 1

Share this post


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.

Sign in to follow this  

×
×
  • Create New...