Guest User

Untitled

a guest
Mar 22nd, 2021
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. script.on_event(defines.events.on_tick,
  2. function ()
  3. local gameRef = game
  4. local tick = gameRef.tick
  5. local pick = tick % 7
  6.  
  7. -- local profiler = game.create_profiler()
  8.  
  9. local map = universe.activeMap
  10. if (not map) or (universe.processedChunks > #map.processQueue) then
  11. universe.mapIterator, map = next(universe.maps, universe.mapIterator)
  12. if not map then
  13. universe.mapIterator, map = next(universe.maps, universe.mapIterator)
  14. end
  15. universe.processedChunks = 0
  16. universe.activeMap = map
  17. end
  18.  
  19. if (pick == 0) then
  20. processPendingChunks(map, tick)
  21. processScanChunks(map)
  22. universe.processedChunks = universe.processedChunks + PROCESS_QUEUE_SIZE
  23. planning(map, gameRef.forces.enemy.evolution_factor, tick)
  24. if universe.NEW_ENEMIES then
  25. recycleBases(map, tick)
  26. end
  27. cleanUpMapTables(map, tick)
  28. elseif (pick == 1) then
  29. processPlayers(gameRef.connected_players, map, tick)
  30. elseif (pick == 2) then
  31. processMap(map, tick)
  32. elseif (pick == 3) then
  33. processStaticMap(map)
  34. disperseVictoryScent(map)
  35. cleanSquads(map)
  36. processVengence(map)
  37. elseif (pick == 4) then
  38. scanResourceMap(map, tick)
  39. elseif (pick == 5) then
  40. scanEnemyMap(map, tick)
  41. processSpawners(map, tick)
  42. elseif (pick == 6) then
  43. scanPlayerMap(map, tick)
  44. processNests(map, tick)
  45. temperamentPlanner(map)
  46.  
  47. -- dag edit
  48.  
  49. if (map.lastPts) then
  50. if (math.abs(map.points - map.lastPts) > 5) then
  51. --game.print("lastPts = " .. map.lastPts .. ", lastPointsUpdateTick = " .. map.lastPointsUpdateTick)
  52. map.lastPointsUpdateTick = tick
  53. else
  54. --game.print("ticks since last points: " .. tick - map.lastPointsUpdateTick)
  55. if (tick - map.lastPointsUpdateTick > 60*60) then -- if we haven't gained points in a minute then
  56. map.points = map.points + 60 -- add 60 points
  57. map.lastPointsUpdateTick = tick
  58. -- game.print("Awarding idle biters +60 points new total: " .. map.points)
  59. end
  60. end
  61. else
  62. map.lastPointsUpdateTick = tick
  63. end
  64. map.lastPts = map.points
  65.  
  66. -- dag edit end
  67.  
  68. end
  69.  
  70. processActiveNests(map, tick)
  71.  
  72. -- game.print({"", "--dispatch4 ", profiler, ", ", pick, ", ", game.tick, " ", mRandom()})
  73. end)
Advertisement
Add Comment
Please, Sign In to add comment