TheYellowBush

startup.lua

Jul 20th, 2025 (edited)
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. -- AE2 Stockpile Manager - Auto-Start Script
  2. -- v1
  3. -- This script runs automatically when the computer boots up
  4.  
  5. -- Configuration
  6. local MAIN_PROGRAM = "ae2_main.lua"
  7. local AUTO_START = true -- Set to false to disable auto-start
  8. local STARTUP_DELAY = 3 -- seconds to wait before starting
  9.  
  10. -- Clear screen and show startup info
  11. term.clear()
  12. term.setCursorPos(1, 1)
  13. print("=== AE2 Stockpile Auto-Start ===")
  14. print()
  15.  
  16. if not AUTO_START then
  17.     print("Auto-start is disabled.")
  18.     print("Run '" .. MAIN_PROGRAM .. "' manually to start.")
  19.     return
  20. end
  21.  
  22. -- Check if main program exists
  23. if not fs.exists(MAIN_PROGRAM) then
  24.     print("ERROR: Main program '" .. MAIN_PROGRAM .. "' not found!")
  25.     print("Make sure all AE2 stockpile files are in the same directory.")
  26.     print()
  27.     print("Required files:")
  28.     print("- " .. MAIN_PROGRAM)
  29.     print("- ae2_config.lua")
  30.     print("- ae2_display.lua")
  31.     print("- ae2_interface.lua")
  32.     print("- ae2_menu.lua")
  33.     return
  34. end
  35.  
  36. -- Startup countdown
  37. print("Starting AE2 Stockpile Manager in monitoring mode...")
  38. print("Press Ctrl+T within " .. STARTUP_DELAY .. " seconds to cancel.")
  39. print()
  40.  
  41. for i = STARTUP_DELAY, 1, -1 do
  42.     write("Starting in " .. i .. " seconds...")
  43.     os.sleep(1)
  44.     print(" ")
  45. end
  46.  
  47. print("Starting AE2 Stockpile Manager...")
  48. print()
  49.  
  50. -- Start the main program in auto mode
  51. shell.run(MAIN_PROGRAM, "auto")
Advertisement
Add Comment
Please, Sign In to add comment