drabont

Empyrion - Power Controller v.1

Jul 6th, 2022 (edited)
2,567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.01 KB | None | 0 0
  1. {{! Empyrion Power Controller v.1 by swg }}
  2. {{! Saves energy by turning off devices  }}
  3. {{! after crafting.                ʕ▫ᴥ▫ʔ }}
  4.  
  5. <sprite=72> {{DateTimeNow}}
  6. {{E.EntityType}}: {{E.Name}}
  7.  ⚡ {{E.S.Fuel}}
  8.  
  9. {{if CacheData.p2}}{{set 'dp' 0}}
  10. {{test E.S.PowerConsumption 'eq'
  11.  CacheData.p2}}
  12. {{set 'dp' (calc CacheData.p3 '-'
  13.  E.S.PowerConsumption)}}
  14. {{/test}}
  15.  > {{E.S.PowerConsumption~}}
  16. >{{CacheData.p1}}>{{CacheData.p2~}}
  17. >{{CacheData.p3}}
  18.  d {{Data.dp}}
  19.  
  20. <color=orange>Controlled devices:</color>
  21. {{devices  E.S '*'}}
  22. {{split '1132,2452;1371,815;962,270;
  23. 1628,245;960,490;714,1496' ';'}}
  24. {{#each .}}{{split . ','}}
  25. {{#each ../../../}}
  26.  
  27. {{test .id 'eq' ../[0]}}{{if .Active}}
  28. <color=red>{{else}}<color=green>{{/if~}}
  29. - {{.CustomName~}}</color>
  30. {{test @root.Data.dp 'eq' ../../[1]}}
  31. {{setactive . false}}{{/test}}{{/test}}
  32.  
  33. {{/each}}{{/split}}{{/each}}{{/split}}
  34. {{/devices}}{{/if}}
  35.  
  36. {{setcache 'p3' CacheData.p2}}
  37. {{setcache 'p2' CacheData.p1}}
  38. {{setcache 'p1' E.S.PowerConsumption}}
Add Comment
Please, Sign In to add comment