Skip to content

Instantly share code, notes, and snippets.

@zekoz
Created January 10, 2019 06:51
Show Gist options
  • Save zekoz/46da24441147c1f1997a7bbb8c97aae6 to your computer and use it in GitHub Desktop.
Save zekoz/46da24441147c1f1997a7bbb8c97aae6 to your computer and use it in GitHub Desktop.
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