Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Компоненты
- local component = require("component")
- local computer = require("computer")
- local keyboard = require("keyboard")
- local term = require ("term")
- local gpu = component.gpu
- local geo = component.geolyzer
- local holo = component.hologram
- --Переменные
- local scanned
- local y
- local progress
- --Подтверждение
- function confirmation()
- print("Введите 'start' чтобы создать голограмму области, 'exit' чтобы выйти.")
- s = term.read()
- if s:find('start') ~= nil then
- term.clear()
- scanHolo()
- elseif s:find('exit') ~= nil then
- term.clear()
- os.exit()
- end
- end
- --Полоса загрузки
- function loading()
- term.write("Прогресс: ")
- term.write("[")
- x, y = term.getCursor()
- term.setCursor(61, y)
- term.write("]")
- term.setCursor(x, y)
- end
- --Создание голограммы
- function scanHolo()
- term.write("Подготовка...\n")
- computer.beep(800, 0.5)
- os.sleep(0.5)
- computer.beep(400, 0.5)
- holo.setTranslation(0, 0, 0)
- holo.setPaletteColor(1, 0x000000)
- holo.setRotationSpeed(1, 0, 23, 0)
- holo.clear()
- term.write("Создаю голограмму...\n")
- loading()
- for k = -24, 24 do
- _, y = term.getCursor()
- progress = math.floor(((k+24)/48)*100)
- term.write("=")
- gpu.set(63, y, progress.."%")
- for j = -24, 24 do
- scanned = geo.scan(k, j)
- for i = 1, #scanned do
- if scanned[i] ~= 0 then
- holo.set(k+24,i-32, j+24, 2)
- end
- end
- end
- end
- term.write("\nЗавершение...")
- computer.beep(600, 1)
- end
- confirmation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement