MOO-cows Mailing List Archive
Re: Generic "wake up when someone enters room" object
> > = Darrell Berry
> >Can someone point me at a simple object which performs an action at a (set
> >or random) interval _as long as there is someone in the location containing
> >it_, and which sleeps otherwise (don't want to be doing ANY processing when
> >there's noone around to see it)
Look, why don't you just use $room:enterfunc()? That'll always be called
when someone enters the room, and have it check for any "sleeping"
objects and call <sleeper>:wakeup() or something (which would be ignored
if <sleeper> were already awake.) Similarly, $room:exitfunc() can check to
see if there are any players left in room.contents and if not, call
Easier than parsing through :tell(), by about a million miles.
Subject Index |