Advertisement
FirstSkyler1

Loading - autorun.lua

Jul 15th, 2015
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. local component = require("component")
  2. local gpu = component.gpu
  3. gpu.setResolution(80, 40)
  4. gpu.setBackground(0xFFFFFF)
  5.  
  6. local rec = "nil"
  7. local del = 1
  8. local pos = 1
  9. local col = 0xFF0000
  10. local a = "L"
  11. local b = "o"
  12. local c = "a"
  13. local d = "d"
  14. local e = "i"
  15. local f = "n"
  16. local g = "g"
  17.  
  18. function changeColor()
  19.   if col == 0xFF0000 then
  20.     col = 0xFF9900
  21.   elseif col == 0xFF9900 then
  22.     col = 0xFFFF00
  23.   elseif col == 0xFFFF00 then
  24.     col = 0x00FFFF
  25.   elseif col == 0x00FFFF then
  26.     col = 0x0099FF
  27.   elseif col == 0x0099FF then
  28.     col = 0x0000FF
  29.   elseif col == 0x0000FF then
  30.     col = 0xFF0099
  31.   elseif col == 0xFF0099 then
  32.     col = 0xFF0000
  33.   else
  34.     col = 0x000000
  35.   end
  36. end
  37.  
  38. function renderText()
  39.   gpu.setBackground(0xFFFFFF)
  40.   gpu.fill(1, 2, 20, 1, " ")
  41.   changeColor()
  42.   gpu.setForeground(color)
  43.   gpu.set(pos, 2, a)
  44.   pos = pos+1
  45.   changeColor()
  46.   gpu.setForeground(color)
  47.   gpu.set(pos, 2, b)
  48.   pos = pos+1
  49.   changeColor()
  50.   gpu.setForeground(color)
  51.   gpu.set(pos, 2, c)
  52.   pos = pos+1
  53.   changeColor()
  54.   gpu.setForeground(color)
  55.   gpu.set(pos, 2, d)
  56.   pos = pos+1
  57.   changeColor()
  58.   gpu.setForeground(color)
  59.   gpu.set(pos, 2, e)
  60.   pos = pos+1
  61.   changeColor()
  62.   gpu.setForeground(color)
  63.   gpu.set(pos, 2, f)
  64.   pos = pos+1
  65.   changeColor()
  66.   gpu.setForeground(color)
  67.   gpu.set(pos, 2, g)
  68. end
  69.  
  70. while del ~= 10 do
  71.   renderText()
  72.   del = del+1
  73.   os.sleep(0.5)
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement