ID:161323
 
Expr ? TrueExpr : FalseExp

Could someone please explain me how to exactly use that?
resting ? chakra.value+=chakra.max_value/rand(33,666) : chakra.value+=chakra.max_value/rand(99,3333)

Above is being used in a mob/proc, so I didn't used src, I'm lazeh.

Regards,

Rick
if(resting)
chakra.value += chakra.max_value/rand(33,666)
else
chakra.value += chakra.max_value/rand(99,3333)
That would work in another language, but BYOND is very strict about where you can put equality operators. So, you need to change it like so:

chakra.value += chakra.max_value / ( resting ? rand(33,666) : rand(99,3333) )
In response to DivineO'peanut
I didn't want that. I especially asked about this, lol.
In response to Sokkiejjj
Ifs and elses are a more readable way of using the ? operator. I use the ? operator sometimes, but not most of the time.
In response to Sokkiejjj
What's "that" and "this"? The code I posted is simply a longer , working version of your code.