DorianH935

Untitled

Jan 29th, 2026
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.45 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. widgets.fullbright = glasses.addCube3D()
  179. widgets.fullbright.set3DPos(0, 0, 0)
  180. widgets.fullbright.setColor(255, 255, 255)
  181. widgets.fullbright.setAlpha(config.fullbrightOpacity)
  182. widgets.fullbright.setScale(200)
  183. widgets.fullbright.setVisibleThroughObjects(true)
  184.  
  185. config.fullbrightEnabled = true
  186. end
  187.  
  188. local function disableFullbright()
  189. if widgets.fullbright then
  190. widgets.fullbright.removeWidget()
  191. widgets.fullbright = nil
  192. end
  193. config.fullbrightEnabled = false
  194. end
  195.  
  196. -- HUD
  197. local function updateHUD()
  198. if not config.hudEnabled then return end
  199.  
  200. clearHUD()
  201. updatePlayerPos()
  202.  
  203. local yOffset = -90
  204.  
  205. -- Coordinates
  206. if config.showCoordinates then
  207. local coordText = glasses.addTextLabel()
  208. coordText.setText(string.format("XYZ: %d, %d, %d", playerPos.x, playerPos.y, playerPos.z))
  209. coordText.setPosition(5, yOffset)
  210. coordText.setColor(255, 255, 255)
  211. coordText.setScale(1.0)
  212. table.insert(widgets.hud, coordText)
  213. yOffset = yOffset + 10
  214. end
  215.  
  216. -- Compass
  217. if config.showCompass then
  218. local direction = getCardinalDirection(playerFacing)
  219. local compassText = glasses.addTextLabel()
  220. compassText.setText(string.format("Facing: %s (%.1f°)", direction, playerFacing))
  221. compassText.setPosition(5, yOffset)
  222. compassText.setColor(255, 255, 0)
  223. compassText.setScale(1.0)
  224. table.insert(widgets.hud, compassText)
  225. yOffset = yOffset + 10
  226. end
  227.  
  228. -- Status indicators
  229. local statusText = glasses.addTextLabel()
  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. statusText.setScale(0.8)
  243. table.insert(widgets.hud, statusText)
  244. end
  245.  
  246. -- Radar
  247. local function updateRadar()
  248. if not config.radarEnabled then return end
  249.  
  250. clearRadar()
  251. updatePlayerPos()
  252.  
  253. local entities = radar.getPlayers(config.radarRange)
  254.  
  255. for _, ent in ipairs(entities) do
  256. local dist = getDistance(playerPos.x, playerPos.y, playerPos.z, ent.x, ent.y, ent.z)
  257.  
  258. -- Skip if too close (probably the player)
  259. if dist > 1 then
  260. local color = config.colors.player
  261. local isHostile = false
  262.  
  263. -- Classify entity
  264. local name = ent.name or "Unknown"
  265. if name:match("Creeper") or name:match("Zombie") or name:match("Skeleton") or
  266. name:match("Spider") or name:match("Witch") or name:match("Enderman") then
  267. color = config.colors.hostile
  268. isHostile = true
  269. elseif name:match("Cow") or name:match("Sheep") or name:match("Pig") or
  270. name:match("Chicken") or name:match("Horse") then
  271. color = config.colors.passive
  272. end
  273.  
  274. -- Create marker
  275. local dot = glasses.addDot3D()
  276. dot.set3DPos(ent.x, ent.y + 1, ent.z)
  277. dot.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  278. dot.setSize(isHostile and 3 or 2)
  279. dot.setAlpha(0.9)
  280.  
  281. -- Create label
  282. local label = glasses.addFloatingText()
  283. label.set3DPos(ent.x, ent.y + 2, ent.z)
  284. label.setText(string.format("%s\n%.1fm", name, dist))
  285. label.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  286. label.setScale(0.5)
  287. label.setAlpha(0.8)
  288.  
  289. -- Add warning for hostile mobs nearby
  290. if isHostile and dist < 10 then
  291. local warning = glasses.addFloatingText()
  292. warning.set3DPos(ent.x, ent.y + 2.5, ent.z)
  293. warning.setText("⚠ DANGER ⚠")
  294. warning.setColor(255, 0, 0)
  295. warning.setScale(0.7)
  296. warning.setAlpha(1.0)
  297. table.insert(widgets.radar, warning)
  298. end
  299.  
  300. table.insert(widgets.radar, dot)
  301. table.insert(widgets.radar, label)
  302. end
  303. end
  304. end
  305.  
  306. -- Geolyser
  307. local function isOre(hardness)
  308. return hardness >= 3 and hardness <= 5
  309. end
  310.  
  311. local function updateGeolyser()
  312. if not config.geolyserEnabled or not geo then return end
  313.  
  314. clearGeolyser()
  315. updatePlayerPos()
  316.  
  317. local radius = config.geolyserRadius
  318. local depth = config.geolyserDepth
  319. local foundOres = 0
  320.  
  321. -- Scan in layers
  322. for y = 0, -depth, -2 do
  323. local scan = geo.scan(playerPos.x, playerPos.y + y, playerPos.z, radius, radius, 1)
  324. local idx = 1
  325.  
  326. for dx = -radius, radius-1 do
  327. for dz = -radius, radius-1 do
  328. local hardness = scan[idx]
  329. idx = idx + 1
  330.  
  331. if hardness and isOre(hardness) then
  332. local wx = playerPos.x + dx
  333. local wy = playerPos.y + y
  334. local wz = playerPos.z + dz
  335.  
  336. local cube = glasses.addCube3D()
  337. cube.set3DPos(wx + 0.5, wy + 0.5, wz + 0.5)
  338. cube.setColor(255, 170, 0)
  339. cube.setAlpha(0.4)
  340. cube.setScale(0.8)
  341. cube.setVisibleThroughObjects(true)
  342.  
  343. table.insert(widgets.geolyser, cube)
  344. foundOres = foundOres + 1
  345. end
  346. end
  347. end
  348. end
  349.  
  350. -- Update HUD with ore count
  351. if foundOres > 0 then
  352. local oreLabel = glasses.addTextLabel()
  353. oreLabel.setText(string.format("Ores detected: %d", foundOres))
  354. oreLabel.setPosition(5, -70)
  355. oreLabel.setColor(255, 170, 0)
  356. oreLabel.setScale(1.0)
  357. table.insert(widgets.hud, oreLabel)
  358. end
  359. end
  360.  
  361. -- Waypoint Management
  362. local function clearWaypoints()
  363. for _, widget in pairs(widgets.waypoints) do
  364. if widget and widget.removeWidget then
  365. widget.removeWidget()
  366. end
  367. end
  368. widgets.waypoints = {}
  369. end
  370.  
  371. local function addWaypoint(name, x, y, z, color)
  372. color = color or config.colors.waypoint
  373.  
  374. local marker = glasses.addDot3D()
  375. marker.set3DPos(x, y, z)
  376. marker.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  377. marker.setSize(4)
  378. marker.setAlpha(1.0)
  379.  
  380. local label = glasses.addFloatingText()
  381. label.set3DPos(x, y + 1, z)
  382. updatePlayerPos()
  383. local dist = getDistance(playerPos.x, playerPos.y, playerPos.z, x, y, z)
  384. label.setText(string.format("%s\n%.1fm", name, dist))
  385. label.setColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF)
  386. label.setScale(0.8)
  387.  
  388. table.insert(widgets.waypoints, marker)
  389. table.insert(widgets.waypoints, label)
  390. end
  391.  
  392. local function refreshWaypoints()
  393. clearWaypoints()
  394. for _, wp in ipairs(savedWaypoints) do
  395. addWaypoint(wp.name, wp.x, wp.y, wp.z, wp.color)
  396. end
  397. end
  398.  
  399. -- UI Drawing
  400. local function drawMenu()
  401. term.clear()
  402. gpu.setBackground(0x000000)
  403. gpu.setForeground(0xFFFFFF)
  404.  
  405. print("╔═════════════════════════════════════════════╗")
  406. print("║ OpenGlasses 2 AR Control System v2.0 ║")
  407. print("╚═════════════════════════════════════════════╝")
  408. print()
  409.  
  410. updatePlayerPos()
  411. print(string.format("Position: %d, %d, %d | Facing: %s",
  412. playerPos.x, playerPos.y, playerPos.z, getCardinalDirection(playerFacing)))
  413. print()
  414.  
  415. print("╔═══ FEATURES ═══════════════════════════════╗")
  416. print(string.format("║ [1] Radar: %-7s Range: %2dm ║",
  417. config.radarEnabled and "ON" or "OFF", config.radarRange))
  418. print(string.format("║ [2] Fullbright: %-7s Opacity: %3d%% ║",
  419. config.fullbrightEnabled and "ON" or "OFF", math.floor(config.fullbrightOpacity * 100)))
  420.  
  421. if geo then
  422. print(string.format("║ [3] Geolyser: %-7s R:%2d D:%2d ║",
  423. config.geolyserEnabled and "ON" or "OFF", config.geolyserRadius, config.geolyserDepth))
  424. else
  425. print("║ [3] Geolyser: N/A (no geolyzer) ║")
  426. end
  427.  
  428. print(string.format("║ [4] HUD: %-7s ║",
  429. config.hudEnabled and "ON" or "OFF"))
  430. print("╚════════════════════════════════════════════╝")
  431. print()
  432.  
  433. print("╔═══ WAYPOINTS ══════════════════════════════╗")
  434. print("║ [W] Add Waypoint at Current Position ║")
  435. print("║ [L] List Waypoints ║")
  436. print("║ [D] Delete Waypoint ║")
  437. print(string.format("║ Total Waypoints: %-3d ║", #savedWaypoints))
  438. print("╚════════════════════════════════════════════╝")
  439. print()
  440.  
  441. print("╔═══ SETTINGS ═══════════════════════════════╗")
  442. print("║ [R] Adjust Radar Range ║")
  443. print("║ [F] Adjust Fullbright Opacity ║")
  444. if geo then
  445. print("║ [G] Adjust Geolyser Settings ║")
  446. end
  447. print("║ [H] Toggle HUD Elements ║")
  448. print("╚════════════════════════════════════════════╝")
  449. print()
  450.  
  451. print("╔═══ SYSTEM ═════════════════════════════════╗")
  452. print("║ [C] Clear All Widgets ║")
  453. print("║ [S] Save Configuration ║")
  454. print("║ [Q] Quit ║")
  455. print("╚════════════════════════════════════════════╝")
  456. print()
  457. print("Press a key to select option...")
  458. end
  459.  
  460. local function listWaypoints()
  461. term.clear()
  462. print("╔═══ WAYPOINTS ══════════════════════════════╗")
  463. if #savedWaypoints == 0 then
  464. print("║ No waypoints saved ║")
  465. else
  466. for i, wp in ipairs(savedWaypoints) do
  467. print(string.format("║ %2d. %-20s (%d,%d,%d) ║",
  468. i, wp.name:sub(1,20), wp.x, wp.y, wp.z))
  469. end
  470. end
  471. print("╚════════════════════════════════════════════╝")
  472. print("\nPress any key to continue...")
  473. event.pull("key_down")
  474. end
  475.  
  476. -- Event Handlers
  477. local function handleInput(char, code)
  478. if char == 0 then return end
  479.  
  480. local key = string.char(char):lower()
  481.  
  482. if key == "1" then
  483. config.radarEnabled = not config.radarEnabled
  484. if config.radarEnabled then
  485. updateRadar()
  486. else
  487. clearRadar()
  488. end
  489. updateHUD()
  490.  
  491. elseif key == "2" then
  492. if config.fullbrightEnabled then
  493. disableFullbright()
  494. else
  495. enableFullbright()
  496. end
  497. updateHUD()
  498.  
  499. elseif key == "3" and geo then
  500. config.geolyserEnabled = not config.geolyserEnabled
  501. if config.geolyserEnabled then
  502. updateGeolyser()
  503. else
  504. clearGeolyser()
  505. end
  506. updateHUD()
  507.  
  508. elseif key == "4" then
  509. config.hudEnabled = not config.hudEnabled
  510. if config.hudEnabled then
  511. updateHUD()
  512. else
  513. clearHUD()
  514. end
  515.  
  516. elseif key == "w" then
  517. term.clear()
  518. print("Add Waypoint at Current Position")
  519. updatePlayerPos()
  520. print(string.format("Position: %d, %d, %d", playerPos.x, playerPos.y, playerPos.z))
  521. print("\nEnter waypoint name:")
  522. local name = io.read()
  523. if name and name ~= "" then
  524. table.insert(savedWaypoints, {
  525. name = name,
  526. x = playerPos.x,
  527. y = playerPos.y,
  528. z = playerPos.z,
  529. color = config.colors.waypoint
  530. })
  531. saveWaypoints()
  532. refreshWaypoints()
  533. print("\nWaypoint added!")
  534. os.sleep(1)
  535. end
  536.  
  537. elseif key == "l" then
  538. listWaypoints()
  539.  
  540. elseif key == "d" then
  541. if #savedWaypoints == 0 then
  542. term.clear()
  543. print("No waypoints to delete!")
  544. os.sleep(1)
  545. return
  546. end
  547. listWaypoints()
  548. print("\nEnter waypoint number to delete (or 0 to cancel):")
  549. local num = tonumber(io.read())
  550. if num and num > 0 and num <= #savedWaypoints then
  551. table.remove(savedWaypoints, num)
  552. saveWaypoints()
  553. refreshWaypoints()
  554. print("Waypoint deleted!")
  555. os.sleep(1)
  556. end
  557.  
  558. elseif key == "r" then
  559. term.clear()
  560. print(string.format("Current radar range: %dm", config.radarRange))
  561. print("Enter new range (1-64):")
  562. local range = tonumber(io.read())
  563. if range and range >= 1 and range <= 64 then
  564. config.radarRange = range
  565. if config.radarEnabled then
  566. updateRadar()
  567. end
  568. end
  569.  
  570. elseif key == "f" then
  571. term.clear()
  572. print(string.format("Current fullbright opacity: %d%%",
  573. math.floor(config.fullbrightOpacity * 100)))
  574. print("Enter new opacity (0-100):")
  575. local opacity = tonumber(io.read())
  576. if opacity and opacity >= 0 and opacity <= 100 then
  577. config.fullbrightOpacity = opacity / 100
  578. if config.fullbrightEnabled then
  579. disableFullbright()
  580. enableFullbright()
  581. end
  582. end
  583.  
  584. elseif key == "g" and geo then
  585. term.clear()
  586. print(string.format("Current radius: %dm", config.geolyserRadius))
  587. print("Enter new radius (1-16):")
  588. local radius = tonumber(io.read())
  589. if radius and radius >= 1 and radius <= 16 then
  590. config.geolyserRadius = radius
  591. end
  592. print(string.format("Current depth: %dm", config.geolyserDepth))
  593. print("Enter new depth (1-64):")
  594. local depth = tonumber(io.read())
  595. if depth and depth >= 1 and depth <= 64 then
  596. config.geolyserDepth = depth
  597. end
  598. if config.geolyserEnabled then
  599. updateGeolyser()
  600. end
  601.  
  602. elseif key == "h" then
  603. term.clear()
  604. print("HUD Element Toggles:")
  605. print(string.format("[1] Coordinates: %s", config.showCoordinates and "ON" or "OFF"))
  606. print(string.format("[2] Compass: %s", config.showCompass and "ON" or "OFF"))
  607. print("\nEnter option (1-2):")
  608. local opt = io.read()
  609. if opt == "1" then
  610. config.showCoordinates = not config.showCoordinates
  611. elseif opt == "2" then
  612. config.showCompass = not config.showCompass
  613. end
  614. updateHUD()
  615.  
  616. elseif key == "c" then
  617. clearAllWidgets()
  618. config.radarEnabled = false
  619. config.fullbrightEnabled = false
  620. config.geolyserEnabled = false
  621. config.hudEnabled = false
  622.  
  623. elseif key == "s" then
  624. saveConfig()
  625. term.clear()
  626. print("Configuration saved!")
  627. os.sleep(1)
  628.  
  629. elseif key == "q" then
  630. running = false
  631. end
  632. end
  633.  
  634. -- Main Loop
  635. local function mainLoop()
  636. local lastRadarUpdate = 0
  637. local lastGeoUpdate = 0
  638. local lastHUDUpdate = 0
  639.  
  640. while running do
  641. drawMenu()
  642.  
  643. local currentTime = computer.uptime()
  644.  
  645. -- Update radar
  646. if config.radarEnabled and (currentTime - lastRadarUpdate) > config.radarUpdateInterval then
  647. updateRadar()
  648. lastRadarUpdate = currentTime
  649. end
  650.  
  651. -- Update geolyser
  652. if config.geolyserEnabled and (currentTime - lastGeoUpdate) > 5 then
  653. updateGeolyser()
  654. lastGeoUpdate = currentTime
  655. end
  656.  
  657. -- Update HUD
  658. if config.hudEnabled and (currentTime - lastHUDUpdate) > 1 then
  659. updateHUD()
  660. lastHUDUpdate = currentTime
  661. end
  662.  
  663. -- Input handling
  664. local eventType, _, char, code = event.pull(0.1, "key_down")
  665. if eventType == "key_down" then
  666. handleInput(char, code)
  667. end
  668. end
  669. end
  670.  
  671. -- Initialization
  672. term.clear()
  673. print("╔═══════════════════════════════════════════╗")
  674. print("║ OpenGlasses 2 AR Control System v2.0 ║")
  675. print("║ Initializing... ║")
  676. print("╚═══════════════════════════════════════════╝")
  677. print()
  678.  
  679. -- Check components
  680. print("Checking components...")
  681. if not component.isAvailable("glasses") then
  682. print("✗ ERROR: OpenGlasses Terminal not found!")
  683. return
  684. else
  685. print("✓ OpenGlasses Terminal found")
  686. end
  687.  
  688. if not component.isAvailable("navigation") then
  689. print("✗ ERROR: Navigation upgrade not found!")
  690. return
  691. else
  692. print("✓ Navigation upgrade found")
  693. end
  694.  
  695. if not component.isAvailable("radar") then
  696. print("✗ ERROR: Radar upgrade not found!")
  697. return
  698. else
  699. print("✓ Radar upgrade found")
  700. end
  701.  
  702. if not component.isAvailable("geolyzer") then
  703. print("⚠ WARNING: Geolyzer not found (feature disabled)")
  704. else
  705. print("✓ Geolyzer found")
  706. end
  707.  
  708. print()
  709. print("Loading configuration...")
  710. loadConfig()
  711. loadWaypoints()
  712.  
  713. print("✓ Configuration loaded")
  714. print()
  715. print("Refreshing waypoints...")
  716. refreshWaypoints()
  717.  
  718. if config.hudEnabled then
  719. updateHUD()
  720. end
  721.  
  722. print()
  723. print("✓ All systems ready!")
  724. os.sleep(2)
  725.  
  726. -- Run
  727. clearAllWidgets()
  728. mainLoop()
  729.  
  730. -- Cleanup
  731. clearAllWidgets()
  732. saveConfig()
  733. saveWaypoints()
  734. term.clear()
  735. print("AR Control System shutdown complete.")
  736. print("Configuration and waypoints saved.")
Advertisement
Add Comment
Please, Sign In to add comment