mirror of
https://github.com/S4mpsa/InfOS.git
synced 2025-09-08 22:59:38 -04:00

Changing file locations Adding directory structure to imports Renaming update.lua to setup.lua Adding symlinking to setup.lua
33 lines
684 B
Lua
Executable File
33 lines
684 B
Lua
Executable File
-- Import section
|
|
local alarm = require('resources.sound.alarm')
|
|
--
|
|
|
|
local function halt(machines)
|
|
alarm()
|
|
for i = 1, #machines do
|
|
machines[i]:setWorkAllowed(false)
|
|
end
|
|
end
|
|
|
|
local function resume(machines)
|
|
for i = 1, #machines do
|
|
machines[i]:setWorkAllowed(true)
|
|
end
|
|
end
|
|
|
|
local function exec(cleanroom, machines)
|
|
if (tonumber(cleanroom:getEfficiencyPercentage()) < 100) then
|
|
if (not cleanroom.isHalted) then
|
|
halt(machines)
|
|
cleanroom.isHalted = true
|
|
end
|
|
else
|
|
if (cleanroom.isHalted) then
|
|
resume(machines)
|
|
cleanroom.isHalted = false
|
|
end
|
|
end
|
|
end
|
|
|
|
return exec
|