{ toy -> final SLEEPING = "sleeping"; final BEDTIME = "bedtime", WAKEUP = "wakeup", BEDTIMECHECK = "bedtimeCheck"; toy.metaClass.sleepSchedule { def t = (int)(getDay() - localTimeOffset() + (25.1 * HOUR) + getRandom((int)HOUR)); addEventIfMissing(SLEEPING, t, BEDTIME); }; toy.metaClass.bedtime { rt, schedTime -> dress([[LINGERIE,nTITS]]); if (rt && sessionSummon([LINGERIE,nTITS])) { preStrip([LINGERIE,nTITS]); removeAllToys([LINGERIE,nTITS]); present([LINGERIE,nTITS], [ ["Very good, toy.", "OK."], ["Bedtime for you!", "Off to bed with you!", "Bed! Now!"]]); showButtonG("Good night, ${dommeTitle()}", "night"); addEvent(BEDTIMECHECK, getTime() + 300 + getRandom(600), BEDTIMECHECK); showLounge(); } // Assume toy will return dressed tomorrow removeEvent(REDRESS); set(NAKED, false); backgroundRemoveAllToys(); setAway(SLEEPING); def t = schedTime + (6 * (int)HOUR) + getRandom(2 * (int)HOUR); addEvent(SLEEPING, t, WAKEUP); removeEvent(PLAY); }; toy.metaClass.bedtimeCheck { rt -> dress([[LINGERIE,nTITS]]); if (rt && sessionSummon([LINGERIE,nTITS])) { present([LINGERIE,nTITS], [ ["Hey!", "Ah ha!"], ["What are you doing still up?", "Didn't I send you to bed?"]]); showButtonG("Sorry, ${dommeTitle()}", "sorry"); present([LINGERIE,nTITS], [ ["Get yourself to bed", "In bed"], ["right now!", "this instant!"], ["I'll deal with you later."]]); showButtonG("Yes, ${dommeTitle()}", "ok"); adjustPunish(75); showLounge(); } }; toy.metaClass.wakeup { rt -> // Unset outfit, stops bedtime wear always being selected first save("toy.owner.outfit", null); dress([]); setAway(null); playSchedule(); sleepSchedule(); }; toy.addNamedEvent(WAKEUP, { name, arg, schedTime, rt -> toy.wakeup(rt) }); toy.addNamedEvent(BEDTIME, { name, arg, schedTime, rt -> toy.bedtime(rt, schedTime) }); toy.addNamedEvent(BEDTIMECHECK, { name, arg, schedTime, rt -> toy.bedtimeCheck(rt) }); toy.sleepSchedule(); return null; }