Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require("component")
- local term = require("term")
- keyboard = component.proxy(component.list("keyboard")())
- nc_list = {}
- nc_states = {}
- nc_new_states = {}
- x = 0
- for i,j in pairs(component.list()) do
- if j == "nc_fusion_reactor" then
- x = x+1
- nc_list[x] = i
- end
- end
- x = 0
- for k,j in pairs(nc_list) do
- x = x + 1
- nc_states[x] = component.proxy(j).isProcessing()
- end
- while keyboard.isKeyDown == true do
- os.sleep(1)
- end
- while keyboard.isKeyDown == false do
- x = 0
- for i,j in pairs(nc_list) do
- x = x+1
- nc = component.proxy(j)
- if nc.getEfficiency() > 99.9 then
- nc.deactivate()
- else
- nc.activate()
- end
- nc_new_states[x] = nc.isProcessing()
- end
- if (nc_new_states ~= nc_states) then
- term.clear()
- x = 0
- for i in pairs(nc_new_states) do
- x = x+1
- if i then
- state = 'activated!'
- else
- state = 'deactivated!'
- end
- print('Fusion Core ' .. x .. ' is ' .. state)
- end
- end
- nc_states = nc_new_states
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement