Advertisement
NekoTiki

qdfqsdfqsfqdfqsdf

Oct 19th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("back")
  2. m = peripheral.wrap("right")
  3.  
  4. local l,h = m.getSize()
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. shell.run("id")
  8.  
  9. function prt()
  10.   m.setBackgroundColor(colors.gray)
  11.   m.clear()
  12.   term.clear()
  13.   term.setCursorPos(1,1)
  14.   print("H:"..h.." L:"..l)
  15. end
  16.  
  17. function initbar()
  18.  
  19.     m.setCursorPos(2,3)
  20.     m.setBackgroundColor(colors.lightGray)
  21.   for i=1,27 do
  22.     m.write(" ")
  23.   end
  24.  
  25.     m.setCursorPos(2,7)
  26.   for i=1,27 do
  27.     m.write(" ")
  28.   end  
  29.  
  30.     m.setCursorPos(2,11)
  31.   for i=1,27 do
  32.     m.write(" ")
  33.   end
  34. end
  35. while true do
  36.   -----  Recevoir les information   -----
  37.   local id1,e25,pe25 = rednet.receive("EnPt25")
  38.   local id2,r25,pr25 = rednet.receive("RoSp25")
  39.   print("e25:"..e25.." r25:"..r25)
  40.  
  41.   local id3,e34,pe34 = rednet.receive("EnPt34")
  42.   local id4,r34,pr34 = rednet.receive("RoSp34")
  43.   print("e34:"..e34.." r34:"..r34)
  44.  
  45.   local id5,e29,pe29 = rednet.receive("EnPt29")
  46.   local id6,r29,pr29 = rednet.receive("RoSp29")
  47.   print("e29:"..e29.." r29:"..r29)
  48.  
  49.   sleep(0.1)
  50.   ----- Fin d'attente d'information -----
  51.  
  52.  
  53.   prt()
  54.   initbar()
  55.   ----- Affichage (Bars) -----
  56.    -- 1er (Rotors CoP N27) --
  57.   m.setBackgroundColor(colors.gray)
  58.   m.setCursorPos(2,2)
  59.   m.write("Rotors Speed:"..math.floor(r25))
  60.   m.setCursorPos(2,4)
  61.   m.write("RF/t:"..math.floor(e29))
  62.   m.setBackgroundColor(colors.blue)
  63.   m.setCursorPos(2,3)
  64.  
  65.   --local l1 = 0
  66.   l1 = r25 * (l-2) / 2000
  67.   print(l1)
  68.  
  69.   for i=1,l1 do
  70.     m.write(" ")
  71.   end
  72.    -- 2eme (RotorsCP N34) --
  73.   m.setBackgroundColor(colors.gray)
  74.   m.setCursorPos(2,6)
  75.   m.write("Rotors Speed:"..math.floor(r34))
  76.   m.setCursorPos(2,8)
  77.   m.write("RF/t:"..math.floor(e34))
  78.   m.setBackgroundColor(colors.blue)
  79.   m.setCursorPos(2,7)
  80.  
  81.   --local l2 = 0
  82.   l2 = r34 * (l-2) / 2000
  83.   print(l2)
  84.  
  85.   for i=1,l2 do
  86.     m.write(" ")
  87.   end
  88.  
  89.    -- 3eme (RotorsCP N29) --
  90.   m.setBackgroundColor(colors.gray)
  91.   m.setCursorPos(2,10)
  92.   m.write("Rotors Speed:"..math.floor(r29))
  93.   m.setCursorPos(2,12)
  94.   m.write("RF/t:"..math.floor(e29))
  95.   m.setBackgroundColor(colors.blue)
  96.   m.setCursorPos(2,11)
  97.  
  98.   --local l3 = 0
  99.   l3 = r29 * (l-2) / 2000
  100.   print(l3)
  101.  
  102.   for i=1,l2 do
  103.     m.write(" ")
  104.   end
  105.  
  106.   sleep(1)
  107. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement