Advertisement
NekoTiki

qdfqdfqsdfqdfqdfqdfsdf

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