Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ... (your existing code)
- -- Function to check if the specified code or parts of the code are present in an installed app
- local function checkInstalledApp(appName)
- local path = "/disk/packages/" .. appName
- local file = fs.open(path, "r")
- if file then
- local content = file.readAll()
- file.close()
- -- Check for the presence of a specific pattern or code snippet
- if string.find(content, "drawNavBar") then
- return true
- else
- return false
- end
- else
- return false
- end
- end
- -- Prompting the user to enter the Pastebin code and desired program name
- print("Please enter the Pastebin code of the script you want to download:")
- local code = read()
- print("Enter the name for the program:")
- local programName = read()
- -- Calling the function to download code from Pastebin using the entered code and program name
- downloadFromPastebin(code, programName)
- -- Check if the installed app has the required code
- if not checkInstalledApp(programName) then
- print("This application may not be supported for this version of Dogdroid.")
- print("Do you want to download and install it? (y/n)")
- local answer = read()
- if answer:lower() == "y" then
- downloadFromPastebin("PASTEBIN_CODE_FOR_MISSING_APP", programName) -- Use the actual Pastebin code for the missing app
- else
- shell.run("/disk/os/gui")
- end
- end
- -- ... (rest of your existing code)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement