|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Fri Jan 23, 2004 12:13 am
Use of () and {} |
Ok, I'm starting to fine tune my script for Imperian and would like to know the difference, if any between () and {} and when to use them.
Currently here is a snip of the code where I use them.
#if (@salvebalance AND NOT @asleep AND NOT @aeon AND NOT @stunned) {
#if {@anorexia AND @Salvebalance} {
salvebalance = 0
apply epidermal
}
Also, by putting a second check for salvebalance redundant or is it necessary? I try to make it so I only eat/drink/etc when I have the necessary balance. So far it works, but would like to have the code clean and as short as possible.
thanks in advance. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jan 23, 2004 12:15 am |
()'s are generally used to group expressions, while {} are generally used to group commands or functions. Thus, an #IF command typically looks like:
#IF (expression) {commands} |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Fri Jan 23, 2004 12:48 am |
Thanks
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 23, 2004 4:57 am |
The second check for @Salvebalance is redundant.
|
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Fri Jan 23, 2004 8:28 pm |
*nods* thought so.
|
|
|
|
|
|