--add these two lines to load the opengl library local gl = require("opengl") local GL = gl --initialize variables MAIN={} xpos=-1 xinc=.01 xmax=200 ON=1 --fill MAIN with zeroes for i=1,xmax do MAIN[i]=0 end --on/off switch function enable(e) ON=e end --change distance between lines function inc(x) xinc=x end --change total number of lines function lines(x) xmax=x end --Make MAIN a First-In, First-Out (FIFO) table function float(f) if ON == 1 then table.remove(MAIN,1) table.insert(MAIN,f) --outlet(0,MAIN) end end --function draw() is a special function called --each frame function draw() if ON == 1 then gl.Enable(GL.BLEND) gl.BlendFunc(GL.SRC_ALPHA, GL.ONE) gl.Disable(GL.DEPTH_TEST) for i=1,xmax do --make xpos wrap around if (xpos > xinc*(xmax/2)) then xpos = -xinc*(xmax/2) end --increment xpos xpos=xpos+xinc --draw lines gl.Begin(GL.LINES) gl.Color(1,1,1) gl.Vertex(xpos,MAIN[i],0) gl.Vertex(xpos,-MAIN[i],0) gl.End() end end end