Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. local tech_table = {
  2.     MicroManufacturing = "AutoMaticElectronicsFactory",
  3.     NuclearFusion = "AutomatedFusionReactor",
  4.     DronePrinting = "AutoMaticDroneAssembler",
  5.     NuclearFusion = "FusionSpire",
  6.     LowGHydrosynthsis = "AutoMaticPolymerFactory",
  7.     ["3DMachining"] = "AutoMaticMachinePartsFactory",
  8.     LowGFungi = "AutoMaticFungalFarm",
  9. }
  10.  
  11. local function ToggleLock()
  12.     -- local them for slightly more speed
  13.     local UICity = UICity
  14.     local UnlockBuilding = UnlockBuilding
  15.     local LockBuilding = LockBuilding
  16.     for tech,bld in pairs(tech_table) do
  17.         if UICity:IsTechResearched(tech) then
  18.             UnlockBuilding(bld)
  19.         else
  20.             LockBuilding(bld)
  21.         end
  22.     end
  23. end
  24. OnMsg.CityStart = ToggleLock
  25. OnMsg.LoadGame = ToggleLock
  26. OnMsg.TechResearched = ToggleLock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement