summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/toy.groovy13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index 6e93dd2..3d8b064 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -1502,6 +1502,18 @@ def addAvail = { amount ->
def dayNum = getDayNum();
save("toy.availability.$dayNum", getAvail(dayNum) + amount);
};
+def tidyAvail = {
+ def p = load("toy.availability");
+ if (!p) return;
+ def p2 = [:];
+ final firstDay = getDayNum() - 20;
+ p.eachWithIndex{ avail, day ->
+ if (day >= firstDay && avail > 0) {
+ p2["$day"] = avail;
+ }
+ }
+ save("toy.availability", p2);
+};
if (localTime() > 25.75 || localTime() < 7.5) { // 1:45am - 7:30am
show("Mistress is sleeping...");
wait(10);
@@ -1537,6 +1549,7 @@ else {
leaveNote(null, null);
}
setupInitial();
+tidyAvail();
final cycleTime = 6;
showLounge();