Advertisement
superjaja05

Installer Address Book

Nov 20th, 2024 (edited)
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.55 KB | Software | 0 0
  1. fs.delete("/address_book.lua")
  2. shell.run("wget https://raw.githubusercontent.com/JajaSteele/CC-Random/refs/heads/main/SGJourney/address_book.lua")
  3.  
  4. local delay = 0
  5.  
  6. local startup_program = ([[
  7.     while true do
  8.         local stat, err = pcall(function()
  9.             print("Starting Program '&p' in ]]..delay..[[s")
  10.             sleep(]]..delay..[[)
  11.             if not shell.execute("&p") then
  12.                 error("Program Errored")
  13.             end
  14.         end)
  15.         if not stat then
  16.             print(err)
  17.             print("Restarting in ]]..(1)..[[s")
  18.             sleep(]]..(1)..[[)
  19.             if err == "Terminated" then
  20.                 print("Program Terminated") break
  21.             end
  22.         end
  23.     end
  24. ]])
  25.  
  26. startup_program = startup_program:gsub("&p", "address_book.lua")
  27.  
  28. if fs.exists("/startup.lua") or fs.exists("/startup") then
  29.     print("startup file will be overriden!")
  30.     sleep(1)
  31. end
  32. print("Setting up startup file..")
  33. local startup_io = io.open("/startup.lua", "w")
  34. startup_io:write(startup_program)
  35. startup_io:close()
  36.  
  37. print("Done!")
  38. sleep(0.5)
  39.  
  40. term.clear()
  41. term.setCursorPos(1,1)
  42.  
  43. local running_path = shell.getRunningProgram()
  44.  
  45. if running_path and not running_path:match("wget%.lua") and not running_path:match("pastebin%.lua") then
  46.     fs.delete(running_path)
  47. end
  48.  
  49. print("Peripherals:")
  50. print("Required = - Optional = +")
  51. print("+ Wireless Modem (To dial on easydial)")
  52. print("+ Chatbox (To share addresses in chat)")
  53. print("")
  54. print("Press any key to reboot")
  55.  
  56. os.pullEvent("key")
  57.  
  58. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement