Stationeers

Stationeers

Not enough ratings
Automatic Generator
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
199.638 KB
20 May @ 3:02pm
1 Change Note ( view )

Subscribe to download
Automatic Generator

Description
Automatic Generator
A lean IC10 script that automatically manages all your Solid Fuel Generators based on total battery charge. Plug in any number of Large/Small Stationary Batteries and Generators—no manual toggling required.

Features

Threshold-Based Control

Turn generators ON when combined battery charge drops below MinPercentage (default 40 %).

Turn generators OFF when battery charge rises above MaxPercentage (default 50 %).

Continually re-evaluates each tick—no rapid cycling between on/off if your batteries hover between thresholds.

Batch Detection (Unlimited Devices)

Automatically finds all connected Stationary Battery Large (hash -1388288459) and Stationary Battery Small (hash -400115994) units.

Automatically finds all connected Solid Fuel Generators (hash 813146305) and switches them in bulk.

No need to re-alias or rename individual devices—just wire everything to the same data network.

Optional Overload Alert

Compares summed PowerPotential.Maximum against summed PowerActual.Maximum for every battery.

If (PowerPotential – PowerActual) < 0 (i.e. your consumption outpaces battery potential), the script turns ON the Alert pin (d0).

The Alert device is fully optional—if nothing is plugged into d0, the IC simply skips that write without error.

Handles “No Batteries” Gracefully

If it detects zero total battery capacity, it assumes 100 % charge so generators stay OFF rather than spamming on/off when no batteries are present.

Requirements

IC Housing + IC10 Chip containing this script.

One or more Stationary Battery Large (-1388288459) and/or Stationary Battery Small (-400115994) on the same data network.

One or more Solid Fuel Generators (813146305) on that network.

(Optional) Alert device (Flashing Light, Klaxon, LED, etc.) wired into pin d0. If no device is present, the script will skip all Alert writes.

Note: All devices must share the same data network as the IC Housing. You do not need to assign individual generators or batteries to specific pins—batch instructions handle everything by PrefabHash.

Installation Steps

Print & assemble: place an IC Housing, insert an IC10 chip containing this code, and provide power.

Wire up:

Plug all Battery Large/Small units into the IC’s data network.

Plug all Solid Fuel Generators into the same network.

(Optional) Plug an Alert Light/Speaker into pin d0.

Configure thresholds (optional): open the IC in the IC Editor and modify:

makefile
Copiar
Editar
define MinPercentage 0.4 # 40% — your “generator on” threshold
define MaxPercentage 0.5 # 50% — your “generator off” threshold
If you want to use a gas generator instead of coal, replace "define GeneratorHash 813146305" with "define GeneratorHash 1165997963"
Save & export back to the chip.

Done: let it run. Generators will wheel up or down automatically based on your battery level.

Why “Automatic Generator”?

Zero-Maintenance Power: never babysit your generators again—batteries below 40 % = generators on, above 50 % = generators off.

Scale Friendly: works with any number of batteries and generators. Just plug them in.

Overload Protection: detects if your base’s power draw outstrips battery potential and turns on an Alert so you can fix drains before chaos ensues.

Optional Alert: wire up a blinking light or klaxon on d0, or leave it empty—no errors.

Enjoy hassle-free power management in Stationeers!
This is my first IC post. I hope you enjoy it. My small contribution to the community, bugs or suggestions are welcome.
1 Comments
oxans 24 Aug @ 11:54am 
merci pour ton partage.