Advertisement
DOGGYWOOF

Packages installer for Dogdroid

Mar 12th, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. -- ... (your existing code)
  2.  
  3. -- Function to check if the specified code or parts of the code are present in an installed app
  4. local function checkInstalledApp(appName)
  5. local path = "/disk/packages/" .. appName
  6. local file = fs.open(path, "r")
  7.  
  8. if file then
  9. local content = file.readAll()
  10. file.close()
  11.  
  12. -- Check for the presence of a specific pattern or code snippet
  13. if string.find(content, "drawNavBar") then
  14. return true
  15. else
  16. return false
  17. end
  18. else
  19. return false
  20. end
  21. end
  22.  
  23. -- Prompting the user to enter the Pastebin code and desired program name
  24. print("Please enter the Pastebin code of the script you want to download:")
  25. local code = read()
  26.  
  27. print("Enter the name for the program:")
  28. local programName = read()
  29.  
  30. -- Calling the function to download code from Pastebin using the entered code and program name
  31. downloadFromPastebin(code, programName)
  32.  
  33. -- Check if the installed app has the required code
  34. if not checkInstalledApp(programName) then
  35. print("This application may not be supported for this version of Dogdroid.")
  36. print("Do you want to download and install it? (y/n)")
  37. local answer = read()
  38.  
  39. if answer:lower() == "y" then
  40. downloadFromPastebin("PASTEBIN_CODE_FOR_MISSING_APP", programName) -- Use the actual Pastebin code for the missing app
  41. else
  42. shell.run("/disk/os/gui")
  43. end
  44. end
  45.  
  46. -- ... (rest of your existing code)
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement