diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-06-16 17:09:04 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-06-19 20:05:39 +0100 |
commit | 01226eb92d19af88d7d8ccd6d698eca06a76259e (patch) | |
tree | 5a4f5d3eeb36020da821b03b9655a82d2cbe364e /scripts | |
parent | Count disappointments (diff) | |
download | toy-01226eb92d19af88d7d8ccd6d698eca06a76259e.zip |
Load modules from the scripts/toy folder
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/toy.groovy | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy index 50661f8..1dfadca 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -93,6 +93,13 @@ return new Object() { .collect { readDomme(it) } .sum() }; + def loadModules = { toy -> + new File("$DATAFOLDER/scripts/toy") + .listFiles() + .every({s -> + Eval.me(s.text)(toy); + }); + }; def selectImage = { domme, set, spec -> def meets = { i -> return spec.every({ s -> @@ -1965,6 +1972,7 @@ return new Object() { setDefault("toy.owner", "ancilla"); OWNER = loadString("toy.owner"); DOMME = loadDomme(OWNER); + loadModules(this); def getDayNum = { Math.floorDiv(getTime() - localTimeOffset() - 14400, 86400) }; def getAvail = { dayNum -> loadInteger("toy.availability.$dayNum") ?: 0 }; def addAvail = { amount -> |