se7enek

Untitled

May 25th, 2015
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.close("back")
  2. sleep(.5)
  3. rednet.open("back")
  4.  
  5. m = peripheral.wrap("top")
  6.  
  7. drillid = 15
  8. energyid = 17
  9. reaktorid = 18
  10. fireworkid = 19
  11. armataid = 21
  12. turbineid = 34
  13.  
  14. local function sluchaj(x,y)
  15.     rednet.send(x,y)
  16.     id,msg = rednet.receive()
  17.     return msg
  18. end
  19.  
  20. while true do
  21.     drill = sluchaj(drillid,"drill")
  22.     energy = sluchaj(energyid,"energy")
  23.     reaktor = sluchaj(reaktorid,"reaktor")
  24.     reaktorp = sluchaj(reaktorid,"reaktorp")
  25.     reaktore = sluchaj(turbineid,"reaktore")
  26.     reaktore = math.floor(reaktore/100)/10
  27.     reaktort = sluchaj(reaktorid,"reaktort")
  28.     armata = sluchaj(armataid,"armata")
  29.    
  30.     if energy >= 0 and energy <= 33 then energycolor = colors.red
  31.     elseif energy > 33 and energy <= 66 then energycolor = colors.orange
  32.     elseif energy > 66 and energy < 99 then energycolor = colors.green
  33.     elseif energy >= 99 then energycolor = colors.green energy = 100 end
  34.  
  35.     if drill == "on" then drillcolor = colors.green
  36.     else drillcolor = colors.red end
  37.    
  38.     if reaktor == "on" then reaktorcolor = colors.green
  39.     else reaktorcolor = colors.red end
  40.  
  41.     if armata == "on" then armatacolor = colors.green
  42.     else armatacolor = colors.red end
  43.  
  44.     m.clear()
  45.     m.setCursorPos(1,1)
  46.     m.write("Panel Sterowania")
  47.     m.setCursorPos(19,1)
  48.     m.write(textutils.formatTime(os.time(),false))
  49.     m.setBackgroundColor(energycolor)
  50.     m.setCursorPos(8,3)
  51.     m.write("Energia: ")
  52.     m.setCursorPos(17,3)
  53.     m.write(energy.."%")
  54.  
  55.         m.setCursorPos(4,6)
  56.         m.setBackgroundColor(drillcolor)
  57.         m.write("DRILL")
  58.     m.setCursorPos(16,8)
  59.     m.setBackgroundColor(reaktorcolor)
  60.     m.write("Reaktor")
  61.     m.setCursorPos(15,10)
  62.     m.write("Fuel: "..reaktorp.."%")
  63.     m.setCursorPos(15,11)
  64.     m.write("RF/t: "..reaktore.."K")
  65.     m.setCursorPos(15,12)
  66.     m.write("Temp: "..reaktort.."C")   
  67.  
  68.         m.setBackgroundColor(colors.black)
  69.         m.setCursorPos(2,17)
  70. sleep(1)
  71. end
Advertisement
Add Comment
Please, Sign In to add comment