Advertisement
craftyoyo

compteur_interface_ftb_craftyoyo

Aug 18th, 2014
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. local mon = peripheral.wrap("right")
  2. local x,y = mon.getSize()
  3.  
  4. function paint()
  5.  
  6. print(x)
  7. print(y)
  8.  
  9.  for i=1,y do
  10.  mon.setBackgroundColor(colors.blue)
  11.  mon.setCursorPos(1,i)
  12.  mon.write(" ")
  13.  mon.setCursorPos(71,i)
  14.  mon.write(" ")
  15.  --print(i)
  16.  end
  17.  for i=1,71 do
  18.  mon.setCursorPos(i,1)
  19.  mon.write(" ")
  20.  mon.setCursorPos(i,26)
  21.  mon.write(" ")
  22.  mon.setCursorPos(i,5)
  23.  mon.write(" ")
  24.  end
  25.  
  26. end
  27.  
  28. function writer()
  29.  
  30. mon.setBackgroundColor(colors.black)
  31. mon.setTextColor(colors.white)
  32. mon.setCursorPos(32,3)
  33. mon.write("Energie")
  34. mon.setCursorPos(3,7)
  35. mon.write("Consomation de la base : ")
  36. mon.setCursorPos(3,9)
  37. mon.write("Consomation de l'applied : ")
  38. end
  39.  
  40.  
  41. mon.setBackgroundColor(colors.black)
  42. mon.clear()
  43. paint()
  44. writer()
  45. rednet.open("left")
  46.  
  47. while true do
  48.  --paint()
  49.  local event , id , msg ,proto = os.pullEvent("rednet_message")
  50.  if (id == 7) then
  51.   mon.setCursorPos(28,7)
  52.   mon.write(msg.." RF/ticks ")
  53.  elseif (id == 8) then
  54.   mon.setCursorPos(30,9)
  55.   mon.write(msg.." RF/ticks ")
  56.  end
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement