Advertisement
Guest User

bpu

a guest
Aug 22nd, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1.   --Version 2.5
  2.  
  3.   --Made by gunnarlive12
  4.  
  5.   --Variables
  6.   local dps = 0
  7.   local pxlColor
  8.   local um = false
  9.  
  10.   --Function
  11.   setColor = function( color )
  12.    
  13.     pxlColor = color
  14.    
  15.   end
  16.  
  17.   setDrawSpeed = function( time )
  18.  
  19.     dps = time
  20.  
  21.   end
  22.  
  23.   setMonitorUse = function( boolean )
  24.    
  25.     um = boolean
  26.  
  27.   end
  28.  
  29.   setMonitor = function( string )
  30.    
  31.     m = peripheral.wrap( tostring( string ) )
  32.  
  33.   end
  34.  
  35.   drawPix = function( x, y )
  36.  
  37.    if um == false then
  38.    
  39.     term.setCursorPos( 1, 1 )
  40.     term.setBackgroundColor( pxlColor )
  41.     sleep(dps)
  42.    
  43.    elseif um == true
  44.    
  45.     m.setCursorPos( 1, 1 )
  46.     m.setBackgroundColor( pxlColor )
  47.     sleep(dps)
  48.    
  49.   end
  50.  
  51.   drawLineX = function( xs, xe, y )
  52.    
  53.     term.setBackgroundColor( pxlColor )
  54.    
  55.     if um == false then
  56.       for i = xs, xe do
  57.      
  58.         term.setCursorPos( i, y )
  59.         term.write( " " )
  60.         sleep(dps)
  61.        
  62.       end
  63.     elseif um == true then
  64.       for i = xs, xe do
  65.        
  66.        m.setCursorPos( i, y)
  67.        m.write( " " )
  68.        sleep(dps)
  69.            
  70.       end
  71.     end
  72.   end
  73.  
  74.  
  75.   drawLineY = function( x, ys, ye )
  76.    
  77.     term.setBackgroundColor( pxlColor )
  78.    
  79.    for i = ys, ye do
  80.      
  81.      term.setCursorPos( x, i )
  82.      term.write( " " )
  83.      sleep(dps)
  84.      
  85.    end
  86.    
  87.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement