A super simple way to modify your ship for automated energy/fuel management with YOLOL code in Starbase.
序章
You can easily modify your ship to save tons of energy and avoid having to replace fuel rods on a regular basis. With a simple script written in YOLOL, Starbase’s programming language, your ship generator will turn on and off automatically based on battery charge and regulate how much output is currently required.
It’s a simple solution to avoid having to manually turn the generator on and off whenever the ship comes to a halt.
要件
- A ship equipped with a generator and battery.
- A YOLOL Chip Socket
- A Basic YOLOL Chip
- Cable and bolt tools
These can be obtained from the auction house or made by hand on a crafting bench.
Install the YOLOL Chip
Using the bolt tool, attach the YOLOL Chip Socket to a beam on your ship. その後, insert the Basic YOLOL Chip into the Socket. ついに, use the cable tool to connect the Socket to the generator network.
Program the YOLOL Chip
Press the center lock and slide it down to edit the YOLOL script inside the chip. Insert the following code into the first line.
:FuelChamberUnitRateLimit=100-:StoredBatteryPower/100 goto 1
Debugging
あなたが望むなら, you can always rename the device fields FuelChamberUnitRateLimit to GeneratorOutput and StoredBatteryPower to BatteryCharge. 実際には, they should have similar names in the YOLOL script and on your ship’s battery and generator fuel chamber. Use the universal tool to rename device fields. To edit, press u while pointing at the device, then go to the Data tab.