Advertisement
Guest User

anny.lua

a guest
Nov 29th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local cols = "087f78"
  2. local length = 9
  3. local scr_x, scr_y = term.getSize()
  4.  
  5. local render = function(col1,col2,prog)
  6.     term.setCursorPos(1,1)
  7.     local screen = (col1:rep(prog)..col2:rep(length-prog)):rep(scr_x*scr_y):sub(1,(scr_x*scr_y))
  8.     local line
  9.     for a = 1, scr_y do
  10.         line = screen:sub((a-1)*scr_x+1,a*scr_x)
  11.         term.setCursorPos(1,a)
  12.         term.blit(("L"):rep(#line),line,line)
  13.     end
  14. end
  15.  
  16. local pos1 = 2
  17. local pos2 = pos1 - 1
  18. while true do
  19.     for a = 1, length do
  20.         render(cols:sub(pos1,pos1),cols:sub(pos2,pos2),a)
  21.         sleep(0.05)
  22.     end
  23.     pos1 = (pos1 + 1)
  24.     pos2 = (pos2 + 1)
  25.     if pos1 > #cols then pos1 = 1 end
  26.     if pos2 > #cols then pos2 = 1 end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement