From dfddc1e6bf9a4b91af550c3039611e939a6a1e55 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 24 Dec 2018 17:05:46 +0000 Subject: Functions for getting/setting away status --- scripts/toy.groovy | 2 ++ 1 file changed, 2 insertions(+) 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") ?: [:]); -- cgit v1.2.3