Gintarus

Ls_red

Jul 4th, 2026 (edited)
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.75 KB | None | 0 0
  1. local component = require("component")
  2. local event = require("event")
  3. local computer = require("computer")
  4. local unicode = require("unicode")
  5.  
  6. local gpu = component.gpu
  7.  
  8. local function getComponent(...)
  9. for _, name in ipairs({...}) do
  10. local address = component.list(name)()
  11. if address then
  12. return component.proxy(address)
  13. end
  14. end
  15. return nil
  16. end
  17.  
  18. local chat = getComponent("chat_box")
  19. local opb = getComponent("openperipheral_bridge", "terminal_glasses_bridge", "terminal")
  20. local sensor = getComponent("sensor", "radar")
  21. local motionSensor = getComponent("motion_sensor")
  22. local redstone = getComponent("redstone")
  23.  
  24. if chat and chat.setName then
  25. pcall(chat.setName, "§3[PRISMA CHAT]§r")
  26. end
  27.  
  28. local w, h = gpu.getResolution()
  29. local minW, minH = 80, 24
  30. if w < minW or h < minH then
  31. pcall(gpu.setResolution, math.max(w, minW), math.max(h, minH))
  32. w, h = gpu.getResolution()
  33. end
  34.  
  35. local C = {
  36. bg = 0x071018,
  37. panel = 0x0D1C28,
  38. panel2 = 0x102638,
  39. line = 0x1D5A73,
  40. cyan = 0x00D7FF,
  41. blue = 0x3A8DFF,
  42. white = 0xE9FBFF,
  43. dim = 0x7092A4,
  44. green = 0x39FFB6,
  45. yellow = 0xFFD166,
  46. red = 0xFF4E6A,
  47. btn = 0x163142,
  48. btnOn = 0x064B40,
  49. btnWarn = 0x5A1E2B
  50. }
  51.  
  52. local mcColors = {
  53. ["0"] = 0x000000, ["1"] = 0x0000AA, ["2"] = 0x00AA00, ["3"] = 0x00AAAA,
  54. ["4"] = 0xAA0000, ["5"] = 0xAA00AA, ["6"] = 0xFFAA00, ["7"] = 0xAAAAAA,
  55. ["8"] = 0x555555, ["9"] = 0x5555FF, ["a"] = 0x55FF55, ["b"] = 0x55FFFF,
  56. ["c"] = 0xFF5555, ["d"] = 0xFF55FF, ["e"] = 0xFFFF55, ["f"] = 0xFFFFFF,
  57. ["r"] = C.white
  58. }
  59.  
  60. local cfg = {
  61. scanInterval = 2,
  62. motionTimeout = 8,
  63. redstoneMonitorLock = true,
  64. arEnabled = true,
  65. arChatEnabled = true,
  66. arRadarEnabled = true,
  67. arX = 2,
  68. arY = 2,
  69. arW = 230,
  70. arChatWidth = 38,
  71. playerConfig = {
  72. ignore = {"GintaRus"},
  73. prefixes = {
  74. ["111"] = "[Чёрт] ",
  75. ["Noney"] = "[Girl] "
  76. }
  77. }
  78. }
  79.  
  80. local buttons = {}
  81. local chatLog = {}
  82. local arChatLog = {}
  83. local nearbyPlayers = {}
  84. local nearbyGlassNames = {}
  85. local motionTargets = {}
  86. local showIgnoreMenu = false
  87. local needFullRedraw = true
  88. local chatUpdated = true
  89. local arError = nil
  90. local statusMessage = "Готово к работе"
  91. local lastScan = 0
  92. local monitorDisabled = false
  93.  
  94. local leftW = 30
  95. local bottomH = 5
  96. local chatX = leftW + 2
  97. local chatW = w - leftW - 1
  98. local chatH = h - bottomH - 4
  99.  
  100. local function clamp(v, a, b)
  101. if v < a then return a end
  102. if v > b then return b end
  103. return v
  104. end
  105.  
  106. local function text(x, y, value, fg, bg)
  107. gpu.setForeground(fg or C.white)
  108. gpu.setBackground(bg or C.bg)
  109. gpu.set(x, y, value)
  110. end
  111.  
  112. local function clearArea(x, y, bw, bh, bg)
  113. gpu.setBackground(bg or C.bg)
  114. gpu.fill(x, y, bw, bh, " ")
  115. end
  116.  
  117. local function isRedstoneMonitorLocked()
  118. if not cfg.redstoneMonitorLock or not redstone or not redstone.getInput then
  119. return false
  120. end
  121.  
  122. for side = 0, 5 do
  123. local ok, value = pcall(redstone.getInput, side)
  124. if ok and type(value) == "number" and value > 0 then
  125. return true
  126. end
  127. end
  128. return false
  129. end
  130.  
  131. local function updateMonitorLock()
  132. local locked = isRedstoneMonitorLocked()
  133. if locked == monitorDisabled then
  134. return
  135. end
  136.  
  137. monitorDisabled = locked
  138. if monitorDisabled then
  139. buttons = {}
  140. showIgnoreMenu = false
  141. clearArea(1, 1, w, h, 0x000000)
  142. else
  143. needFullRedraw = true
  144. chatUpdated = true
  145. end
  146. end
  147.  
  148. local function frame(x, y, bw, bh, title)
  149. clearArea(x, y, bw, bh, C.panel)
  150. gpu.setForeground(C.line)
  151. gpu.setBackground(C.panel)
  152. gpu.set(x, y, "+" .. string.rep("-", bw - 2) .. "+")
  153. for i = 1, bh - 2 do
  154. gpu.set(x, y + i, "|")
  155. gpu.set(x + bw - 1, y + i, "|")
  156. end
  157. gpu.set(x, y + bh - 1, "+" .. string.rep("-", bw - 2) .. "+")
  158. if title then
  159. local label = " " .. title .. " "
  160. text(x + 2, y, label, C.cyan, C.panel)
  161. end
  162. end
  163.  
  164. local function drawButton(id, x, y, bw, label, bg, fg)
  165. buttons[id] = {x = x, y = y, w = bw, h = 1}
  166. clearArea(x, y, bw, 1, bg or C.btn)
  167. local lx = x + math.max(0, math.floor((bw - unicode.wlen(label)) / 2))
  168. text(lx, y, label, fg or C.white, bg or C.btn)
  169. end
  170.  
  171. local function buttonHit(id, x, y)
  172. local b = buttons[id]
  173. return b and x >= b.x and x < b.x + b.w and y >= b.y and y < b.y + b.h
  174. end
  175.  
  176. local function wrapText(value, maxW)
  177. local lines = {}
  178. local current = ""
  179. value = tostring(value or "")
  180. if maxW < 4 then maxW = 4 end
  181.  
  182. for word in value:gmatch("%S+") do
  183. if current == "" then
  184. current = word
  185. elseif unicode.wlen(current) + unicode.wlen(word) + 1 <= maxW then
  186. current = current .. " " .. word
  187. else
  188. table.insert(lines, current)
  189. current = word
  190. end
  191.  
  192. while unicode.wlen(current) > maxW do
  193. table.insert(lines, unicode.sub(current, 1, maxW))
  194. current = unicode.sub(current, maxW + 1)
  195. end
  196. end
  197.  
  198. if current ~= "" then
  199. table.insert(lines, current)
  200. end
  201. if #lines == 0 then
  202. table.insert(lines, "")
  203. end
  204. return lines
  205. end
  206.  
  207. local function drawColoredText(x, y, line, defaultColor, bg)
  208. local cx = x
  209. local color = defaultColor or C.white
  210. local safe = tostring(line or ""):gsub("§", "&")
  211. local pos = 1
  212.  
  213. gpu.setBackground(bg or C.panel)
  214. while pos <= #safe do
  215. local mark = safe:find("&", pos, true)
  216. if not mark then
  217. gpu.setForeground(color)
  218. gpu.set(cx, y, safe:sub(pos))
  219. break
  220. end
  221.  
  222. if mark > pos then
  223. local chunk = safe:sub(pos, mark - 1)
  224. gpu.setForeground(color)
  225. gpu.set(cx, y, chunk)
  226. cx = cx + unicode.wlen(chunk)
  227. end
  228.  
  229. local code = safe:sub(mark + 1, mark + 1):lower()
  230. if mcColors[code] then
  231. color = mcColors[code]
  232. pos = mark + 2
  233. else
  234. gpu.setForeground(color)
  235. gpu.set(cx, y, "&")
  236. cx = cx + 1
  237. pos = mark + 1
  238. end
  239. end
  240. end
  241.  
  242. local isIgnored
  243.  
  244. local function decoratedName(name)
  245. local prefix = cfg.playerConfig.prefixes[name]
  246. if prefix then
  247. return prefix .. name
  248. end
  249. return name
  250. end
  251.  
  252. local function formatDistance(value)
  253. if not value then
  254. return ""
  255. end
  256. return string.format(" %.1fm", value)
  257. end
  258.  
  259. local function addNearbyPlayer(seen, name, distance)
  260. if not name or name == "" or isIgnored(name) then
  261. return
  262. end
  263.  
  264. local shown = decoratedName(name)
  265. local key = tostring(name):lower()
  266. if seen[key] then
  267. return
  268. end
  269.  
  270. seen[key] = true
  271. table.insert(nearbyPlayers, shown .. formatDistance(distance))
  272. table.insert(nearbyGlassNames, tostring(name))
  273. end
  274.  
  275. local function handleMotionSignal(a, b, c, d, e)
  276. local dx, dy, dz, name
  277.  
  278. if type(a) == "number" then
  279. dx, dy, dz, name = a, b, c, d
  280. elseif type(b) == "number" then
  281. dx, dy, dz, name = b, c, d, e
  282. else
  283. return
  284. end
  285.  
  286. if type(dx) ~= "number" or type(dy) ~= "number" or type(dz) ~= "number" then
  287. return
  288. end
  289.  
  290. name = tostring(name or "Движение")
  291. local distance = math.sqrt(dx * dx + dy * dy + dz * dz)
  292. motionTargets[name] = {
  293. distance = distance,
  294. time = computer.uptime()
  295. }
  296. statusMessage = "Движение: " .. name .. string.format(" %.1fm", distance)
  297. end
  298.  
  299. function isIgnored(name)
  300. for _, ignored in ipairs(cfg.playerConfig.ignore) do
  301. if tostring(name):lower() == tostring(ignored):lower() then
  302. return true
  303. end
  304. end
  305. return false
  306. end
  307.  
  308. local function addChatMessage(name, message)
  309. name = tostring(name or "Unknown")
  310. message = tostring(message or "")
  311. if message:sub(1, 1) == "!" then return end
  312.  
  313. local shownName = decoratedName(name)
  314. local prefix = "&8> &b" .. shownName .. "&8: &f"
  315. local firstWidth = math.max(10, chatW - 8 - unicode.wlen(shownName) - 4)
  316. local restWidth = math.max(10, chatW - 8)
  317. local wrapped = wrapText(message, firstWidth)
  318.  
  319. for i, line in ipairs(wrapped) do
  320. if i == 1 then
  321. table.insert(chatLog, prefix .. line)
  322. else
  323. for _, restLine in ipairs(wrapText(line, restWidth)) do
  324. table.insert(chatLog, "&f " .. restLine)
  325. end
  326. end
  327. end
  328.  
  329. while #chatLog > chatH - 2 do
  330. table.remove(chatLog, 1)
  331. end
  332.  
  333. table.insert(arChatLog, {type = "name", text = shownName})
  334. for _, line in ipairs(wrapText(message, cfg.arChatWidth)) do
  335. table.insert(arChatLog, {type = "msg", text = line})
  336. end
  337. while #arChatLog > 12 do
  338. table.remove(arChatLog, 1)
  339. end
  340.  
  341. statusMessage = "Новое сообщение от " .. name
  342. chatUpdated = true
  343. end
  344.  
  345. local function extractPlayerName(key, value)
  346. if type(value) == "string" then return value end
  347. if type(value) == "table" then
  348. return value.name or value.username or value.player or value[1]
  349. end
  350. if type(key) == "string" then return key end
  351. return nil
  352. end
  353.  
  354. local function sortPlayers()
  355. table.sort(nearbyPlayers, function(a, b)
  356. return a:lower() < b:lower()
  357. end)
  358. end
  359.  
  360. local function scanEnvironment()
  361. nearbyPlayers = {}
  362. nearbyGlassNames = {}
  363. local seen = {}
  364.  
  365. if sensor then
  366. local ok, result = pcall(function()
  367. if sensor.getPlayers then
  368. return sensor.getPlayers()
  369. elseif sensor.getPlayerNames then
  370. return sensor.getPlayerNames()
  371. elseif sensor.players then
  372. return sensor.players()
  373. end
  374. end)
  375.  
  376. if ok and type(result) == "table" then
  377. for key, value in pairs(result) do
  378. addNearbyPlayer(seen, extractPlayerName(key, value))
  379. end
  380. else
  381. statusMessage = "Сенсор списка не отвечает"
  382. end
  383. end
  384.  
  385. local now = computer.uptime()
  386. for name, data in pairs(motionTargets) do
  387. if now - data.time <= cfg.motionTimeout then
  388. addNearbyPlayer(seen, name, data.distance)
  389. else
  390. motionTargets[name] = nil
  391. end
  392. end
  393.  
  394. sortPlayers()
  395. if sensor then
  396. statusMessage = "Сканирование: " .. tostring(#nearbyPlayers) .. " игрок(ов)"
  397. elseif motionSensor then
  398. statusMessage = "Motion sensor: последние движения"
  399. else
  400. statusMessage = "Сенсор не найден"
  401. end
  402. end
  403.  
  404. local function updateAR()
  405. if not opb or not cfg.arEnabled then return end
  406.  
  407. local ok, err = pcall(function()
  408. opb.clear()
  409.  
  410. local scale = 0.75
  411. local lineH = 8
  412. local maxNames = 8
  413. for i, name in ipairs(nearbyGlassNames) do
  414. if i > maxNames then
  415. break
  416. end
  417. if name and name ~= "" then
  418. local textW = unicode.wlen(name) * 5
  419. local x = cfg.arX + math.floor((cfg.arW - textW) / 2)
  420. if x < 0 then x = 0 end
  421. opb.addText(x, cfg.arY + 4 + ((i - 1) * lineH), name, 0x39FFB6).setScale(scale)
  422. end
  423. end
  424.  
  425. opb.sync()
  426. end)
  427.  
  428. if ok then
  429. arError = nil
  430. else
  431. arError = tostring(err)
  432. end
  433. end
  434.  
  435. local function drawHeader()
  436. clearArea(1, 1, w, 2, C.bg)
  437. text(2, 1, "PRISMA CHAT // локальная связь и сенсор", C.cyan, C.bg)
  438. local clock = string.format("UP %ds", math.floor(computer.uptime()))
  439. text(w - unicode.wlen(clock) - 1, 1, clock, C.dim, C.bg)
  440. gpu.setBackground(C.bg)
  441. gpu.setForeground(C.line)
  442. gpu.fill(1, 2, w, 1, "-")
  443. end
  444.  
  445. local function drawPlayers()
  446. frame(1, 3, leftW, h - bottomH - 2, "Игроки рядом")
  447. local status = "сенсор: не найден"
  448. local statusColor = C.red
  449. if sensor then
  450. status = "сенсор: список игроков"
  451. statusColor = C.green
  452. elseif motionSensor then
  453. status = "сенсор: движение"
  454. statusColor = C.yellow
  455. end
  456. text(3, 5, status, statusColor, C.panel)
  457. text(3, 6, "найдено: " .. tostring(#nearbyPlayers), C.white, C.panel)
  458. local listY = 8
  459. local maxRows = h - bottomH - listY - 1
  460. clearArea(3, listY, leftW - 4, maxRows, C.panel)
  461.  
  462. if #nearbyPlayers == 0 then
  463. text(4, listY, "Пусто", C.dim, C.panel)
  464. else
  465. for i = 1, math.min(#nearbyPlayers, maxRows) do
  466. local name = unicode.sub(nearbyPlayers[i], 1, leftW - 8)
  467. text(4, listY + i - 1, string.format("%02d ", i), C.dim, C.panel)
  468. text(7, listY + i - 1, name, C.white, C.panel)
  469. end
  470. end
  471. end
  472.  
  473. local function drawChat()
  474. frame(chatX, 3, chatW, chatH + 2, "Чат")
  475. clearArea(chatX + 2, 4, chatW - 4, chatH, C.panel)
  476.  
  477. if #chatLog == 0 then
  478. text(chatX + 3, 5, "Сообщений пока нет", C.dim, C.panel)
  479. return
  480. end
  481.  
  482. local start = math.max(1, #chatLog - chatH + 1)
  483. local y = 4
  484. for i = start, #chatLog do
  485. drawColoredText(chatX + 2, y, unicode.sub(chatLog[i], 1, chatW - 4), C.white, C.panel)
  486. y = y + 1
  487. end
  488. end
  489.  
  490. local function drawFooter()
  491. local y = h - bottomH + 1
  492. frame(1, y, w, bottomH, "Управление")
  493.  
  494. drawButton("toggle_ar", 3, y + 2, 10, cfg.arEnabled and "AR вкл" or "AR выкл", cfg.arEnabled and C.btnOn or C.btn, cfg.arEnabled and C.green or C.dim)
  495. drawButton("ignore", 15, y + 2, 12, "игнор", C.btn, C.white)
  496. drawButton("prefix", 29, y + 2, 12, "префикс", C.btn, C.cyan)
  497.  
  498. local info = statusMessage
  499. if arError then
  500. info = "AR ошибка: " .. arError
  501. elseif not opb then
  502. info = info .. " | AR-мост не найден"
  503. end
  504. if redstone then
  505. info = info .. " | блокировка экрана: redstone"
  506. end
  507. text(3, y + 3, unicode.sub(info, 1, w - 5), arError and C.red or C.dim, C.panel)
  508. end
  509.  
  510. local function redraw()
  511. buttons = {}
  512. clearArea(1, 1, w, h, C.bg)
  513. drawHeader()
  514. drawPlayers()
  515. drawChat()
  516. drawFooter()
  517. needFullRedraw = false
  518. chatUpdated = false
  519. end
  520.  
  521. local function redrawDynamic()
  522. drawHeader()
  523. drawPlayers()
  524. if chatUpdated then
  525. drawChat()
  526. chatUpdated = false
  527. end
  528. drawFooter()
  529. end
  530.  
  531. local function readInput(title, prompt)
  532. while event.pull(0) do end
  533.  
  534. local mw, mh = 54, 8
  535. local mx = math.floor((w - mw) / 2)
  536. local my = math.floor((h - mh) / 2)
  537. local value = ""
  538. local inputX = mx + unicode.wlen(prompt) + 5
  539. local inputW = mw - unicode.wlen(prompt) - 8
  540. local redrawInput = true
  541.  
  542. while true do
  543. if redrawInput then
  544. clearArea(mx, my, mw, mh, C.panel2)
  545. frame(mx, my, mw, mh, title)
  546. text(mx + 3, my + 3, prompt .. ":", C.white, C.panel)
  547. clearArea(inputX, my + 3, inputW, 1, C.bg)
  548. text(inputX, my + 3, unicode.sub(value .. "_", -inputW + 1), C.cyan, C.bg)
  549. drawButton("input_ok", mx + 7, my + 5, 16, "OK", C.btnOn, C.green)
  550. drawButton("input_cancel", mx + 31, my + 5, 16, "Отмена", C.btnWarn, C.red)
  551. redrawInput = false
  552. end
  553.  
  554. local ev, _, a1, a2 = event.pull()
  555. if ev == "key_down" then
  556. if a2 == 28 then
  557. break
  558. elseif a2 == 14 then
  559. if unicode.wlen(value) > 0 then
  560. value = unicode.sub(value, 1, -2)
  561. redrawInput = true
  562. end
  563. elseif a2 == 1 then
  564. value = nil
  565. break
  566. elseif a1 and a1 >= 32 and unicode.wlen(value) < 32 then
  567. local ok, ch = pcall(unicode.char, a1)
  568. if ok and ch then
  569. value = value .. ch
  570. redrawInput = true
  571. end
  572. end
  573. elseif ev == "touch" then
  574. local tx, ty = a1, a2
  575. if buttonHit("input_ok", tx, ty) then
  576. break
  577. elseif buttonHit("input_cancel", tx, ty) then
  578. value = nil
  579. break
  580. end
  581. end
  582. end
  583.  
  584. buttons["input_ok"] = nil
  585. buttons["input_cancel"] = nil
  586. needFullRedraw = true
  587. return value
  588. end
  589.  
  590. local function drawIgnoreMenu()
  591. local mw, mh = 48, 14
  592. local mx = math.floor((w - mw) / 2)
  593. local my = math.floor((h - mh) / 2)
  594. clearArea(mx, my, mw, mh, C.panel2)
  595. frame(mx, my, mw, mh, "Игнор-лист")
  596.  
  597. if #cfg.playerConfig.ignore == 0 then
  598. text(mx + 4, my + 3, "Список пуст", C.dim, C.panel)
  599. else
  600. for i = 1, math.min(6, #cfg.playerConfig.ignore) do
  601. local name = unicode.sub(cfg.playerConfig.ignore[i], 1, 22)
  602. text(mx + 4, my + 2 + i, tostring(i) .. ". " .. name, C.white, C.panel)
  603. drawButton("unignore_" .. i, mx + 32, my + 2 + i, 12, "убрать", C.btnWarn, C.red)
  604. end
  605. end
  606.  
  607. drawButton("ignore_add", mx + 4, my + mh - 2, 14, "добавить", C.btnOn, C.green)
  608. drawButton("ignore_close", mx + mw - 16, my + mh - 2, 12, "закрыть", C.btn, C.white)
  609. end
  610.  
  611. local function openIgnoreMenu()
  612. showIgnoreMenu = true
  613. drawIgnoreMenu()
  614. end
  615.  
  616. local function handleIgnoreTouch(x, y)
  617. if buttonHit("ignore_close", x, y) then
  618. showIgnoreMenu = false
  619. needFullRedraw = true
  620. return
  621. end
  622.  
  623. if buttonHit("ignore_add", x, y) then
  624. local name = readInput("Добавить в игнор", "Ник")
  625. if name and name ~= "" and not isIgnored(name) then
  626. table.insert(cfg.playerConfig.ignore, name)
  627. scanEnvironment()
  628. updateAR()
  629. end
  630. showIgnoreMenu = true
  631. drawIgnoreMenu()
  632. return
  633. end
  634.  
  635. for i = 1, 6 do
  636. if buttonHit("unignore_" .. i, x, y) then
  637. table.remove(cfg.playerConfig.ignore, i)
  638. scanEnvironment()
  639. updateAR()
  640. drawIgnoreMenu()
  641. return
  642. end
  643. end
  644. end
  645.  
  646. local function handleTouch(x, y)
  647. if showIgnoreMenu then
  648. handleIgnoreTouch(x, y)
  649. return
  650. end
  651.  
  652. if buttonHit("toggle_ar", x, y) then
  653. cfg.arEnabled = not cfg.arEnabled
  654. if opb and not cfg.arEnabled then
  655. pcall(opb.clear)
  656. pcall(opb.sync)
  657. end
  658. needFullRedraw = true
  659. elseif buttonHit("ignore", x, y) then
  660. openIgnoreMenu()
  661. elseif buttonHit("prefix", x, y) then
  662. local name = readInput("Префикс игрока", "Ник")
  663. if name and name ~= "" then
  664. local prefix = readInput("Префикс игрока", "Префикс")
  665. if prefix then
  666. if prefix == "" then
  667. cfg.playerConfig.prefixes[name] = nil
  668. else
  669. cfg.playerConfig.prefixes[name] = prefix .. " "
  670. end
  671. scanEnvironment()
  672. updateAR()
  673. end
  674. end
  675. needFullRedraw = true
  676. end
  677. end
  678.  
  679. scanEnvironment()
  680. updateMonitorLock()
  681. if not monitorDisabled then
  682. redraw()
  683. end
  684. updateAR()
  685.  
  686. while true do
  687. local ev, a, b, c, d, e = event.pull(0.5)
  688. updateMonitorLock()
  689.  
  690. if ev == "chat_message" then
  691. if c ~= nil then
  692. addChatMessage(b, c)
  693. else
  694. addChatMessage(a, b)
  695. end
  696. updateAR()
  697. elseif ev == "touch" and not monitorDisabled then
  698. if type(b) == "number" then
  699. handleTouch(b, c)
  700. else
  701. handleTouch(a, b)
  702. end
  703. elseif ev == "motion" then
  704. handleMotionSignal(a, b, c, d, e)
  705. scanEnvironment()
  706. updateAR()
  707. needFullRedraw = true
  708. elseif ev == "interrupted" then
  709. clearArea(1, 1, w, h, 0x000000)
  710. if opb then
  711. pcall(opb.clear)
  712. pcall(opb.sync)
  713. end
  714. return
  715. end
  716.  
  717. local now = computer.uptime()
  718. if now - lastScan >= cfg.scanInterval then
  719. scanEnvironment()
  720. updateAR()
  721. lastScan = now
  722. end
  723. updateMonitorLock()
  724.  
  725. if monitorDisabled then
  726. -- Экран специально погашен redstone-сигналом.
  727. elseif needFullRedraw then
  728. redraw()
  729. elseif not showIgnoreMenu then
  730. redrawDynamic()
  731. end
  732. end
  733.  
Add Comment
Please, Sign In to add comment