Nike622000

Reactor

May 27th, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. --Monitor und Sensorseite
  2. monSide = "front"
  3. senSide = "top"
  4.  
  5. mon = peripheral.wrap(monSide)
  6. function start()
  7. os.loadAPI("ocs/apis/sensor")
  8. sen = sensor.wrap(senSide)
  9. mon.clear()
  10. mon.setTextColor(colors.white)
  11. mon.setCursorPos(8,1)
  12. mon.write("Reactor Uebersicht")
  13. mon.setCursorPos(8,2)
  14. mon.write("made by ")
  15. mon.setTextColor(colors.orange)
  16. mon.write("Nike622000")
  17. end
  18.  
  19. start()
  20.  
  21.  
  22. while true do
  23. i=1
  24. h=1
  25. for a,b in pairs(sen.getTargets()) do
  26.    if b.Name == "Nuclear Reactor" then
  27.    print("Reaktor detected")
  28.  for k,v in pairs(sen.getTargetDetails(a)) do
  29.    if type(v)== "table" then
  30.    else
  31.     yPos = i+6
  32.     if k == "Active" then
  33.     yPos = i+6
  34.     mon.setTextColor(colors.white)
  35.     mon.setCursorPos(12,4)
  36.     mon.write("Status: ")
  37.     if v == true then
  38.     yPos2 = h+6
  39.     mon.setTextColor(colors.lime)
  40.     mon.setCursorPos(14,yPos)
  41.     mon.write("AN ")
  42.     else
  43.     mon.setTextColor(colors.red)
  44.     mon.setCursorPos(14,yPos)
  45.     mon.write("Aus")
  46.     end
  47.     mon.setTextColor(colors.white)
  48.     mon.setCursorPos(1,4)
  49.     mon.write("Reaktor: ")
  50.     mon.setTextColor(colors.white)
  51.     mon.setCursorPos(1,yPos)
  52.     mon.write("Reaktor "..i)
  53.     i=i+1
  54.     end
  55.  
  56.  
  57.  
  58.     if k == "Output" then
  59.     yPos2 = h+6
  60.     mon.setTextColor(colors.white)
  61.     mon.setCursorPos(20,4)
  62.     mon.write("Output: ")
  63.     mon.setTextColor(colors.white)
  64.     mon.setCursorPos(20,yPos2)
  65.     mon.write(v.." eu/t         ")
  66.     h=h+1
  67.     end
  68.    
  69.  
  70.      
  71.  
  72. sleep(0.1)
  73. end
  74. end
  75. end
  76. end
  77.  
  78.   for l = 10, 0, -1 do
  79.     sleep(1)
  80.     mon.setCursorPos(10,3)
  81.     mon.setTextColor(colors.red)
  82.     mon.write("Refresh in "..l.." ")
  83.       if l == 0 then
  84.       mon.setCursorPos(10,3)
  85.       mon.write("                    ")
  86. end
  87. end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment