Laine_prikol

Simple Screensaver modified by kotik_prikol

Feb 5th, 2017
173
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Simple screensaver Laine_prikol and modified by Kotik_Prikol 1.1
  2. local component = require("component")
  3. local gpu = component.gpu
  4. local os = require("os")
  5. local term = require("term")
  6. input = "None"
  7. stopping = 0
  8. -----------------------------
  9. term.clear()
  10. print("Введите режим: [a] - Веселый пацан [b] - Красный квадрат [c] - Синий  квадрат  [d] - Зелёный квадрат")
  11. while true do
  12. input = io.read()
  13.   if input == "a" then
  14.   term.clear()
  15.     while true do
  16.     os.sleep(0)
  17.     local x = math.random(0, 160)
  18.     local y = math.random(0, 80)
  19.     local x1 = x + math.random(0,10)
  20.     local y1 = y + math.random(1,5)
  21.     local x2 = x + math.random(1,8)
  22.     local y2 = y + math.random(2,5)
  23.     gpu.set(x,y, "♥")
  24.     stopping = stopping + 1
  25.     gpu.setForeground(0x0000FF)
  26.     gpu.set(x1,y1, "☺")
  27.     stopping = stopping + 1
  28.     gpu.setForeground(0x008000)
  29.     gpu.set(x2,y2, "◌")
  30.     stopping = stopping + 1
  31.     gpu.set(x2+4,y2+5, "◊")
  32.     stopping = stopping + 1
  33.     gpu.setForeground(0x008000)
  34.     gpu.set(x2+2,y2+1, "♫")
  35.     stopping = stopping + 1
  36.     gpu.setForeground(0xF00000)
  37.     if stopping == 3000  then
  38.     os.sleep(10000000)
  39.     end
  40.     end
  41. end
  42.   if input == "b" then
  43.   term.clear()
  44.     while true do
  45.     os.sleep(0)
  46.     local x = math.random(0, 160)
  47.     local y = math.random(0, 80)
  48.     local x1 = x + math.random(0,10)
  49.     local y1 = y + math.random(1,5)
  50.     local x2 = x + math.random(1,8)
  51.     local y2 = y + math.random(2,5)
  52.     gpu.set(x,y, "█")
  53.     stopping = stopping + 1
  54.     gpu.setForeground(0xff0000)
  55.     gpu.set(x1,y1, "█")
  56.     stopping = stopping + 1
  57.     gpu.setForeground(0xff1a1a)
  58.     gpu.set(x2,y2, "█")
  59.     gpu.set(x2+4,y2+5, " ")
  60.     gpu.setForeground(0xe60000)
  61.     gpu.set(x2+2,y2+1, "█")
  62.     stopping = stopping + 1
  63.     gpu.setForeground(0xff8080)
  64.     if stopping == 3000 then
  65.     os.sleeep(10000000)
  66.    end
  67.   end
  68.   if input == "c" then
  69.   term.clear()
  70.     while true do
  71.     os.sleep(0)
  72.     local x = math.random(0, 160)
  73.     local y = math.random(0, 80)
  74.     local x1 = x + math.random(0,10)
  75.     local y1 = y + math.random(1,5)
  76.     local x2 = x + math.random(1,8)
  77.     local y2 = y + math.random(2,5)
  78.      gpu.set(x,y, "█")
  79.     stopping = stopping + 1
  80.     gpu.setForeground(0x0033cc)
  81.     gpu.set(x1,y1, "█")
  82.     stopping = stopping + 1
  83.     gpu.setForeground(0x4d79ff)
  84.     gpu.set(x2,y2, "█")
  85.     stopping = stopping + 1
  86.     gpu.set(x2+4,y2+5, " ")
  87.     gpu.setForeground(0x002080)
  88.     gpu.set(x2+2,y2+1, "█")
  89.     stopping = stopping + 1
  90.     gpu.setForeground(0x002699)
  91.     if stopping == 3000 then
  92.     os.sleep(10000)
  93.  end
  94.   end
  95. end
  96.   if input == "d" then
  97.     while true do
  98.     os.sleep(0)
  99.     local x = math.random(0, 160)
  100.     local y = math.random(0, 80)
  101.     local x1 = x + math.random(0,10)
  102.     local y1 = y + math.random(1,5)
  103.     local x2 = x + math.random(1,8)
  104.     local y2 = y + math.random(2,5)
  105.     gpu.set(x,y, "█")
  106.     stopping = stopping + 1
  107.     gpu.setForeground(0x33cc33)
  108.     gpu.set(x1,y1, "█")
  109.     stopping = stopping + 1
  110.     gpu.setForeground(0x196619)
  111.     gpu.set(x2,y2, "█")
  112.     stopping = stopping + 1
  113.     gpu.set(x2+4,y2+5, " ")
  114.     stopping = stopping + 1
  115.     gpu.setForeground(0xadebad)
  116.     gpu.set(x2+2,y2+1, "█")
  117.     stopping = stopping + 1
  118.     gpu.setForeground(0x47d147)
  119.     if stopping == 3000  then
  120.     os.sleep(100000)
  121. end
  122. end
  123.    end
  124. end
  125. end
RAW Paste Data