Advertisement
NekoTiki

qsfqdfqdfqf

Oct 19th, 2015
98
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. term.setBackgroundColor(colors.gray)
  9. term.clear()
  10.  
  11. function prt()
  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.   initbar()
  37.   prt()
  38.   -----  Recevoir les information   -----
  39.   local id1,e25,pe25 = rednet.receive("EnPt25")
  40.   local id2,r25,pr25 = rednet.receive("RoSp25")
  41.   print("e25:"..e25.." r25:"..r25)
  42.  
  43.   local id3,e34,pe34 = rednet.receive("EnPt34")
  44.   local id4,r34,pr34 = rednet.receive("RoSp34")
  45.   print("e34:"..e34.." r34:"..r34)
  46.  
  47.   local id5,e29,pe29 = rednet.receive("EnPt29")
  48.   local id6,r29,pr29 = rednet.receive("RoSp29")
  49.   print("e29:"..e29.." r29:"..r29)
  50.  
  51.   sleep(0.1)
  52.   ----- Fin d'attente d'information -----
  53.  
  54.   ----- Affichage (Bars) -----
  55.    -- 1er (Rotors CoP N27) --
  56.   m.setBackgroundColor(colors.black)
  57.   m.setCursorPos(2,2)
  58.   m.write("Rotors Speed:"..math.floor(r25))
  59.   m.setCursorPos(2,4)
  60.   m.write("RF/t:"..math.floor(e29))
  61.   m.setBackgroundColor(colors.blue)
  62.   m.setCursorPos(2,3)
  63.  
  64.   --local l1 = 0
  65.   l1 = r25 * (l-2) / 2000
  66.   print(l1)
  67.  
  68.   for i=1,l1 do
  69.     m.write(" ")
  70.   end
  71.    -- 2eme (RotorsCP N34) --
  72.   m.setBackgroundColor(colors.black)
  73.   m.setCursorPos(2,6)
  74.   m.write("Rotors Speed:"..math.floor(r34))
  75.   m.setCursorPos(2,8)
  76.   m.write("RF/t:"..math.floor(e34))
  77.   m.setBackgroundColor(colors.blue)
  78.   m.setCursorPos(2,7)
  79.  
  80.   --local l2 = 0
  81.   l2 = r34 * (l-2) / 2000
  82.   print(l2)
  83.  
  84.   for i=1,l2 do
  85.     m.write(" ")
  86.   end
  87.  
  88.    -- 3eme (RotorsCP N29) --
  89.   m.setBackgroundColor(colors.black)
  90.   m.setCursorPos(2,10)
  91.   m.write("Rotors Speed:"..math.floor(r29))
  92.   m.setCursorPos(2,12)
  93.   m.write("RF/t:"..math.floor(e29))
  94.   m.setBackgroundColor(colors.blue)
  95.   m.setCursorPos(2,11)
  96.  
  97.   --local l3 = 0
  98.   l3 = r29 * (l-2) / 2000
  99.   print(l3)
  100.  
  101.   for i=1,l2 do
  102.     m.write(" ")
  103.   end
  104.  
  105.   sleep(1)
  106. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement