home » builders » builder's lessons » or function

Or function

The or function allows you to check if more than one instance of the same kind of thing is true in a prog. For instance if you wanted to check if the PC was either a priest or wizard, and if they were then the next part of the program would activate.

>intercept_prog molira tethos~ 
if class($n) == Wizard 
or class($n) == Priest 
  if wear_loc($o) != -1  
    if objval5($o) == 0 
      cast 'sanctuary' $n 
      mposet on $n iQQ01 value5 1 
      mpechoat $n {80}A black aura surrounds your body making you feel strangely protected. 
      mpechoaround $n {80}A deep black aura swirls around $N's body. 

The above is an object program. If the PC is either a priest or a wizard, the item will then move on to the next part of the program and see if the next things are true. These are if the item is worn, and if object value5 is equal to 0.