DorianH935

Untitled

Jan 29th, 2026
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.32 KB | None | 0 0
  1. -- Advanced OpenGlasses 2 AR Control System
  2. -- Version 2.0 - Enhanced Edition
  3.  
  4. local component = require("component")
  5. local event = require("event")
  6. local term = require("term")
  7. local computer = require("computer")
  8. local serialization = require("serialization")
  9. local filesystem = require("filesystem")
  10.  
  11. -- Components
  12. local gpu = component.gpu
  13. local glasses = component.glasses
  14. local nav = component.navigation
  15. local radar = component.radar
  16. local geo = component.geolyzer or nil
  17.  
  18. -- Configuration
  19. local config = {
  20. radarEnabled = false,
  21. radarRange = 64,
  22. radarUpdateInterval = 0.5,
  23. radarShowPlayers = true,
  24. radarShowMobs = true,
  25.  
  26. fullbrightEnabled = false,
  27. fullbrightOpacity = 0.3,
  28.  
  29. geolyserEnabled = false,
  30. geolyserRadius = 8,
  31. geolyserDepth = 32,
  32.  
  33. hudEnabled = true,
  34. showCoordinates = true,
  35. showCompass = true,
  36. showFPS = false,
  37.  
  38. colors = {
  39. player = 0x00FF00,
  40. hostile = 0xFF0000,
  41. passive = 0x00FFFF,
  42. item = 0xFFFF00,
  43. waypoint = 0xFFFFFF,
  44. ore = 0xFFAA00
  45. }
  46. }
  47.  
  48. -- State
  49. local widgets = {
  50. radar = {},
  51. fullbright = nil,
  52. geolyser = {},
  53. waypoints = {},
  54. hud = {}
  55. }
  56.  
  57. local running = true
  58. local playerPos = {x=0, y=0, z=0}
  59. local playerFacing = 0
  60. local savedWaypoints = {}
  61.  
  62. -- Utility Functions
  63. local function saveConfig()
  64. local file = io.open("/home/ar_config.cfg", "w")
  65. if file then
  66. file:write(serialization.serialize(config))
  67. file:close()
  68. end
  69. end
  70.  
  71. local function loadConfig()
  72. if filesystem.exists("/home/ar_config.cfg") then
  73. local file = io.open("/home/ar_config.cfg", "r")
  74. if file then
  75. local content = file:read("*a")
  76. file:close()
  77. local success, loaded = pcall(serialization.unserialize, content)
  78. if success then
  79. for k, v in pairs(loaded) do
  80. config[k] = v
  81. end
  82. end
  83. end
  84. end
  85. end
  86.  
  87. local function saveWaypoints()
  88. local file = io.open("/home/ar_waypoints.dat", "w")
  89. if file then
  90. file:write(serialization.serialize(savedWaypoints))
  91. file:close()
  92. end
  93. end
  94.  
  95. local function loadWaypoints()
  96. if filesystem.exists("/home/ar_waypoints.dat") then
  97. local file = io.open("/home/ar_waypoints.dat", "r")
  98. if file then
  99. local content = file:read("*a")
  100. file:close()
  101. local success, loaded = pcall(serialization.unserialize, content)
  102. if success then
  103. savedWaypoints = loaded
  104. end
  105. end
  106. end
  107. end
  108.  
  109. local function updatePlayerPos()
  110. local x, y, z = nav.getPosition()
  111. playerPos = {x=math.floor(x), y=math.floor(y), z=math.floor(z)}
  112. playerFacing = nav.getFacing()
  113. end
  114.  
  115. local function getDistance(x1, y1, z1, x2, y2, z2)
  116. return math.sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2)
  117. end
  118.  
  119. local function getCardinalDirection(yaw)
  120. yaw = yaw % 360
  121. if yaw < 0 then yaw = yaw + 360 end
  122.  
  123. if yaw >= 337.5 or yaw < 22.5 then return "S"
  124. elseif yaw >= 22.5 and yaw < 67.5 then return "SW"
  125. elseif yaw >= 67.5 and yaw < 112.5 then return "W"
  126. elseif yaw >= 112.5 and yaw < 157.5 then return "NW"
  127. elseif yaw >= 157.5 and yaw < 202.5 then return "N"
  128. elseif yaw >= 202.5 and yaw < 247.5 then return "NE"
  129. elseif yaw >= 247.5 and yaw < 292.5 then return "E"
  130. elseif yaw >= 292.5 and yaw < 337.5 then return "SE"
  131. end
  132. return "?"
  133. end
  134.  
  135. -- Widget Management
  136. local function clearAllWidgets()
  137. glasses.removeAll()
  138. widgets.radar = {}
  139. widgets.fullbright = nil
  140. widgets.geolyser = {}
  141. widgets.waypoints = {}
  142. widgets.hud = {}
  143. end
  144.  
  145. local function clearRadar()
  146. for _, widget in pairs(widgets.radar) do
  147. if widget and widget.removeWidget then
  148. widget.removeWidget()
  149. end
  150. end
  151. widgets.radar = {}
  152. end
  153.  
  154. local function clearGeolyser()
  155. for _, widget in pairs(widgets.geolyser) do
  156. if widget and widget.removeWidget then
  157. widget.removeWidget()
  158. end
  159. end
  160. widgets.geolyser = {}
  161. end
  162.  
  163. local function clearHUD()
  164. for _, widget in pairs(widgets.hud) do
  165. if widget and widget.removeWidget then
  166. widget.removeWidget()
  167. end
  168. end
  169. widgets.hud = {}
  170. end
  171.  
  172. -- Fullbright
  173. local function enableFullbright()
  174. if widgets.fullbright then
  175. widgets.fullbright.removeWidget()
  176. end
  177.  
  178. -- Create large bright quad overlay
  179. widgets.fullbright = glasses.addQuad2D()
  180. widgets.fullbright.addPoint(-200, -200)
  181. widgets.fullbright.addPoint(200, -200)
  182. widgets.fullbright.addPoint(200, 200)
  183. widgets.fullbright.addPoint(-200, 200)
  184. widgets.fullbright.setColor(255, 255, 255)
  185. widgets.fullbright.setAlpha(config.fullbrightOpacity)
  186.  
  187. config.fullbrightEnabled = true
  188. end
  189.  
  190. local function disableFullbright()
  191. if widgets.fullbright then
  192. widgets.fullbright.removeWidget()
  193. widgets.fullbright = nil
  194. end
  195. config.fullbrightEnabled = false
  196. end
  197.  
  198. -- HUD
  199. local function updateHUD()
  200. if not config.hudEnabled then return end
  201.  
  202. clearHUD()
  203. updatePlayerPos()
  204.  
  205. local yOffset = -90
  206.  
  207. -- Coordinates
  208. if config.showCoordinates then
  209. local coordText = glasses.addText2D()
  210. coordText.setText(string.format("XYZ: %d, %d, %d", playerPos.x, playerPos.y, playerPos.z))
  211. coordText.setPosition(5, yOffset)
  212. coordText.setColor(255, 255, 255)
  213. table.insert(widgets.hud, coordText)
  214. yOffset = yOffset + 10
  215. end
  216.  
  217. -- Compass
  218. if config.showCompass then
  219. local direction = getCardinalDirection(playerFacing)
  220. local compassText = glasses.addText2D()
  221. compassText.setText(string.format("Facing: %s (%.1f°)", direction, playerFacing))
  222. compassText.setPosition(5, yOffset)
  223. compassText.setColor(255, 255, 0)
  224. table.insert(widgets.hud, compassText)
  225. yOffset = yOffset + 10
  226. end
  227.  
  228. -- Status indicators
  229. local statusText = glasses.addText2D()
  230. local status = {}
  231. if config.radarEnabled then table.insert(status, "RADAR") end
  232. if config.fullbrightEnabled then table.insert(status, "BRIGHT") end
  233. if config.geolyserEnabled then table.insert(status, "GEO") end
  234.  
  235. if #status > 0 then
  236. statusText.setText("Active: " .. table.concat(status, " | "))
  237. else
  238. statusText.setText("All systems standby")
  239. end
  240. statusText.setPosition(5, yOffset)
  241. statusText.setColor(0, 255, 0)
  242. table.insert(widgets.hud, statusText)
  243. end
  244.  
  245. -- Radar
  246. local function updateRadar()
  247. if not config.radarEnabled then return end
  248.  
  249. clearRadar()
  250. updatePlayerPos()
  251.  
  252. local entities = radar.getPlayers(config.radarRange)
  253.  
  254. for _, ent in ipairs(entities) do
  255. local dist = getDistance(playerPos.x, playerPos.y, playerPos.z, ent.x, ent.y, ent.z)
  256.  
  257. -- Skip if too close (probably the player)
  258. if dist > 1 then
  259. local color = config.colors.player
  260. local isHostile = false
  261.  
  262. -- Classify entity
  263. local name = ent.name or "Unknown"
  264. if name:match("Creeper") or name:match("Zombie") or name:match("Skeleton") or
  265. name:match("Spider") or name:match("Witch") or name:match("Enderman") then
  266. color = config.colors.hostile
  267. isHostile = true
  268. elseif name:match("Cow") or name:match("Sheep") or name:match("Pig") or
  269. name:match("Chicken") or name:match("Horse") then
  270. color = config.colors.passive
  271. end
  272.  
  273. -- Create marker
  274. local dot = glasses.addDot3D()
  275. dot.set3DPos(ent.x, ent.y + 1, ent.z)
  276. dot.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  277. dot.setSize(isHostile and 3 or 2)
  278. dot.setAlpha(0.9)
  279.  
  280. -- Create label using text3d
  281. local label = glasses.addText3D()
  282. label.set3DPos(ent.x, ent.y + 2, ent.z)
  283. label.setText(string.format("%s\n%.1fm", name, dist))
  284. label.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  285. label.setAlpha(0.8)
  286.  
  287. -- Add warning for hostile mobs nearby
  288. if isHostile and dist < 10 then
  289. local warning = glasses.addText3D()
  290. warning.set3DPos(ent.x, ent.y + 2.5, ent.z)
  291. warning.setText("! DANGER !")
  292. warning.setColor(255, 0, 0)
  293. warning.setAlpha(1.0)
  294. table.insert(widgets.radar, warning)
  295. end
  296.  
  297. table.insert(widgets.radar, dot)
  298. table.insert(widgets.radar, label)
  299. end
  300. end
  301. end
  302.  
  303. -- Geolyser
  304. local function isOre(hardness)
  305. return hardness >= 3 and hardness <= 5
  306. end
  307.  
  308. local function updateGeolyser()
  309. if not config.geolyserEnabled or not geo then return end
  310.  
  311. clearGeolyser()
  312. updatePlayerPos()
  313.  
  314. local radius = config.geolyserRadius
  315. local depth = config.geolyserDepth
  316. local foundOres = 0
  317.  
  318. -- Scan in layers
  319. for y = 0, -depth, -2 do
  320. local scan = geo.scan(playerPos.x, playerPos.y + y, playerPos.z, radius, radius, 1)
  321. local idx = 1
  322.  
  323. for dx = -radius, radius-1 do
  324. for dz = -radius, radius-1 do
  325. local hardness = scan[idx]
  326. idx = idx + 1
  327.  
  328. if hardness and isOre(hardness) then
  329. local wx = playerPos.x + dx
  330. local wy = playerPos.y + y
  331. local wz = playerPos.z + dz
  332.  
  333. local cube = glasses.addCube3D()
  334. cube.set3DPos(wx + 0.5, wy + 0.5, wz + 0.5)
  335. cube.setColor(255, 170, 0)
  336. cube.setAlpha(0.4)
  337. cube.setScale(0.8)
  338. cube.setVisibleThroughObjects(true)
  339.  
  340. table.insert(widgets.geolyser, cube)
  341. foundOres = foundOres + 1
  342. end
  343. end
  344. end
  345. end
  346.  
  347. -- Update HUD with ore count
  348. if foundOres > 0 then
  349. local oreLabel = glasses.addText2D()
  350. oreLabel.setText(string.format("Ores detected: %d", foundOres))
  351. oreLabel.setPosition(5, -70)
  352. oreLabel.setColor(255, 170, 0)
  353. table.insert(widgets.hud, oreLabel)
  354. end
  355. end
  356.  
  357. -- Waypoint Management
  358. local function clearWaypoints()
  359. for _, widget in pairs(widgets.waypoints) do
  360. if widget and widget.removeWidget then
  361. widget.removeWidget()
  362. end
  363. end
  364. widgets.waypoints = {}
  365. end
  366.  
  367. local function addWaypoint(name, x, y, z, color)
  368. color = color or config.colors.waypoint
  369.  
  370. local marker = glasses.addDot3D()
  371. marker.set3DPos(x, y, z)
  372. marker.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  373. marker.setSize(4)
  374. marker.setAlpha(1.0)
  375.  
  376. local label = glasses.addText3D()
  377. label.set3DPos(x, y + 1, z)
  378. updatePlayerPos()
  379. local dist = getDistance(playerPos.x, playerPos.y, playerPos.z, x, y, z)
  380. label.setText(string.format("%s\n%.1fm", name, dist))
  381. label.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  382.  
  383. table.insert(widgets.waypoints, marker)
  384. table.insert(widgets.waypoints, label)
  385. end
  386.  
  387. local function refreshWaypoints()
  388. clearWaypoints()
  389. for _, wp in ipairs(savedWaypoints) do
  390. addWaypoint(wp.name, wp.x, wp.y, wp.z, wp.color)
  391. end
  392. end
  393.  
  394. -- UI Drawing
  395. local function drawMenu()
  396. term.clear()
  397. gpu.setBackground(0x000000)
  398. gpu.setForeground(0xFFFFFF)
  399.  
  400. print("╔═════════════════════════════════════════════╗")
  401. print("║ OpenGlasses 2 AR Control System v2.0 ║")
  402. print("╚═════════════════════════════════════════════╝")
  403. print()
  404.  
  405. updatePlayerPos()
  406. print(string.format("Position: %d, %d, %d | Facing: %s",
  407. playerPos.x, playerPos.y, playerPos.z, getCardinalDirection(playerFacing)))
  408. print()
  409.  
  410. print("╔═══ FEATURES ═══════════════════════════════╗")
  411. print(string.format("║ [1] Radar: %-7s Range: %2dm ║",
  412. config.radarEnabled and "ON" or "OFF", config.radarRange))
  413. print(string.format("║ [2] Fullbright: %-7s Opacity: %3d%% ║",
  414. config.fullbrightEnabled and "ON" or "OFF", math.floor(config.fullbrightOpacity * 100)))
  415.  
  416. if geo then
  417. print(string.format("║ [3] Geolyser: %-7s R:%2d D:%2d ║",
  418. config.geolyserEnabled and "ON" or "OFF", config.geolyserRadius, config.geolyserDepth))
  419. else
  420. print("║ [3] Geolyser: N/A (no geolyzer) ║")
  421. end
  422.  
  423. print(string.format("║ [4] HUD: %-7s ║",
  424. config.hudEnabled and "ON" or "OFF"))
  425. print("╚════════════════════════════════════════════╝")
  426. print()
  427.  
  428. print("╔═══ WAYPOINTS ══════════════════════════════╗")
  429. print("║ [W] Add Waypoint at Current Position ║")
  430. print("║ [L] List Waypoints ║")
  431. print("║ [D] Delete Waypoint ║")
  432. print(string.format("║ Total Waypoints: %-3d ║", #savedWaypoints))
  433. print("╚════════════════════════════════════════════╝")
  434. print()
  435.  
  436. print("╔═══ SETTINGS ═══════════════════════════════╗")
  437. print("║ [R] Adjust Radar Range ║")
  438. print("║ [F] Adjust Fullbright Opacity ║")
  439. if geo then
  440. print("║ [G] Adjust Geolyser Settings ║")
  441. end
  442. print("║ [H] Toggle HUD Elements ║")
  443. print("╚════════════════════════════════════════════╝")
  444. print()
  445.  
  446. print("╔═══ SYSTEM ═════════════════════════════════╗")
  447. print("║ [C] Clear All Widgets ║")
  448. print("║ [S] Save Configuration ║")
  449. print("║ [Q] Quit ║")
  450. print("╚════════════════════════════════════════════╝")
  451. print()
  452. print("Press a key to select option...")
  453. end
  454.  
  455. local function listWaypoints()
  456. term.clear()
  457. print("╔═══ WAYPOINTS ══════════════════════════════╗")
  458. if #savedWaypoints == 0 then
  459. print("║ No waypoints saved ║")
  460. else
  461. for i, wp in ipairs(savedWaypoints) do
  462. print(string.format("║ %2d. %-20s (%d,%d,%d) ║",
  463. i, wp.name:sub(1,20), wp.x, wp.y, wp.z))
  464. end
  465. end
  466. print("╚════════════════════════════════════════════╝")
  467. print("\nPress any key to continue...")
  468. event.pull("key_down")
  469. end
  470.  
  471. -- Event Handlers
  472. local function handleInput(char, code)
  473. if char == 0 then return end
  474.  
  475. local key = string.char(char):lower()
  476.  
  477. if key == "1" then
  478. config.radarEnabled = not config.radarEnabled
  479. if config.radarEnabled then
  480. updateRadar()
  481. else
  482. clearRadar()
  483. end
  484. updateHUD()
  485.  
  486. elseif key == "2" then
  487. if config.fullbrightEnabled then
  488. disableFullbright()
  489. else
  490. enableFullbright()
  491. end
  492. updateHUD()
  493.  
  494. elseif key == "3" and geo then
  495. config.geolyserEnabled = not config.geolyserEnabled
  496. if config.geolyserEnabled then
  497. updateGeolyser()
  498. else
  499. clearGeolyser()
  500. end
  501. updateHUD()
  502.  
  503. elseif key == "4" then
  504. config.hudEnabled = not config.hudEnabled
  505. if config.hudEnabled then
  506. updateHUD()
  507. else
  508. clearHUD()
  509. end
  510.  
  511. elseif key == "w" then
  512. term.clear()
  513. print("Add Waypoint at Current Position")
  514. updatePlayerPos()
  515. print(string.format("Position: %d, %d, %d", playerPos.x, playerPos.y, playerPos.z))
  516. print("\nEnter waypoint name:")
  517. local name = io.read()
  518. if name and name ~= "" then
  519. table.insert(savedWaypoints, {
  520. name = name,
  521. x = playerPos.x,
  522. y = playerPos.y,
  523. z = playerPos.z,
  524. color = config.colors.waypoint
  525. })
  526. saveWaypoints()
  527. refreshWaypoints()
  528. print("\nWaypoint added!")
  529. os.sleep(1)
  530. end
  531.  
  532. elseif key == "l" then
  533. listWaypoints()
  534.  
  535. elseif key == "d" then
  536. if #savedWaypoints == 0 then
  537. term.clear()
  538. print("No waypoints to delete!")
  539. os.sleep(1)
  540. return
  541. end
  542. listWaypoints()
  543. print("\nEnter waypoint number to delete (or 0 to cancel):")
  544. local num = tonumber(io.read())
  545. if num and num > 0 and num <= #savedWaypoints then
  546. table.remove(savedWaypoints, num)
  547. saveWaypoints()
  548. refreshWaypoints()
  549. print("Waypoint deleted!")
  550. os.sleep(1)
  551. end
  552.  
  553. elseif key == "r" then
  554. term.clear()
  555. print(string.format("Current radar range: %dm", config.radarRange))
  556. print("Enter new range (1-64):")
  557. local range = tonumber(io.read())
  558. if range and range >= 1 and range <= 64 then
  559. config.radarRange = range
  560. if config.radarEnabled then
  561. updateRadar()
  562. end
  563. end
  564.  
  565. elseif key == "f" then
  566. term.clear()
  567. print(string.format("Current fullbright opacity: %d%%",
  568. math.floor(config.fullbrightOpacity * 100)))
  569. print("Enter new opacity (0-100):")
  570. local opacity = tonumber(io.read())
  571. if opacity and opacity >= 0 and opacity <= 100 then
  572. config.fullbrightOpacity = opacity / 100
  573. if config.fullbrightEnabled then
  574. disableFullbright()
  575. enableFullbright()
  576. end
  577. end
  578.  
  579. elseif key == "g" and geo then
  580. term.clear()
  581. print(string.format("Current radius: %dm", config.geolyserRadius))
  582. print("Enter new radius (1-16):")
  583. local radius = tonumber(io.read())
  584. if radius and radius >= 1 and radius <= 16 then
  585. config.geolyserRadius = radius
  586. end
  587. print(string.format("Current depth: %dm", config.geolyserDepth))
  588. print("Enter new depth (1-64):")
  589. local depth = tonumber(io.read())
  590. if depth and depth >= 1 and depth <= 64 then
  591. config.geolyserDepth = depth
  592. end
  593. if config.geolyserEnabled then
  594. updateGeolyser()
  595. end
  596.  
  597. elseif key == "h" then
  598. term.clear()
  599. print("HUD Element Toggles:")
  600. print(string.format("[1] Coordinates: %s", config.showCoordinates and "ON" or "OFF"))
  601. print(string.format("[2] Compass: %s", config.showCompass and "ON" or "OFF"))
  602. print("\nEnter option (1-2):")
  603. local opt = io.read()
  604. if opt == "1" then
  605. config.showCoordinates = not config.showCoordinates
  606. elseif opt == "2" then
  607. config.showCompass = not config.showCompass
  608. end
  609. updateHUD()
  610.  
  611. elseif key == "c" then
  612. clearAllWidgets()
  613. config.radarEnabled = false
  614. config.fullbrightEnabled = false
  615. config.geolyserEnabled = false
  616. config.hudEnabled = false
  617.  
  618. elseif key == "s" then
  619. saveConfig()
  620. term.clear()
  621. print("Configuration saved!")
  622. os.sleep(1)
  623.  
  624. elseif key == "q" then
  625. running = false
  626. end
  627. end
  628.  
  629. -- Main Loop
  630. local function mainLoop()
  631. local lastRadarUpdate = 0
  632. local lastGeoUpdate = 0
  633. local lastHUDUpdate = 0
  634.  
  635. while running do
  636. drawMenu()
  637.  
  638. local currentTime = computer.uptime()
  639.  
  640. -- Update radar
  641. if config.radarEnabled and (currentTime - lastRadarUpdate) > config.radarUpdateInterval then
  642. updateRadar()
  643. lastRadarUpdate = currentTime
  644. end
  645.  
  646. -- Update geolyser
  647. if config.geolyserEnabled and (currentTime - lastGeoUpdate) > 5 then
  648. updateGeolyser()
  649. lastGeoUpdate = currentTime
  650. end
  651.  
  652. -- Update HUD
  653. if config.hudEnabled and (currentTime - lastHUDUpdate) > 1 then
  654. updateHUD()
  655. lastHUDUpdate = currentTime
  656. end
  657.  
  658. -- Input handling
  659. local eventType, _, char, code = event.pull(0.1, "key_down")
  660. if eventType == "key_down" then
  661. handleInput(char, code)
  662. end
  663. end
  664. end
  665.  
  666. -- Initialization
  667. term.clear()
  668. print("╔═══════════════════════════════════════════╗")
  669. print("║ OpenGlasses 2 AR Control System v2.0 ║")
  670. print("║ Initializing... ║")
  671. print("╚═══════════════════════════════════════════╝")
  672. print()
  673.  
  674. -- Check components
  675. print("Checking components...")
  676. if not component.isAvailable("glasses") then
  677. print("✗ ERROR: OpenGlasses Terminal not found!")
  678. return
  679. else
  680. print("✓ OpenGlasses Terminal found")
  681. end
  682.  
  683. if not component.isAvailable("navigation") then
  684. print("✗ ERROR: Navigation upgrade not found!")
  685. return
  686. else
  687. print("✓ Navigation upgrade found")
  688. end
  689.  
  690. if not component.isAvailable("radar") then
  691. print("✗ ERROR: Radar upgrade not found!")
  692. return
  693. else
  694. print("✓ Radar upgrade found")
  695. end
  696.  
  697. if not component.isAvailable("geolyzer") then
  698. print("⚠ WARNING: Geolyzer not found (feature disabled)")
  699. else
  700. print("✓ Geolyzer found")
  701. end
  702.  
  703. print()
  704. print("Loading configuration...")
  705. loadConfig()
  706. loadWaypoints()
  707.  
  708. print("✓ Configuration loaded")
  709. print()
  710. print("Refreshing waypoints...")
  711. refreshWaypoints()
  712.  
  713. if config.hudEnabled then
  714. updateHUD()
  715. end
  716.  
  717. print()
  718. print("✓ All systems ready!")
  719. os.sleep(2)
  720.  
  721. -- Run
  722. clearAllWidgets()
  723. mainLoop()
  724.  
  725. -- Cleanup
  726. clearAllWidgets()
  727. saveConfig()
  728. saveWaypoints()
  729. term.clear()
  730. print("AR Control System shutdown complete.")
  731. print("Configuration and waypoints saved.")
Advertisement
Add Comment
Please, Sign In to add comment