PeachGaming

Untitled

Sep 11th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. local data = {}
  2. for k, v in pairs( rs.getSides() ) do
  3. data[ v ] = {}
  4. end
  5.  
  6. for i = 1, 60 do
  7. for side, tbl in pairs( data ) do
  8. tbl[ i ] = rs.getAnalogInput( side )
  9. end
  10. sleep( 1 )
  11. end
  12.  
  13. --#wohoo, we've got the data! Now to graph it...
  14.  
  15. local cSides = {
  16. right = colors.green,
  17. left = colors.yellow,
  18. top = colors.blue,
  19. bottom = colors.red,
  20. front = colors.purple,
  21. back = colors.white,
  22. }
  23.  
  24. local mon = peripheral.find( "monitor", function( name, handle ) return handle.isColor() end )
  25. if not mon then
  26. error( "No advanced monitors found!", 0 )
  27. end
  28.  
  29. mon.setBackgroundColor( colors.black )
  30. mon.clear()
  31. for side, tbl in pairs( data ) do
  32. mon.setBackgroundColor( cSides[ side ] )
  33. for i = 1, 60 do
  34. mon.setCursorPos( i, data[ i ] )
  35. mon.write( " " )
  36. end
  37. end
Add Comment
Please, Sign In to add comment