-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource_outputs.txt
35 lines (28 loc) · 1006 Bytes
/
resource_outputs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@name Resource Outputs
@inputs [Node,Gen1,Gen2,Gen3,Gen4,WatGen]:wirelink
@outputs EnergyGen EnergyPerc EnergyUsage WaterGen WaterPerc WaterUsage CurEnergy CurWater
@persist CurEnergy CurWater
if(first()){
timer("getstuff",10)
timer("setstuff",10)
timer("usage",10)
}
if(clk("setstuff")){
timer("setstuff",2100)
#print("fuck")
CurEnergy = Node["Energy",number]
CurWater = Node["Water",number]
#timer("usage",10)
}
if(clk("getstuff")){
timer("getstuff",100)
EnergyGen = Gen1["Output",number] + Gen2["Output",number] + Gen3["Output",number] + Gen4["Output",number]
WaterGen = WatGen["WaterProduction",number]
EnergyPerc = round(Node["Energy",number] / Node["Max Energy",number] * 100)
WaterPerc = round(Node["Water",number] / Node["Max Water",number] * 100)
}
if(clk("usage")){
timer("usage",100) #this doesnt fucking work i hate it
EnergyUsage = CurEnergy - Node["Energy",number]
WaterUsage = CurWater - Node["Water",number]
}