Advertisement
rjtwins

Some MC code

Jul 22nd, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local t1 = peripheral.wrap("BigReactors-Turbine_0")
  2. local t2 = peripheral.wrap("BigReactors-Turbine_1")
  3. local m = peripheral.wrap("monitor_0")
  4. local status1 = ""
  5. local status2 = ""
  6. local engaged1 = ""
  7. local engaged2 = ""
  8. local rpm1 = 0
  9. local rpm2 = 0
  10. local energy1 = 0
  11. local energy2 = 0
  12. local energyProd1 = 0
  13. local energyProd2 = 0
  14.  
  15. while true do
  16.     -- Getting and setting status vars.--
  17.     local status1 = "Offline"
  18.     local status2 = "Offline"
  19.     local engaged1 = "Not Engaged"
  20.     local engaged2 = "Not Engaged"
  21.     energyProd1 = t1.getEnergyProducedLastTick()
  22.     energyProd2 = t2.getEnergyProducedLastTick()
  23.     energy1 = t1.getEnergyStored()
  24.     energy2 = t1.getEnergyStored()
  25.     rpm1 = t1.getRotorSpeed()
  26.     rpm2 = t1.getRotorSpeed()
  27.     if t1.getInductorEngaged() then engaged1 = "Engaged" end
  28.     if t2.getInductorEngaged() then engaged2 = "Engaged" end
  29.     if t1.getActive() then status1 = "Online" end
  30.     if t2.getActive() then status2 = "Online" end
  31.  
  32.     --Displaying status vars.--
  33.     m.clear()
  34.  
  35.     --Turbine 1--
  36.     m.setCursorPos(1,1)
  37.     m.setTextColor(colors.cyan)
  38.     m.write("Turbine 1")
  39.  
  40.     m.setCursorPos(1,2)
  41.     m.setTextColor(colors.white)
  42.     m.write("Turbine Status: ")
  43.     m.setCursorPos(20,2)
  44.     m.setTextColor(colors.red)
  45.     m.write(status1)
  46.  
  47.     m.setCursorPos(1,3)
  48.     m.setTextColor(colors.white)
  49.     m.write("Induction Coils: ")
  50.     m.setCursorPos(20,3)
  51.     m.setTextColor(colors.red)
  52.     m.write(engaged1)
  53.  
  54.     m.setCursorPos(1,4)
  55.     m.setTextColor(colors.white)
  56.     m.write("RF/T: ")
  57.     m.setCursorPos(20,4)
  58.     m.setTextColor(colors.red)
  59.     m.write(energyProd1)
  60.  
  61.     m.setCursorPos(1,5)
  62.     m.setTextColor(colors.white)
  63.     m.write("RF Stored: ")
  64.     m.setCursorPos(20,5)
  65.     m.setTextColor(colors.red)
  66.     m.write(energy1)
  67.  
  68.     m.setCursorPos(1,6)
  69.     m.setTextColor(colors.white)
  70.     m.write("RPM: ")
  71.     m.setCursorPos(20,6)
  72.     m.setTextColor(colors.red)
  73.     m.write(rpm1)
  74.  
  75.     --Turbine 2--
  76.     m.setCursorPos(1,7)
  77.     m.setTextColor(colors.cyan)
  78.     m.write("Turbine 2")
  79.  
  80.     m.setCursorPos(1,8)
  81.     m.setTextColor(colors.white)
  82.     m.write("Turbine Status: ")
  83.     m.setCursorPos(20,8)
  84.     m.setTextColor(colors.red)
  85.     m.write(status2)
  86.  
  87.     m.setCursorPos(1,9)
  88.     m.setTextColor(colors.white)
  89.     m.write("Induction Coils: ")
  90.     m.setCursorPos(20,9)
  91.     m.setTextColor(colors.red)
  92.     m.write(engaged2)
  93.  
  94.     m.setCursorPos(1,10)
  95.     m.setTextColor(colors.white)
  96.     m.write("RF/T: ")
  97.     m.setCursorPos(20,10)
  98.     m.setTextColor(colors.red)
  99.     m.write(energyProd2)
  100.  
  101.     m.setCursorPos(1,11)
  102.     m.setTextColor(colors.white)
  103.     m.write("RF Stored: ")
  104.     m.setCursorPos(20,11)
  105.     m.setTextColor(colors.red)
  106.     m.write(energy2)
  107.  
  108.     m.setCursorPos(1,12)
  109.     m.setTextColor(colors.white)
  110.     m.write("RPM: ")
  111.     m.setCursorPos(20,12)
  112.     m.setTextColor(colors.red)
  113.     m.write(rpm2)
  114.  
  115.     --Redo every 0.1 sec.--
  116.     os.sleep(0.1)
  117.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement