Size: 880
Comment:
|
← Revision 7 as of 2015-09-08 19:04:50 ⇥
Size: 854
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
tr = "a:94k,t:2k,w:2k,s:2k" x = city.x + 20 |
tr = "a:94k,t:2k,w:2k,s:2k" x = city.x + 20 |
Line 9: | Line 9: |
targetId = GetFieldId(x, y) trBean = GetTroops(tr) attackTime = city.getTravelTime(city.fieldId, targetId, trBean, 5) transTime = city.getTravelTime(city.fieldId, targetId, trBean, 2) carryingLoad = city.getCarryingLoad(trBean) echo "Distance to " + city.coords + ": " + FormatDistance(city.fieldId, targetId) echo "Carrying load: " + carryingLoad echo "Attack time: " + round(attackTime) + " secs, load: " + floor(carryingLoad - trBean.foodConsumption(attackTime * 2)) echo "Reinforce time: " + round(transTime) + " secs, load: " + floor(carryingLoad - trBean.foodConsumption(transTime * 2)) |
targetId = GetFieldId(x, y) trBean = GetTroops(tr) attackTime = city.getTravelTime(city.fieldId, targetId, trBean, 5) transTime = city.getTravelTime(city.fieldId, targetId, trBean, 2) carryingLoad = city.getCarryingLoad(trBean) echo "Distance to " + city.coords + ": " + FormatDistance(city.fieldId, targetId) echo "Carrying load: " + carryingLoad echo "Attack time: " + attackTime + " secs, load: " + floor(carryingLoad - trBean.foodConsumption(attackTime * 2)) echo "Reinforce time: " + transTime + " secs, load: " + floor(carryingLoad - trBean.foodConsumption(transTime * 2)) |
Line 19: | Line 19: |
Example on how to get information similar to that obtained from the TravelInfo script command for use in variables.
tr = "a:94k,t:2k,w:2k,s:2k" x = city.x + 20 y = city.y + 30 targetId = GetFieldId(x, y) trBean = GetTroops(tr) attackTime = city.getTravelTime(city.fieldId, targetId, trBean, 5) transTime = city.getTravelTime(city.fieldId, targetId, trBean, 2) carryingLoad = city.getCarryingLoad(trBean) echo "Distance to " + city.coords + ": " + FormatDistance(city.fieldId, targetId) echo "Carrying load: " + carryingLoad echo "Attack time: " + attackTime + " secs, load: " + floor(carryingLoad - trBean.foodConsumption(attackTime * 2)) echo "Reinforce time: " + transTime + " secs, load: " + floor(carryingLoad - trBean.foodConsumption(transTime * 2))