# Generic "wake up when someone enters room" object

Snowfall (cfm21@hermes.cam.ac.uk)
Tue, 28 Nov 1995 02:43:53 PST

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    > > = 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
    <sleeper>:goodnight().

    Easier than parsing through :tell(), by about a million miles.

    Colin/Snowfall