Skip to content

Instantly share code, notes, and snippets.

@tuefekci
Created October 14, 2022 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuefekci/66c185e4a905bb6440ed727d21d7e794 to your computer and use it in GitHub Desktop.
Save tuefekci/66c185e4a905bb6440ed727d21d7e794 to your computer and use it in GitHub Desktop.
Factorio MoonLogic AAI Zoner
out = {}
local ressource = 0
if red['wood'] > 0 then
out['zone-x-green'] = 1
ressource = 1
end
if red['coal'] > 0 then
out['zone-x-black'] = 1
ressource = 1
end
if red['stone'] > 0 then
out['zone-x-white'] = 1
ressource = 1
end
if red['iron-ore'] > 0 then
out['zone-x-blue'] = 1
ressource = 1
end
if red['copper-ore'] > 0 then
out['zone-x-orange'] = 1
ressource = 1
end
if red['uranium-ore'] > 0 then
out['zone-x-yellow'] = 1
ressource = 1
end
if red['signal-enemy-unit-spawner'] > 0 or red['signal-enemy-turret'] > 0 then
out['zone-x-magenta'] = 1
ressource = 1
end
if ressource == 1 then
out['signal-x-tile'] = red['signal-x-tile']
out['signal-y-tile'] = red['signal-y-tile']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment