Baoulettes

Classmith 2014 V1.0.2

Jul 20th, 2015
837
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance force
  2. ; 20th July 2014 by Baoulettes aka Joffrey Panisset
  3. ; Unauthorized use is forbidden.
  4. ; Here are my credit list :
  5. ; Autohotkey to allow such code stuff :)
  6. ; fabianosan for Rocksmith Custom Song Toolkit unpacker.
  7. ; Snakez for Rocksmith Custom Song Toolkit unpacker.
  8. ; Maveth for Rocksmith Custom Song Toolkit unpacker.
  9. ; Raynebc for Rocksmith Custom Song Toolkit unpacker.
  10. ; Dreddfoxx for Rocksmith Custom Song Toolkit unpacker.
  11. ; Alex360 (L0fka) for Rocksmith Custom Song Toolkit unpacker.
  12. ; Shrubbery (otaznik) for Rocksmith Custom Song Toolkit unpacker.
  13. ; Cozy1 for Rocksmith Custom Song Toolkit unpacker.
  14. ; Zephyrix for Rocksmith Custom Song Toolkit unpacker.
  15. ; Xavatar (PowerSlinky) for Rocksmith Custom Song Toolkit unpacker.
  16. ; Chlipouni for Rocksmith Custom Song Toolkit unpacker.
  17. ; Cgeorge for Rocksmith Custom Song Toolkit unpacker.
  18.  
  19. ;Variables Setting :
  20. Appname = Classmith 2014
  21. Appversion = V1.0.2
  22.  
  23. ;1.0.2 - Faster and more special character detected fix :)
  24. ;1.0.1 - Fixed RS2014 / RS Original DLC and import tool detection.
  25. ;1.0.0 - Initial Launch
  26.  
  27.  
  28. ;Creating Ressources Directory :
  29. fileCreateDir, %A_ScriptDir%\ressources\
  30. fileCreateDir, %A_ScriptDir%\ressources\packer
  31.  
  32. ;Installing required files :
  33. FileInstall, D:\RS2014SongClassifier\Ressources\packer\NDesk.Options.dll, %A_ScriptDir%\ressources\packer\NDesk.Options.dll
  34. FileInstall, D:\RS2014SongClassifier\Ressources\packer\packer.exe, %A_ScriptDir%\ressources\packer\packer.exe
  35. FileInstall, D:\RS2014SongClassifier\Ressources\packer\packer.pdb, %A_ScriptDir%\ressources\packer\packer.pdb
  36. FileInstall, D:\RS2014SongClassifier\Ressources\packer\RocksmithToolkitLib.dll, %A_ScriptDir%\ressources\packer\RocksmithToolkitLib.dll
  37. FileInstall, D:\RS2014SongClassifier\Ressources\packer\X360.dll, %A_ScriptDir%\ressources\packer\X360.dll
  38. FileInstall, D:\RS2014SongClassifier\Ressources\packer\ZLIB.dll, %A_ScriptDir%\ressources\packer\ZLIB.dll
  39. FileInstall, D:\RS2014SongClassifier\Ressources\packer\zlib.net.dll, %A_ScriptDir%\ressources\packer\zlib.net.dll
  40. FileInstall, D:\RS2014SongClassifier\Ressources\Baoulettes.png, %A_ScriptDir%\ressources\Baoulettes.png,1
  41. FileInstall, D:\RS2014SongClassifier\Ressources\Rocksmith-2014-Edition-Logo.png, %A_ScriptDir%\ressources\Rocksmith-2014-Edition-Logo.png,1
  42.  
  43. ; Reading various Variables
  44. IniRead, Languages, Options.ini, Options, Languages
  45. IniRead, SelectedRS2014Folder, Options.ini, Options, R2014dir
  46. IniRead, DLCWantingNameInput, Options.ini, Options, WantedPsarcName
  47. IniRead, Platform, Options.ini, Options, Platform
  48. IniRead, YesnoDL, Options.ini, Options, SeparateInFolderQS
  49. If SelectedRS2014Folder = ERROR
  50. {
  51. FileSelectFolder, SelectedRS2014Folder,, 3,Please choice Rocksmith 2014 directory.
  52. IniWrite, %SelectedRS2014Folder%, Options.ini, Options, R2014dir
  53. }
  54. If SelectedRS2014Folder =
  55. {
  56. FileSelectFolder, SelectedRS2014Folder,, 3,Please choice Rocksmith 2014 directory.
  57. IniWrite, %SelectedRS2014Folder%, Options.ini, Options, R2014dir
  58. }
  59. If Languages = ERROR
  60. {
  61. Languages=En
  62. }
  63. If Languages =
  64. {
  65. Languages=En
  66. }
  67. If YesnoDL = ERROR
  68. {
  69. YesnoDL = Yes||No
  70. }
  71. If YesnoDL =
  72. {
  73. YesnoDL = Yes||No
  74. }
  75. If YesnoDL = Yes
  76. {
  77. YesnoDL = Yes||No
  78. }
  79. If YesnoDL = No
  80. {
  81. YesnoDL = Yes|No||
  82. }
  83. If Platform = ERROR
  84. {
  85. Platform = PC||Mac
  86. }
  87. If Platform =
  88. {
  89. Platform = PC||Mac
  90. }
  91. If Platform = PC
  92. {
  93. Platform = PC||Mac
  94. }
  95. If Platform = Mac
  96. {
  97. Platform = PC|Mac||
  98. }
  99. If DLCWantingNameInput = ERROR
  100. {
  101. DLCWantingNameInput=`%A`%_`%SN`%_`%AN`%_V`%V`%
  102. }
  103. If DLCWantingNameInput =
  104. {
  105. DLCWantingNameInput=`%A`%_`%SN`%_`%AN`%_V`%V`%
  106. }
  107.  
  108. ;Variables for translation :
  109. ;Base - English :
  110. If Languages = EN
  111. {
  112. about = About
  113. choiceRSDir = Please choice Rocksmith 2014 directory.
  114. RS2014FSelectB = Browse
  115. DLCWantedName = Please set a name scheme. (More information about variables name at right)
  116. BasicInfoFileNaming = use `%A`% for Artist Name`n use `%SN`% for Song Name`n use `%AN`% for Album Name`n use `%V`% for Package Version (Recommended.)`nAll space will be replaced by underscores.
  117. SelectPFText = Target platform :
  118. SeparateInFolderQS = Would you like to sort song in a Artist folder inside DLC folder?
  119. AppsUsageText = 1st You have to select a Rocksmith 2014 directory (NOT dlc just root folder!)`n2nd Config the application as you wish.`n3rd Press "Let do it".`nCommon error possible :`nNo dlc in DLC folder so nothing to do`nAlready sorted .psarc (This application don't look in subfolder to prevent unwanted error)`nFolder isn't Rocksmith 2014 root.`nPlease becareful and make Backups if you're unsure !`nThe more CDLC/DLC you have the more time it will take so please be patient !`nIf you have Any problem contact me over: `nFacebook : Page: Baoulettes`nSkype : mysticia26
  120. StartProcess = Let do it !
  121. CreditText = This Application has been mady by Baoulettes. 2015
  122. AboutTextWindows = Credits List:`nAutohotkey`nBaoulettes`nRocksmith Custom Song Toolkit maker :`nfabianosan`nSnakez`nMaveth`nRaynebc`nDreddfoxx`nAlex360 (L0fka)`nShrubbery (otaznik)`nCozy1`nZephyrix`nXavatar`nChlipouni`nCgeorge
  123. }
  124.  
  125. ;Gui Making !
  126. Gui,1: Add, Button, x412 y5 w60 h20 gaboutwin, %about%
  127. Gui,1: Add, Text, x100 y29 w370 h30 BackGroundTrans +Center, %choiceRSDir%
  128. Gui,1: Add, Button, x412 y29 w60 h20 gSelRS2014Folder, %RS2014FSelectB%
  129. Gui,1: Add, Edit, x2 y59 w470 h30 vactualdir +Center, %SelectedRS2014Folder%
  130. Gui,1: Add, Text, x2 y95 w250 h30 +Center, %DLCWantedName%
  131. Gui,1: Add, Edit, x2 y129 w250 h40 vnameinput +Center, %DLCWantingNameInput%
  132. Gui,1: Add, Text, x262 y95 w210 h80 +Center, %BasicInfoFileNaming%
  133. Gui,1: Add, DropDownList, x362 y187 w100 h20 r2 vSelPlatform, %Platform%
  134. Gui,1: Add, Text, x262 y191 w100 h30 , %SelectPFText%
  135. Gui,1: Add, Text, x2 y185 w150 h30 , %SeparateInFolderQS%
  136. Gui,1: Add, DropDownList, x152 y187 w100 h21 r2 vFolderYesNo, %YesnoDL%
  137. Gui,1: Add, Text, x2 y223 w470 h160 +Center, %AppsUsageText%
  138. Gui,1: Add, Button, x12 y399 w450 h30 gGoforIt, %StartProcess%
  139. Gui,1: Add, Text, x2 y429 w470 h20 +Center, %CreditText%
  140. Gui,1: Add, Picture, x0 y0 w180 h60 BackGroundTrans, %A_ScriptDir%\ressources\Rocksmith-2014-Edition-Logo.png
  141. Gui,1: Show, h450 w476, %Appname% - %Appversion%
  142. Return
  143.  
  144. ; Creating Credit / About window
  145. aboutwin:
  146. Gui,1: Hide
  147. Gui,2: Add, Picture, x0 y0 w150 h150 , %A_ScriptDir%\ressources\Baoulettes.png
  148. Gui,2: Add, Text, x0 y149 w150 h230 +Center, %AboutTextWindows%
  149. Gui,2: Show, h381 w150, %Appname% - %Appversion%
  150. Return
  151.  
  152. ;Functions :
  153. ; Rocksmith Directory selection.
  154. SelRS2014Folder:
  155. FileSelectFolder, SelectedRS2014Folder,, 3,%choiceRSDir%
  156. GuiControl,1:,actualdir, %SelectedRS2014Folder%
  157. IniWrite, %SelectedRS2014Folder%, Options.ini, Options, R2014dir
  158. Return
  159.  
  160. ; Main Function to parse files & rename etc.
  161. GoforIt:
  162. Gui,1: Submit
  163. GuiControlGet, actualdir,1:,
  164. GuiControlGet, nameinput,1:,
  165. GuiControlGet, SelPlatform,1:,
  166. GuiControlGet, FolderYesNo,1:,
  167. DLCWantingNameInput = %nameinput%
  168. SelectedRS2014Folder = %actualdir%
  169. Platform = %SelPlatform%
  170. YesnoDL = %FolderYesNo%
  171. If SelectedRS2014Folder = ERROR
  172. {
  173. FileSelectFolder, SelectedRS2014Folder,, 3,%choiceRSDir%
  174. GuiControl,1:,actualdir, %SelectedRS2014Folder%
  175. IniWrite, %SelectedRS2014Folder%, Options.ini, Options, R2014dir
  176. Gui,1: Restore
  177. return
  178. }
  179. If SelectedRS2014Folder =
  180. {
  181. FileSelectFolder, SelectedRS2014Folder,, 3,%choiceRSDir%
  182. GuiControl,1:,actualdir, %SelectedRS2014Folder%
  183. IniWrite, %SelectedRS2014Folder%, Options.ini, Options, R2014dir
  184. Gui,1: Restore
  185. return
  186. }
  187. If DLCWantingNameInput = ERROR
  188. {
  189. Msgbox, Please set a name other than Error... Use Variables too!
  190. Gui,1: Restore
  191. return
  192. }
  193. If DLCWantingNameInput =
  194. {
  195. Msgbox, Please set a name other than Error... Use Variables too!
  196. Gui,1: Restore
  197. return
  198. }
  199. If Platform = PC||Mac
  200. {
  201. Platform = PC
  202. }
  203. If Platform = PC|Mac||
  204. {
  205. Platform = Mac
  206. }
  207. If YesnoDL = Yes||No
  208. {
  209. YesnoDL = Yes
  210. }
  211. If YesnoDL = Yes|No||
  212. {
  213. YesnoDL = No
  214. }
  215. IniWrite, %Languages%, Options.ini, Options, Languages
  216. IniWrite, %SelectedRS2014Folder%, Options.ini, Options, R2014dir
  217. IniWrite, %DLCWantingNameInput%, Options.ini, Options, WantedPsarcName
  218. IniWrite, %Platform%, Options.ini, Options, Platform
  219. IniWrite, %YesnoDL%, Options.ini, Options, SeparateInFolderQS
  220. NameId=0
  221. FileCreateDir, %SelectedRS2014Folder%\dlc\RocksmithOneDLC
  222. IfExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydisc_p.psarc
  223. {
  224. FileCreateDir, %SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat
  225. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydisc_p.psarc,%SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat\%NameId%rs1compatibilitydisc_p.psarc
  226. NameId++
  227. }
  228. IfNotExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydisc_p.psarc
  229. {
  230. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydisc_p.psarc,%SelectedRS2014Folder%\dlc\RocksmithOneDLC
  231. }
  232. IfExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydisc_m.psarc
  233. {
  234. FileCreateDir, %SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat
  235. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydisc_m.psarc,%SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat\%NameId%rs1compatibilitydisc_m.psarc
  236. NameId++
  237. }
  238. IfNotExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydisc_m.psarc
  239. {
  240. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydisc_m.psarc,%SelectedRS2014Folder%\dlc\RocksmithOneDLC
  241. }
  242. IfExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydlc_p.psarc
  243. {
  244. FileCreateDir, %SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat
  245. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydlc_p.psarc,%SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat\%NameId%rs1compatibilitydlc_p.psarc
  246. NameId++
  247. }
  248. IfNotExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydlc_p.psarc
  249. {
  250. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydlc_p.psarc,%SelectedRS2014Folder%\dlc\RocksmithOneDLC
  251. }
  252. IfExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydlc_m.psarc
  253. {
  254. FileCreateDir, %SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat
  255. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydlc_m.psarc,%SelectedRS2014Folder%\dlc\01RocksmithOneDLCDuplicat\%NameId%rs1compatibilitydlc_p.psarc
  256. NameId++
  257. }
  258. IfNotExist, %SelectedRS2014Folder%\dlc\RocksmithOneDLC\rs1compatibilitydlc_m.psarc
  259. {
  260. FileMove, %SelectedRS2014Folder%\dlc\rs1compatibilitydlc_m.psarc,%SelectedRS2014Folder%\dlc\RocksmithOneDLC
  261. }
  262. If Platform = PC
  263. {
  264. endfilename = _p.psarc
  265. PT = _Pc
  266. FileCreateDir, %SelectedRS2014Folder%\dlc\01MacVersion
  267. FileMove, %SelectedRS2014Folder%\dlc\*_m.psarc, %SelectedRS2014Folder%\dlc\01MacVersion
  268. }
  269. If Platform = Mac
  270. {
  271. endfilename = _m.psarc
  272. FileCreateDir, %SelectedRS2014Folder%\dlc\01PcVersion
  273. FileMove, %SelectedRS2014Folder%\dlc\*_p.psarc, %SelectedRS2014Folder%\dlc\01PcVersion
  274. PT = _Mac
  275. }
  276. sleep 1500
  277. FileCreateDir, %A_ScriptDir%\tmp
  278. FileCreateDir, %A_ScriptDir%\tmp\ToRename
  279. Gui,3: Add, Text, x0 y0 w240 h90 vGui3Txt +Center, %Gui3Text%
  280. Gui,3: -SysMenu
  281. Gui,3: Show, h88 w244, Working . . .
  282.  
  283. Loop Files, %SelectedRS2014Folder%\dlc\*.psarc
  284. {
  285. ;FileName = %A_LoopFileName%
  286. StringReplace, CutedName, A_LoopFileName, .psarc, , All
  287. UnpackFDName = %CutedName%%PT%
  288. FileCreateDir, %A_ScriptDir%\tmp\ToRename\Unpack
  289. ;FileMove, %SelectedRS2014Folder%\dlc\%A_LoopFileName%, %A_ScriptDir%\tmp\ToRename
  290. FileMove, %A_LoopFileFullPath%, %A_ScriptDir%\tmp\ToRename
  291. RunWait, %A_ScriptDir%\ressources\packer\packer.exe --unpack -i="%A_ScriptDir%\tmp\ToRename\%A_LoopFileName%" -o="%A_ScriptDir%\tmp\ToRename\Unpack",,Hide
  292. Loop Files, %A_ScriptDir%\tmp\ToRename\Unpack\%UnpackFDName%\*.nt,
  293. {
  294.     StringTrimRight, UniqueID, A_LoopFileName, 18
  295. }
  296.  
  297. IfExist, %A_ScriptDir%\tmp\ToRename\Unpack\%UnpackFDName%\toolkit.version
  298. {
  299. FileRead, VersionCheck, %A_ScriptDir%\tmp\ToRename\Unpack\%UnpackFDName%\toolkit.version
  300. if not ErrorLevel
  301. {
  302. Checkif = Package Version:
  303. IfInString, VersionCheck, %Checkif%
  304. FoundV := InStr(VersionCheck, Checkif)
  305. FoundV+=16
  306. StringTrimLeft, PVersion2Split, VersionCheck, %FoundV%
  307. StringLeft, PVersion, PVersion2Split, 5
  308. }
  309. If PVersion = ERROR
  310. {
  311. PVersion =1
  312. }
  313. If PVersion =
  314. {
  315. PVersion =1
  316. }
  317. }
  318. IfNotExist, %A_ScriptDir%\tmp\ToRename\Unpack\%UnpackFDName%\toolkit.version
  319. {
  320. FileCreateDir, %SelectedRS2014Folder%\dlc\Rocksmith2014DLC
  321. IfExist %SelectedRS2014Folder%\dlc\Rocksmith2014DLC\%A_LoopFileName%
  322. {
  323. FileCreateDir, %SelectedRS2014Folder%\dlc\01Rocksmith2014DLCDuplica
  324. FileMove, %A_ScriptDir%\tmp\ToRename\%A_LoopFileName%, %SelectedRS2014Folder%\dlc\01Rocksmith2014DLCDuplica
  325. }
  326. IfNotExist, %SelectedRS2014Folder%\dlc\Rocksmith2014DLC\%A_LoopFileName%
  327. {
  328. FileMove, %A_ScriptDir%\tmp\ToRename\%A_LoopFileName%, %SelectedRS2014Folder%\dlc\Rocksmith2014DLC
  329. }
  330. FileRemoveDir, %A_ScriptDir%\tmp\ToRename\Unpack, 1
  331.  
  332. }
  333. FileRead, HSANFile, %A_ScriptDir%\tmp\ToRename\Unpack\%UnpackFDName%\manifests\songs_dlc_%UniqueID%\songs_dlc_%UniqueID%.hsan
  334. Check4AN = `"AlbumName`": `"
  335. IfInString, HSANFile, %Check4AN%
  336. FoundAN := InStr(HSANFile, Check4AN)
  337. FoundAN+=13
  338. StringTrimLeft, AlbumName2Split, HSANFile, %FoundAN%
  339. CheckNameEnd = `",
  340. IfInString, AlbumName2Split, %CheckNameEnd%
  341. FoundANEnd := InStr(AlbumName2Split, CheckNameEnd)
  342. FoundANEnd-=1
  343. StringLeft, AlbumNameCuted, AlbumName2Split, %FoundANEnd%
  344. If AlbumNameCuted = Error
  345. {
  346. ArtistNameCuted = Original
  347. SongNameCuted = RS2014 DLC or conrupt !
  348. }
  349. Gui3Text = Working on : %ArtistNameCuted% - %SongNameCuted%
  350. GuiControl,3:,Gui3Txt, %Gui3Text%
  351. Check4ArtN = `"ArtistName`": `"
  352. IfInString, HSANFile, %Check4ArtN%
  353. FoundArtN := InStr(HSANFile, Check4ArtN)
  354. FoundArtN+=14
  355. StringTrimLeft, ArtistName2Split, HSANFile, %FoundArtN%
  356. IfInString, ArtistName2Split, %CheckNameEnd%
  357. FoundArtNEnd := InStr(ArtistName2Split, CheckNameEnd)
  358. FoundArtNEnd-=1
  359. StringLeft, ArtistNameCuted, ArtistName2Split, %FoundArtNEnd%
  360. If AlbumNameCuted = Error
  361. {
  362. ArtistNameCuted = Original
  363. SongNameCuted = RS2014 DLC or conrupt !
  364. }
  365. Gui3Text = Working on : %ArtistNameCuted% - %SongNameCuted%
  366. GuiControl,3:,Gui3Txt, %Gui3Text%
  367. Check4SN = `"SongName`": `"
  368. IfInString, HSANFile, %Check4SN%
  369. FoundSN := InStr(HSANFile, Check4SN)
  370. FoundSN+=12
  371. StringTrimLeft, SongName2Split, HSANFile, %FoundSN%
  372. IfInString, SongName2Split, %CheckNameEnd%
  373. FoundSNEnd := InStr(SongName2Split, CheckNameEnd)
  374. FoundSNEnd-=1
  375. StringLeft, SongNameCuted, SongName2Split, %FoundSNEnd%
  376. If AlbumNameCuted = Error
  377. {
  378. ArtistNameCuted = Original
  379. SongNameCuted = RS2014 DLC or conrupt !
  380. }
  381. If AlbumNameCuted =
  382. {
  383. ArtistNameCuted = Original
  384. SongNameCuted = RS2014 DLC or conrupt !
  385. }
  386. StringReplace, AlbumName, AlbumNameCuted, %A_SPACE%,-, All
  387. StringReplace, ArtistName, ArtistNameCuted, %A_SPACE%,-, All
  388. StringReplace, SongName, SongNameCuted, %A_SPACE%,-, All
  389. StringReplace, PackVersion, PVersion, %A_SPACE%,., All
  390.  
  391. StringReplace, AlbumName, AlbumName, `%,%A_SPACE%, All
  392. StringReplace, ArtistName, ArtistName, `%,%A_SPACE%, All
  393. StringReplace, SongName, SongName, `%,%A_SPACE%, All
  394. StringReplace, PackVersion, PackVersion, `%,%A_SPACE%, All
  395.  
  396. StringReplace, AlbumName, AlbumName, `:,%A_SPACE%, All
  397. StringReplace, ArtistName, ArtistName, `:,%A_SPACE%, All
  398. StringReplace, SongName, SongName,`:,%A_SPACE%, All
  399. StringReplace, PackVersion, PackVersion, `:,%A_SPACE%, All
  400.  
  401. StringReplace, AlbumName, AlbumName, ü,u, All
  402. StringReplace, ArtistName, ArtistName, ü,u, All
  403. StringReplace, SongName, SongName,ü,u, All
  404. StringReplace, PackVersion, PackVersion, ü,u, All
  405.  
  406. StringReplace, AlbumName, AlbumName, ë,e, All
  407. StringReplace, ArtistName, ArtistName, ë,e, All
  408. StringReplace, SongName, SongName, ë,e, All
  409. StringReplace, PackVersion, PackVersion, ë,e, All
  410.  
  411. StringReplace, AlbumName, AlbumName, ê,e, All
  412. StringReplace, ArtistName, ArtistName, ê,e, All
  413. StringReplace, SongName, SongName, ê,e, All
  414. StringReplace, PackVersion, PackVersion, ê,e, All
  415.  
  416. StringReplace, AlbumName, AlbumName, ?,, All
  417. StringReplace, ArtistName, ArtistName, ?,, All
  418. StringReplace, SongName, SongName, ?,, All
  419. StringReplace, PackVersion, PackVersion, ?,, All
  420.  
  421. StringReplace, AlbumName, AlbumName, ¿,, All
  422. StringReplace, ArtistName, ArtistName, ¿,, All
  423. StringReplace, SongName, SongName, ¿,, All
  424. StringReplace, PackVersion, PackVersion, ¿,, All
  425.  
  426. StringReplace, AlbumName, AlbumName, é,e, All
  427. StringReplace, ArtistName, ArtistName, é,e, All
  428. StringReplace, SongName, SongName, é,e, All
  429. StringReplace, PackVersion, PackVersion, é,e, All
  430.  
  431. StringReplace, AlbumName, AlbumName, è,e, All
  432. StringReplace, ArtistName, ArtistName, è,e, All
  433. StringReplace, SongName, SongName, è,e, All
  434. StringReplace, PackVersion, PackVersion, è,e, All
  435.  
  436. StringReplace, AlbumName, AlbumName, ï,i, All
  437. StringReplace, ArtistName, ArtistName, ï,i, All
  438. StringReplace, SongName, SongName, ï,i, All
  439. StringReplace, PackVersion, PackVersion, ï,i, All
  440.  
  441. StringReplace, AlbumName, AlbumName, î,i, All
  442. StringReplace, ArtistName, ArtistName, î,i, All
  443. StringReplace, SongName, SongName, î,i, All
  444. StringReplace, PackVersion, PackVersion, î,i, All
  445.  
  446. StringReplace, AlbumName, AlbumName, ÿ,y, All
  447. StringReplace, ArtistName, ArtistName, ÿ,y, All
  448. StringReplace, SongName, SongName, ÿ,y, All
  449. StringReplace, PackVersion, PackVersion, ÿ,y, All
  450.  
  451. StringReplace, AlbumName, AlbumName, ö,o, All
  452. StringReplace, ArtistName, ArtistName, ö,o, All
  453. StringReplace, SongName, SongName, ö,o, All
  454. StringReplace, PackVersion, PackVersion, ö,o, All
  455.  
  456. StringReplace, AlbumName, AlbumName, ó,o, All
  457. StringReplace, ArtistName, ArtistName, ó,o, All
  458. StringReplace, SongName, SongName, ó,o, All
  459. StringReplace, PackVersion, PackVersion, ó,o, All
  460.  
  461. StringReplace, AlbumName, AlbumName, ô,o, All
  462. StringReplace, ArtistName, ArtistName, ô,o, All
  463. StringReplace, SongName, SongName, ô,o, All
  464. StringReplace, PackVersion, PackVersion, ô,o, All
  465.  
  466. StringReplace, AlbumName, AlbumName, ä,a, All
  467. StringReplace, ArtistName, ArtistName, ä,a, All
  468. StringReplace, SongName, SongName, ä,a, All
  469. StringReplace, PackVersion, PackVersion, ä,a, Allñ
  470.  
  471. StringReplace, AlbumName, AlbumName, ñ,n, All
  472. StringReplace, ArtistName, ArtistName, ñ,n, All
  473. StringReplace, SongName, SongName, ñ,n, All
  474. StringReplace, PackVersion, PackVersion, ñ,n, All
  475.  
  476. StringReplace, AlbumName, AlbumName, à,a, All
  477. StringReplace, ArtistName, ArtistName, à,a, All
  478. StringReplace, SongName, SongName, à,a, All
  479. StringReplace, PackVersion, PackVersion, à,a, All
  480.  
  481. StringReplace, AlbumName, AlbumName, á,a, All
  482. StringReplace, ArtistName, ArtistName, á,a, All
  483. StringReplace, SongName, SongName, á,a, All
  484. StringReplace, PackVersion, PackVersion, á,a, All
  485.  
  486. StringReplace, AlbumName, AlbumName, œ,oe, All
  487. StringReplace, ArtistName, ArtistName, œ,oe, All
  488. StringReplace, SongName, SongName, œ,oe, All
  489. StringReplace, PackVersion, PackVersion, œ,oe, All
  490.  
  491. StringReplace, AlbumName, AlbumName, æ,ao, All
  492. StringReplace, ArtistName, ArtistName, æ,ao, All
  493. StringReplace, SongName, SongName, æ,ao, All
  494. StringReplace, PackVersion, PackVersion, æ,ao, All
  495.  
  496. StringReplace, AlbumName, AlbumName, ç,c, All
  497. StringReplace, ArtistName, ArtistName, ç,c, All
  498. StringReplace, SongName, SongName, ç,c, All
  499. StringReplace, PackVersion, PackVersion, ç,c, All
  500.  
  501. StringReplace, AlbumName, AlbumName, Ñ,N, All
  502. StringReplace, AlbumName, AlbumName, я,r, All
  503. StringReplace, ArtistName, ArtistName, Ñ,N, All
  504. StringReplace, ArtistName, ArtistName, я,r, All
  505. StringReplace, SongName, SongName, Ñ,N, All
  506. StringReplace, SongName, SongName, я,r, All
  507. StringReplace, PackVersion, PackVersion, Ñ,N, All
  508. StringReplace, PackVersion, PackVersion, я,r, All
  509. Gui3Text = Working on : %ArtistNameCuted% - %SongNameCuted%
  510. GuiControl,3:,Gui3Txt, %Gui3Text%
  511. DLCWantingNameInputCorrect = %DLCWantingNameInput%
  512. StringReplace, DLCWantingNameInput, DLCWantingNameInput, `%A`%, %ArtistName%
  513. StringReplace, DLCWantingNameInput, DLCWantingNameInput, `%SN`%, %SongName%
  514. StringReplace, DLCWantingNameInput, DLCWantingNameInput, `%AN`%, %AlbumName%
  515. StringReplace, DLCWantingNameInput, DLCWantingNameInput, `%V`%, %PackVersion%
  516. StringReplace, DLCWantingNameInput, DLCWantingNameInput, `%, , All
  517. StringReplace, DLCWantingNameInput, DLCWantingNameInput, ü, u, All
  518. StringReplace, DLCWantingNameInput, DLCWantingNameInput, %A_SPACE%, , All
  519. ;msgbox,%DLCWantingNameInput%%endfilename%
  520. If YesnoDL = Yes
  521. {
  522. FileCreateDir, %SelectedRS2014Folder%\dlc\%ArtistName%
  523. IfNotExist, %SelectedRS2014Folder%\dlc\%ArtistName%\%DLCWantingNameInput%%endfilename%
  524. {
  525. FileMove, %A_ScriptDir%\tmp\ToRename\%A_LoopFileName%, %SelectedRS2014Folder%\dlc\%ArtistName%\%DLCWantingNameInput%%endfilename%
  526. }
  527. IfExist, %SelectedRS2014Folder%\dlc\%ArtistName%\%DLCWantingNameInput%%endfilename%
  528. {
  529. FileCreateDir, %SelectedRS2014Folder%\dlc\01CheckDuplicat
  530. FileMove, %A_ScriptDir%\tmp\ToRename\%A_LoopFileName%, %SelectedRS2014Folder%\dlc\01CheckDuplicat\%NameId%%DLCWantingNameInput%%endfilename%
  531. NameId++
  532. }
  533. }
  534. If YesnoDL = No
  535. {
  536. IfNotExist, %SelectedRS2014Folder%\dlc\%DLCWantingNameInput%%endfilename%
  537. {
  538. FileMove, %A_ScriptDir%\tmp\ToRename\%A_LoopFileName%, %SelectedRS2014Folder%\dlc\%DLCWantingNameInput%%endfilename%
  539. }
  540. IfExist, %SelectedRS2014Folder%\dlc\%DLCWantingNameInput%%endfilename%
  541. {
  542. FileCreateDir, %SelectedRS2014Folder%\dlc\01CheckDuplicat
  543. FileMove, %A_ScriptDir%\tmp\ToRename\%A_LoopFileName%, %SelectedRS2014Folder%\dlc\01CheckDuplicat\%NameId%%DLCWantingNameInput%%endfilename%
  544. NameId++
  545. }
  546.  
  547. }
  548. FileRemoveDir, %A_ScriptDir%\tmp\ToRename\Unpack, 1
  549. FileDelete, %A_ScriptDir%\tmp\ToRename\%A_LoopFileName%
  550. DLCWantingNameInput = %DLCWantingNameInputCorrect%
  551. ;sleep 1500
  552. }
  553. If YesnoDL = Yes
  554. {
  555. YesnoDL = Yes||No
  556. }
  557. If YesnoDL = No
  558. {
  559. YesnoDL = Yes|No||
  560. }
  561. If Platform = PC
  562. {
  563. Platform = PC||Mac
  564. Platform2 = Pc
  565. }
  566. If Platform = Mac
  567. {
  568. Platform = PC|Mac||
  569. Platform2 = Mac
  570. }
  571. GuiControl,1:,actualdir, %SelectedRS2014Folder%
  572. GuiControl,1:,nameinput, %DLCWantingNameInput%
  573. GuiControl,1:,SelPlatform, %Platform%
  574. GuiControl,1:,FolderYesNo, %YesnoDL%
  575. FileRemoveDir, %A_ScriptDir%\tmp, 1
  576. Gui,3: Destroy
  577. MsgBox, Work Done.`nYou can now play as you wish :)`nCheck DLC folder if there isn't a folder `"01CheckDuplicat`" If there all duplicate or outdated CLDC are there !`nDepending on the platform you choicen but the useless version as been put in folder dlc into `"01%Platform2%Version`"
  578. Gui,1: Restore
  579. return
  580.  
  581. ; Close all if main Gui is closed
  582. GuiClose:
  583. FileRemoveDir, %A_ScriptDir%\tmp, 1
  584. Gui,1: Destroy
  585. Gui,2: Destroy
  586. Gui,3: Destroy
  587. ExitApp
  588.  
  589. ; Restore Gui 1 if Gui 2 is closed.
  590. 2GuiClose:
  591. Gui,1: Restore
  592. Gui,2: Destroy
  593. Gui,3: Destroy
  594. Return
Advertisement
Add Comment
Please, Sign In to add comment