Advertisement
Guest User

Zelda Ancient Stone Tablets_Share same sav SNES mini script

a guest
Feb 10th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.82 KB | None | 0 0
  1. # ZeldaASTscript.hmod
  2. # Edit the sub folder structure to share the same saves between both 4 weeks roms
  3. # Games name must be as *Zelda*AST#* with # The week number
  4. # Example :
  5. #          The_Legend_of_Zelda_-_AST1_(FR).sfrom
  6. #          The_Legend_of_Zelda_-_AST2_(FR).sfrom
  7. #          The_Legend_of_Zelda_-_AST3_(FR).sfrom
  8. #          The_Legend_of_Zelda_-_AST4_(FR).sfrom
  9. # v0.1 - February 8th, 2018
  10. # Based on explanations https://imgur.com/a/mqJMC
  11. # Hakchi Module by Nark
  12.  
  13. #Initialization
  14. #Zhome=/usr/share/games  # uncomment for real use
  15. Zhome=/var/lib/hakchi/rootfs/usr/share/games
  16. #  Retrieve folders
  17. ZFolder1=$(find $Zhome -name *Zelda*AST1*) #The full path of game1
  18. ZFolder2=$(find $Zhome -name *Zelda*AST2*)
  19. ZFolder3=$(find $Zhome -name *Zelda*AST3*)
  20. ZFolder4=$(find $Zhome -name *Zelda*AST4*)
  21. #  Test if structure already modified
  22. if [ "$ZFolder2" != "" ]; then #if not, apply the modifications
  23. #  Retrieve games file name
  24. Zfilename1="${ZFolder1##*/}" #The full name of game1
  25. Zfilename2="${ZFolder2##*/}"
  26. Zfilename3="${ZFolder3##*/}"
  27. Zfilename4="${ZFolder4##*/}"
  28. #  Retrieve games file path
  29. ZPath1=$(dirname $ZFolder1) #The path of game1 file
  30. ZPath2=$(dirname $ZFolder2)
  31. ZPath3=$(dirname $ZFolder3)
  32. ZPath4=$(dirname $ZFolder4)
  33. #  Retrieve Clover ID folder names
  34. ZGood1="${ZPath1##*/}" #The good folder name of game1
  35. ZBad2="${ZPath2%CLV*}" #The path of game2 folder without bad Clover ID folder
  36. ZBad3="${ZPath3%CLV*}" #The path of game3 folder without bad Clover ID folder
  37. ZBad4="${ZPath4%CLV*}" #The path of game4 folder without bad Clover ID folder
  38. #Perform modifications
  39. #  Rename .sfrom from 2 3 and 4 to 1
  40. mv "$ZFolder2" "$ZPath2/$Zfilename1"
  41. mv "$ZFolder3" "$ZPath3/$Zfilename1"
  42. mv "$ZFolder4" "$ZPath4/$Zfilename1"
  43. #  Old .png and .dektop delete from 2 3 and 4
  44. find $ZPath2 -name "*.png" -type f -delete
  45. find $ZPath2 -name "*.desktop" -type f -delete
  46. find $ZPath3 -name "*.png" -type f -delete
  47. find $ZPath3 -name "*.desktop" -type f -delete
  48. find $ZPath4 -name "*.png" -type f -delete
  49. find $ZPath4 -name "*.desktop" -type f -delete
  50. #  Copy of .png and .dektop from 1 to 2 3 and 4
  51. cp -f $ZPath1/$ZGood1.png $ZPath2
  52. cp -f $ZPath1/$ZGood1\_small.png $ZPath2
  53. cp -f $ZPath1/$ZGood1.desktop $ZPath2
  54. cp -f $ZPath1/$ZGood1.png $ZPath3
  55. cp -f $ZPath1/$ZGood1\_small.png $ZPath3
  56. cp -f $ZPath1/$ZGood1.desktop $ZPath3
  57. cp -f $ZPath1/$ZGood1.png $ZPath4
  58. cp -f $ZPath1/$ZGood1\_small.png $ZPath4
  59. cp -f $ZPath1/$ZGood1.desktop $ZPath4
  60. #  Rename folders from 2 3 and 4 to 1
  61. mv "$ZPath2" "$ZBad2$ZGood1"
  62. mv "$ZPath3" "$ZBad3$ZGood1"
  63. mv "$ZPath4" "$ZBad4$ZGood1"
  64. #echo === === Zelda \"Ancient Stone Tablets\" Mod applied === ===
  65. fi
  66. #Variables deallocation
  67. unset ZFolder1 ZFolder2 ZFolder3 ZFolder4
  68. unset Zfilename1 Zfilename2 Zfilename3 Zfilename4
  69. unset ZPath1 ZPath2 ZPath3 ZPath4
  70. unset Zhome ZGood1 ZBad2 ZBad3 ZBad4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement