Space Engineers

Space Engineers

Not enough ratings
Power Management Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.227 KB
19 Jul, 2017 @ 7:03pm
29 Jul, 2017 @ 12:38pm
2 Change Notes ( view )

Subscribe to download
Power Management Script

Description
Purpose:

- Bottom line, this script's primary purpose is to conserve uranium on your station/mobile base in survival.


What does it do?

- This script calculates the average power charge of all batteries on a grid and compares it against the user defined upper and lower battery capacity thresholds. If the low average battery capacity threshold is reached, the script turns on the user defined reactors. If the high threshold is reached, it turns off the reactors to conserve uranium and lets the batteries/solar panels handle the power load. It then displays diagnostic information about the station's power on a user defined LCD panel.


Do I need to install any additional Mods/Scripts?

- Nope. This one's completely independent and vanilla friendly.


Ideal Configuration:

- Station/Mobile base with solar panels, batteries, a reactor, and LCD panel.


Why is this ideal?

- Theoretically, you want your solar panels and batteries to do the majority of the heavy lifting on powering your station/mobile base while conserving Uranium. On the flip side, if you're not getting enough sun, you want your reactors to kick in. You also want the LCD panel to get summarized feedback on what's going on.



5 steps to set up:

1) Looped Timer block to trigger the script every 10sec or so.

2) Set Variable: reactorSearchString= A string of text like "Station Reactor" for 1 or mulitple reactors

3) Set Variable: lcdName = The name of the LCD you want info on

4) Set Variable: batteryLowThreshold = A decimal value of the battery capacity percentage you want the reactors to turn on at (Example, 10% battery capacity = .1)

5) Set Variable: batteryHighThreshold = A decimal value of the battery capacity percentage you want the reactors to turn off at (Example, 75% battery capacity = .75)


Enjoy!
Popular Discussions View All (2)
2
30 Jul, 2017 @ 5:45pm
Multiple reactors
Orion
0
1 Mar, 2018 @ 3:12pm
"caught exeption during execution of script:input string was not in a correct format"
MasterNibbz
27 Comments
Old Bob 10 Jul, 2024 @ 8:48am 
DONT WORK
KillarOx3487 15 Sep, 2023 @ 8:51am 
@Beltrán White, I have updated your "Power Management Script" for SE. I was wondering if you had a problem with me posting it and leaving a link to your original scrip.
WolfKakashi 30 Aug, 2022 @ 2:54am 
I cant get it to work.
Can someone conform that this mod could still work after last updates?
In the Programmable Block i get the info: "string in wrong format"
I would totally like to use this mod so i can save some uran
FolkBear 11 Jul, 2021 @ 12:23am 
Still working fine for me will update once I have run it for a while.
dogmouth 22 Feb, 2021 @ 2:39am 
Thanks Dr. Zarkon. Confirming this still works as of today. Even without the LCD display it does what it is supposed to.
Gameagerr 11 Aug, 2020 @ 1:46am 
In the last line of code where it has:

lcd.WritePublicText(outputToLCD);

Removing the "Public" worked for me. (Though you will need to manually switch the LCD panel's content type to Text and Images).

Replace with: lcd.WriteText(outputToLCD);

It seems to be working with this small change. I don't know much else about the script as I am new to it.
DaehKcid 18 Jul, 2020 @ 6:49am 
This stopped working for me, when I click check code I get an Error Program(99,0):warning:'IMyTextPanel.WritePublicText(string, bool)' is obsolete: 'LCD public text is deprecated'
HeavyDeception 15 Feb, 2020 @ 8:36pm 
Dose this still work for anyone I can seem to get it to work?
самовар 24 Aug, 2019 @ 3:29am 
I used this to control a nanite factory from mod, a useful script!