CheckEnergyNeedChain
Category: Objects
/ Status
Since engine version: 4.6.5.0 CP
Description
Checks whether any energy user connected to the specified object currently requires energy. The search will also include indirectly connected objects (via multiple lines).
Syntax
bool CheckEnergyNeedChain
(object pObj);
Parameter
- pObj:
[opt]
Object from which to start the search. Can be 0 in local calls.
Remark
The search is performed only in the direction in which energy is also transferred, meaning from suppliers to users.
Example
if(CheckEnergyNeedChain()) SetAction("Burning");
Script for a power plant: if any of the connected users needs energy, the furnace is started.
Sven2, Juni 2003