Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.on_event(defines.events.on_tick,
- function ()
- local gameRef = game
- local tick = gameRef.tick
- local pick = tick % 7
- -- local profiler = game.create_profiler()
- local map = universe.activeMap
- if (not map) or (universe.processedChunks > #map.processQueue) then
- universe.mapIterator, map = next(universe.maps, universe.mapIterator)
- if not map then
- universe.mapIterator, map = next(universe.maps, universe.mapIterator)
- end
- universe.processedChunks = 0
- universe.activeMap = map
- end
- if (pick == 0) then
- processPendingChunks(map, tick)
- processScanChunks(map)
- universe.processedChunks = universe.processedChunks + PROCESS_QUEUE_SIZE
- planning(map, gameRef.forces.enemy.evolution_factor, tick)
- if universe.NEW_ENEMIES then
- recycleBases(map, tick)
- end
- cleanUpMapTables(map, tick)
- elseif (pick == 1) then
- processPlayers(gameRef.connected_players, map, tick)
- elseif (pick == 2) then
- processMap(map, tick)
- elseif (pick == 3) then
- processStaticMap(map)
- disperseVictoryScent(map)
- cleanSquads(map)
- processVengence(map)
- elseif (pick == 4) then
- scanResourceMap(map, tick)
- elseif (pick == 5) then
- scanEnemyMap(map, tick)
- processSpawners(map, tick)
- elseif (pick == 6) then
- scanPlayerMap(map, tick)
- processNests(map, tick)
- temperamentPlanner(map)
- -- dag edit
- if (map.lastPts) then
- if (math.abs(map.points - map.lastPts) > 5) then
- --game.print("lastPts = " .. map.lastPts .. ", lastPointsUpdateTick = " .. map.lastPointsUpdateTick)
- map.lastPointsUpdateTick = tick
- else
- --game.print("ticks since last points: " .. tick - map.lastPointsUpdateTick)
- if (tick - map.lastPointsUpdateTick > 60*60) then -- if we haven't gained points in a minute then
- map.points = map.points + 60 -- add 60 points
- map.lastPointsUpdateTick = tick
- -- game.print("Awarding idle biters +60 points new total: " .. map.points)
- end
- end
- else
- map.lastPointsUpdateTick = tick
- end
- map.lastPts = map.points
- -- dag edit end
- end
- processActiveNests(map, tick)
- -- game.print({"", "--dispatch4 ", profiler, ", ", pick, ", ", game.tick, " ", mRandom()})
- end)
Advertisement
Add Comment
Please, Sign In to add comment