{{! Empyrion Power Controller v.1 by swg }}
{{! Saves energy by turning off devices }}
{{! after crafting. ʕ▫ᴥ▫ʔ }}
<sprite=72> {{DateTimeNow}}
{{E.EntityType}}: {{E.Name}}
⚡ {{E.S.Fuel}}
{{if CacheData.p2}}{{set 'dp' 0}}
{{test E.S.PowerConsumption 'eq'
CacheData.p2}}
{{set 'dp' (calc CacheData.p3 '-'
E.S.PowerConsumption)}}
{{/test}}
> {{E.S.PowerConsumption~}}
>{{CacheData.p1}}>{{CacheData.p2~}}
>{{CacheData.p3}}
d {{Data.dp}}
<color=orange>Controlled devices:</color>
{{devices E.S '*'}}
{{split '1132,2452;1371,815;962,270;
1628,245;960,490;714,1496' ';'}}
{{#each .}}{{split . ','}}
{{#each ../../../}}
{{test .id 'eq' ../[0]}}{{if .Active}}
<color=red>{{else}}<color=green>{{/if~}}
- {{.CustomName~}}</color>
{{test @root.Data.dp 'eq' ../../[1]}}
{{setactive . false}}{{/test}}{{/test}}
{{/each}}{{/split}}{{/each}}{{/split}}
{{/devices}}{{/if}}
{{setcache 'p3' CacheData.p2}}
{{setcache 'p2' CacheData.p1}}
{{setcache 'p1' E.S.PowerConsumption}}