summaryrefslogtreecommitdiff
path: root/scripts/toy.groovy
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-12-24 17:05:46 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2018-12-24 17:05:46 +0000
commitdfddc1e6bf9a4b91af550c3039611e939a6a1e55 (patch)
tree4baf29b35cb50f39472de185aef9c818c8166c73 /scripts/toy.groovy
parentProcess events in order without cache (diff)
downloadtoy-dfddc1e6bf9a4b91af550c3039611e939a6a1e55.zip
Functions for getting/setting away status
Diffstat (limited to 'scripts/toy.groovy')
-rw-r--r--scripts/toy.groovy2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index f5182aa..8f3a10a 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -160,6 +160,8 @@ def set = {i, s -> save("toy.state.$i", s)};
def positioned = { i -> loadString("toy.position") == i };
def getPunish = { loadInteger("toy.punishment") ?: 0; };
def adjustPunish = { p -> save("toy.punishment", Math.max(getPunish() + (int)p, 0)); };
+def getAway = { loadString("toy.owner.away") };
+def setAway = { a -> save("toy.owner.away", a) };
def namedEvents;
def loadEvents = {
return (loadMap("toy.events") ?: [:]);