Guest User

dracReactor

a guest
Sep 20th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. dreactor = peripheral.wrap("draconic_reactor_0")
  2. dmon = peripheral.wrap("monitor_23")
  3.  
  4. function clear()
  5. dmon.clear()
  6. term.clear()
  7. term.setCursorPos(1,1)
  8. dmon.setCursorPos(1,1)
  9. end
  10.  
  11.  
  12. while true do
  13.  
  14.   clear()
  15.   term.setCursorPos(16,1)
  16.   dmon.setCursorPos(7,1)
  17.   print("Draconic Reactor")
  18.   dmon.write("Draconic Reactor")
  19.  
  20.   tbl = peripheral.call("draconic_reactor_0","getReactorInfo")
  21.   tbl = dreactor.getReactorInfo()
  22.  
  23.  for k, v in pairs (tbl) do
  24.   if k == "status" then
  25.     term.setCursorPos(8,3)
  26.     dmon.setCursorPos(8,3)
  27.     print("Status: "..v)
  28.     dmon.write("Status: "..v)
  29.   end
  30.   if k == "temperature" then
  31.    if v >= 8500 then
  32.      dreactor.stopReactor()
  33.      clear()
  34.      dmon.write("Reactor Overheated")
  35.      print("Reactor Overheated")
  36.    end
  37.     term.setCursorPos(3,4)
  38.     dmon.setCursorPos(3,4)
  39.     print("Temperature: "..v)
  40.     dmon.write("Temperature: "..v)
  41.   end
  42.   if k == "fieldDrainRate" then
  43.     term.setCursorPos(3,6)
  44.     dmon.setCursorPos(3,6)
  45.     print("Field Drain: "..v)
  46.     dmon.write("Field Drain: "..v)
  47.   end
  48.   if k == "generationRate" then
  49.     term.setCursorPos(4,5)
  50.     dmon.setCursorPos(4,5)
  51.     print("Generating: "..v)
  52.     dmon.write("Generating: "..v)
  53.   end
  54.   if k == "energySaturation" then
  55.     term.setCursorPos(1,7)
  56.     dmon.setCursorPos(1,7)
  57.     print("RF Saturation: "..v)
  58.     dmon.write("RF Saturation: "..v)
  59.   end
  60.  end
  61.   sleep(1)
  62.  
  63. end
Advertisement
Add Comment
Please, Sign In to add comment