-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathabm_builder.go
34 lines (32 loc) · 1018 Bytes
/
abm_builder.go
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
planetsCoord = ["1:2:3", "1:2:4", "1:2:5"] // Your planets
checkInterval = 5 // Check every 5min
//----------------------------------------------
for {
for planetCoord in planetsCoord {
planet, err = GetPlanet(planetCoord)
if err != nil {
LogError(err)
continue
}
facilities, err = planet.GetFacilities()
if err != nil {
LogError(err)
continue
}
defenses, err = planet.GetDefense()
if err != nil {
LogError(err)
continue
}
abm = defenses.AntiBallisticMissiles
ipm = defenses.InterplanetaryMissiles
possibleABM = (facilities.MissileSilo * 10) - (ipm * 2) - abm
err = planet.BuildDefense(ANTIBALLISTICMISSILES, possibleABM)
if err != nil {
LogError(err)
} else {
Print("Building " + possibleABM + " ABM")
}
}
Sleep(checkInterval * 60 * 1000) // Sleep 5min
}