Advertisement
electronic_steve

unstable

Aug 22nd, 2015
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. dofile("/ESAPI")
  2. component=require("component")
  3. local component = require('component')
  4. local term = require('term')
  5. local event = require('event')
  6. local camera = component.camera
  7. local gpu = component.gpu
  8. local X,Y=gpu.getResolution()
  9. local s={x=X,y=Y}
  10. color_tbl ={  
  11.   0x000000,
  12.   0x0000FF,
  13.   0x00AAAA,
  14.   0x00FFFF,
  15.   0x008800,
  16.   0x00FF00,
  17.   0xFFFF00,
  18.   0xAAAA00,
  19.   0xFF0000
  20. }
  21. while true do
  22.     local px,py=0,0
  23.     for y=1,-1,-(1/(s.y-1)*2) do
  24.         py=py+1
  25.         for x=1,-1,-(1/s.y) do
  26.             px=px+1
  27.             local dist=camera.distance(x,y)
  28.             term.setCursor(px,py)
  29.             gpu.setForeground(color_tbl[es.interval(1,math.floor(2+((#color_tbl-1)-math.min(#color_tbl-1, (dist/1.2)))),9)])
  30.             term.write("█",false)
  31.         end
  32.         px=0
  33.     end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement