Skip to content

Manual:DIL Manual if()

iamnove edited this page Jan 18, 2023 · 51 revisions


if:
    The if statement is much like C. It takes any type as
    argument. Non integers are considered 'TRUE' if they are
    not null.
Example:

dilbegin foo(); code { if (self.hp>10) { exec("say Hehe!",self); } else { exec("say ouch!", self); } } dilend

Example:
   dilbegin foo();
   code
   {
     if (self.loaded>10)
     {
       exec("say its getting crowded!",self);
     }
   }
   dilend
Example:
   dilbegin foo();
   code
   {
     if (self.loaded<10)
       exec("say plenty of room!",self);
   }
   dilend
---~---~---~---~---~---~---~---~---
Clone this wiki locally