This commit is contained in:
Nikita Kruglickiy
2021-12-09 18:03:12 +03:00
parent ad267f034b
commit 7cdb222580
12 changed files with 252 additions and 25 deletions

View File

@@ -3,4 +3,6 @@ CURRENT_PLAYER = player()
OWNER = owner()
IS_ME = CURRENT_PLAYER == OWNER
TICK_INTERVAL = game.getTickInterval()
RAD_TO_RPM = 9.5493
RAD_TO_RPM = 9.5493
RPM_TO_RAD = 0.10472
UNITS_PER_METER = 39.37

View File

@@ -1,10 +1,10 @@
-- @name koptilnya/libs/workers
WORKERS = {}
WORKERS_QUOTA = 0.7
WORKERS_QUOTA = 0.5
local function canProcess()
local exp1 = (math.max(chip():getQuotaAverage(), chip():getQuotaUsed()) + (chip():getQuotaUsed() - math.max(chip():getQuotaAverage(), chip():getQuotaUsed())) * 0.01) / chip():getQuotaMax() < WORKERS_QUOTA
local exp1 = (math.max(quotaTotalAverage(), quotaTotalUsed()) + (quotaTotalUsed() - math.max(quotaTotalAverage(), quotaTotalUsed())) * 0.01) / quotaMax() < WORKERS_QUOTA
local exp2 = math.max(quotaTotalAverage(), quotaTotalUsed()) < quotaMax() * WORKERS_QUOTA
return exp1 and exp2