Advertisement
Guest User

loadscreen.lua

a guest
Jun 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. local component = require("component")
  2. local gpu = component.gpu
  3. local term = require("term")
  4.  
  5. local w,h = gpu.getResolution()
  6.  
  7. function printInfo()
  8.     term.clear()
  9.     gpu.setBackground(0xFFFFFF)
  10.     local info = {
  11.         "XX     XXXX  XXXXX  XXXXX",
  12.         "XX     X     X   X  X   X",
  13.         "XX     XXXX  X   X  XXXXX",
  14.         "XX     X     X   X  X   X",
  15.         "XXXXX  XXXX  XXXX   X   X"
  16.     }
  17.     local index = {}
  18.     index[1] = w/3
  19.     index[2] = h/3
  20.     for k,v in pairs(info) do  
  21.         for i = 1, string.len(v) do
  22.             local curr  = string.sub(v, i, i)
  23.             if (curr == "X") then
  24.               gpu.fill(index[1],index[2],1,1," ")
  25.             end
  26.             index[1] = index[1] + 1
  27.         end
  28.         index[2] = index[2] + 1
  29.         index[1] = w/3
  30.     end
  31. end
  32.  
  33. printInfo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement