Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local periList = peripheral.getNames()
- -- Main Function
- function main()
- while true do
- if reactor.getHotFluidAmount() < (reactor.getHotFluidAmountMax() - 5) then
- reactor.setActive(true)
- else
- reactor.setActive(false)
- end
- sleep(5)
- end
- end
- function tablelength(T)
- local count = 0
- for _ in pairs(T) do count = count + 1 end
- return count
- end
- function restart()
- main()
- end
- -- Startup
- print('Steam Reactor Control Engaged. Incoming parameters...')
- for i = 1, #periList do
- --print("I have a "..peripheral.getType(periList[i]).." attached as \""..periList[i].."\".")
- if peripheral.getType(periList[i]) == "BigReactors-Reactor" then
- reactor = peripheral.wrap(periList[i])
- controlRodNumber = tablelength(reactor.getControlRodsLevels())
- print("Wrapped Reactor: "..periList[i])
- end
- end
- -- Reactor Connection Checl
- if reactor then
- main()
- else
- print("reactor not connected")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement