Created
January 10, 2019 06:51
-
-
Save zekoz/46da24441147c1f1997a7bbb8c97aae6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local me = assert(find.player(11)) | |
log.debug("%s", me) | |
local archers = assert(find.unit_type("Archers")) | |
log.debug("%s", archers) | |
function move_guys(tile) | |
for unit in me:units_iterate() do | |
if unit.utype.id ~= archers.id then | |
goto continue | |
end | |
local city = unit.tile:city() | |
if city and city.name[1] ~= "h" then | |
goto continue | |
end | |
control.unit_move(unit, tile) | |
::continue:: | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment