Advertisement
Padilk

Untitled

Aug 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. m = peripheral.wrap( "right" )
  2. m.setTextScale(2)
  3. x,y = m.getSize()
  4.  
  5. m.clear()
  6.  
  7. direction = 0
  8.  
  9. --H H H /\
  10. --H H H \/
  11.  
  12. floors = {}
  13. for i=1,6 do
  14. floors[i]=0
  15. end
  16.  
  17. floorsCount=5
  18. currentFloor=3
  19.  
  20. function redraw()
  21. m.setBackgroundColor(colors.black)
  22. m.clear()
  23. cf = 1
  24. for j=1,2 do
  25. for i=1,5 do
  26. m.setCursorPos(i,j)
  27. if i%2 == 1 and cf<=floorsCount then
  28. if cf==currentFloor then
  29. m.setBackgroundColor(700)
  30. else
  31. m.setBackgroundColor(colors.lightGray)
  32. end
  33. m.write(cf)
  34. cf = cf+1
  35. else
  36. m.setBackgroundColor(colors.black)
  37. m.write(" ")
  38. end
  39. end
  40. end
  41. end
  42.  
  43.  
  44. c=1
  45.  
  46.  
  47. redraw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement