updated
This commit is contained in:
43
burnrate_driver.lua
Normal file
43
burnrate_driver.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
local max = 15
|
||||
local init = 5
|
||||
local rateStep = 0.10
|
||||
local min = 1
|
||||
|
||||
local function getValue()
|
||||
return reactor.getBurnRate()
|
||||
end
|
||||
|
||||
local function color()
|
||||
local value = getValue()
|
||||
return colors.black
|
||||
end
|
||||
|
||||
|
||||
|
||||
local function watch()
|
||||
while true do
|
||||
end
|
||||
end
|
||||
|
||||
local function stepUp()
|
||||
local value = getValue()
|
||||
if value < max then
|
||||
reactor.setBurnRate(value + rateStep)
|
||||
end
|
||||
end
|
||||
|
||||
local function stepDown()
|
||||
local value = getValue()
|
||||
if value > min then
|
||||
reactor.setBurnRate(value - rateStep)
|
||||
end
|
||||
end
|
||||
|
||||
local function report()
|
||||
local color = color()
|
||||
monitor.setBackgroundColor(color)
|
||||
value = getValue()
|
||||
monitor.clearLine()
|
||||
monitor.write("Burn Rate: " .. value)
|
||||
end
|
||||
return { report = report, watch = watch }
|
||||
Reference in New Issue
Block a user