Advertisement
Guest User

start

a guest
Nov 18th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local args = {...}
  2.  
  3. local start_flowRate = args[2] and tonumber(args[2]) or 2000
  4. local start_rodLevel = args[1] and tonumber(args[1]) or 100
  5.  
  6. if (_init_has_run ~= true) then
  7.   shell.run("init")
  8. end
  9.  
  10. print("Boot-up sequence has begun...")
  11.  
  12. for i,v in pairs(_turbines) do
  13.   v.setFluidFlowRateMax(start_flowRate)
  14.   v.setActive(true)
  15.   if v.getActive() then
  16.     print("[ ONLINE ]  Turbine #", i)
  17.   else
  18.     printError("Turbine #", i, " failed to start.")
  19.   end
  20. end
  21.  
  22. for i,v in pairs(_reactors) do
  23.   v.setAllControlRodLevels(start_rodLevel)
  24.   v.setActive(true)
  25.   if v.getActive() then
  26.     print("[ ONLINE ]  Reactor #", i)
  27.   else
  28.     printError("Reactor #", i, "\tfailed to start.")
  29.   end
  30. end
  31.  
  32. print("")
  33. print("Reactors brought online: ", #_reactors)
  34. print("Turbines brought online: ", #_turbines)
  35. print("Target control rod levels: ", start_rodLevel)
  36. print("Target turbine flow rate: ", start_flowRate)
  37. print("Boot-up sequence complete.\n")
  38. sleep(1)
  39. print("[ REACTOR ONLINE ]")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement