Bogatyr4ik

MineBoT

Jan 31st, 2021 (edited)
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. local r       = require("robot")
  2. local com     = require("component")
  3. local term    = require("term")
  4. local unicode = require("unicode")
  5. local gpu     = com.gpu
  6. local w, h    = 50, 16  -- разрешение экрана (1тир макс "50, 16")
  7.  
  8. term.clear()
  9. gpu.setResolution(w, h)
  10. --gpu.setBackground(0xFFFFFF)       -- цвет фона
  11. --gpu.setForeground(0x000000)       -- цвет текста
  12. gpu.fill(1, 1, w, h, " ")         -- заливаем пустоту
  13. -- Обводка экрана
  14. gpu.fill(1, 1, 1, 1, "┌")
  15. gpu.fill(1, h, 1, 1, "└")
  16. gpu.fill(1, 2 ,1, h-2, "│")       -- левая полола
  17. gpu.fill(w, 2, 1, h-2, "│")       -- правая полоса
  18. gpu.fill(2, 1, w-2, 1, "─")       -- верхняя полоса
  19. gpu.fill(2, h, w-2, 1, "─")       -- нижняя полоса
  20. gpu.fill(w, 1, 1, 1, "┐")
  21. gpu.fill(w, h, 1, 1, "┘")
  22. -- Текст
  23. gpu.set(3, 2, "Робот "..r.name().." запущен!")
  24. gpu.fill(3, 3, unicode.len("Робот "..r.name().." запущен!"), 1, "─")
  25. gpu.set(w-1-unicode.len("by bogatyr4ik"), h-1, "by bogatyr4ik")
  26.  
  27.  while true do
  28.   local mine, temp = r.detect()
  29.     if mine and temp ~= "entity" then
  30.     r.swing()
  31.   end
  32.   os.sleep(0)
  33. end
Add Comment
Please, Sign In to add comment