// greetRando() is a function that will allow an NPC to //scan the room they're in for living beings, choose one at //random, and say something to them. You'd probably want to //invoke it as part of a SetAction() mapping. void GreetRando() { object *folks,peep; folks = get_livings(environment(this_object())); peep = folks[random(sizeof(folks))]; if( peep->GetKeyName() != this_object()->GetKeyName()) { eventForce("say Oh, hey there, "+peep->GetCapName()); } }