onGreet4.c

grendel-1.0.0a7/progs/examples/onGreet4.c · 357 B

From the archive grendel-1.0.0a7.zip

Download the archive   « Back to the archive contents

require "glib.c"

void onGreet(external ch, external target)
{
   int x;
   x = random(100);

   if (x =< 80)
   {
      do("tell " + target.Pname + " Do you want a drink?");

      if (x =< 10)
      {
         do("tell " + target.Pname + " Well... ok, this one is on the house");
         do("give beer " + target.Pname);
      }
   }
}

Site Stats

Snippets: 1791
Codebases: 571