Mit Hilfe von Old McDonald sieht der funktionsfähige code bei mir nun so aus:
Code:
function Wiederaufbau()
if GetGold(1) >= 10000 and GetWood(1) >= 10000 and GetIron(1) >= 10000
and GetStone(1) >= 10000 and GetSulfur(1) >= 10000 and GetClay(1) >= 10000
and Logic.GetAverageMotivation(1) >=1.2 then
Logic.GetAverageMotivation(1)
Message("Hat geklappt")
return true
end
end
Auf der Map geprüft. Message kam erst nach jeweiligen Recourcenbestand und Motivation >= 120%
Keine Ahnung, inwieweit man das hier noch vereinfachen könnte...
Jedenfalls läuft diese function so problemlos.
Aufruf obiger Funktion per:
Code:
StartSimpleJob("Wiederaufbau")
Danke Old McDonald !
Gruss
-Flodder-
Lesezeichen