Baoulettes

Guitar Maker v0.0.0.4 Rocksmith 2014 (working)

Nov 20th, 2013
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.49 KB | None | 0 0
  1. IniRead, ccg, CustomGuitarList.ini, NumberInstance, NumberSet
  2. IniRead, ccg2, CustomGuitarList.ini, NumberInstance, NumberGuitar
  3. IniRead, RS2014DIR, CustomGuitarList.ini, Rocksmith2014Directory, Rocksmith2014dir
  4. If ccg = ERROR
  5. {
  6. IniWrite, 0, CustomGuitarList.ini, NumberInstance, NumberSet
  7. IniRead, ccg, CustomGuitarList.ini, NumberInstance, NumberSet
  8. } else {
  9. IniRead, ccg, CustomGuitarList.ini, NumberInstance, NumberSet
  10. }
  11. If ccg2 = ERROR
  12. {
  13. IniWrite, 90000, CustomGuitarList.ini, NumberInstance, NumberGuitar
  14. IniRead, ccg2, CustomGuitarList.ini, NumberInstance, NumberGuitar
  15. } else {
  16. IniRead, ccg2, CustomGuitarList.ini, NumberInstance, NumberGuitar
  17. }
  18. If RS2014DIR = ERROR
  19. {
  20. FileSelectFolder, RS2014DIR,, 3, Select Rocksmith 2014 Installation folder.
  21. Thread, NoTimers, false
  22. } else {
  23. IniRead, RS2014DIR, CustomGuitarList.ini, Rocksmith2014Directory, Rocksmith2014dir
  24. }
  25. IDString = a0b1c2d3e4f5a6b7c8d9e0f
  26. Random, RDM1, 0x00F000000, 0x00fffffff
  27. ID1 = %IDString%%RDM1%
  28. StringUpper, ID1MAJ, ID1
  29. InputBox, guitarname, Guitar Name, Enter Guitar name., 320, 240
  30. InputBox, guitarnamesix, Guitar Name, Enter Guitar name (6 Letter max no maj)., 320, 240
  31. FileSelectFile, DDSInlayfiles, 3, , Open a Inlay Image, Rocksmith 2014 Inlay Image files (*.tga; *.png; *.dds)
  32. FileSelectFile, DDSI512files, 3, , Open a Icon 512x512 Image, Rocksmith 2014 Icon 512x512 Image files (*.tga; *.png; *.dds)
  33. FileCopy, %DDSI512files%, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_512.*
  34. FileCopy, %DDSI512files%, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_256.*
  35. FileCopy, %DDSI512files%, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_128.*
  36. FileCopy, %DDSI512files%, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_64.*
  37. FileCopy, %DDSInlayfiles%, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%.*
  38. Runwait, %A_ScriptDir%\ressources\imgtool\convert.exe %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%.* -resize 1024x512! %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%.png
  39. Runwait, %A_ScriptDir%\ressources\imgtool\convert.exe %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_512.* -resize 512x512! %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_512.png
  40. Runwait, %A_ScriptDir%\ressources\imgtool\convert.exe %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_256.* -resize 256x256! %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_256.png
  41. Runwait, %A_ScriptDir%\ressources\imgtool\convert.exe %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_128.* -resize 128x128! %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_128.png
  42. Runwait, %A_ScriptDir%\ressources\imgtool\convert.exe %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_64.* -resize 64x64! %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_64.png
  43. RunWait, %A_ScriptDir%\ressources\imgtool2\icpcl.exe -dest "%A_ScriptDir%\tmp\images\" -convertto dds format:DXT3 -source "%A_ScriptDir%\tmp\images\*.*"
  44. FileCopy, %RS2014DIR%\cache.psarc, %A_ScriptDir%\backup\cache.psarc
  45. FileCopy, %RS2014DIR%\guitars.psarc, %A_ScriptDir%\backup\guitars.psarc
  46. FileCopy, %RS2014DIR%\static.psarc, %A_ScriptDir%\backup\static.psarc
  47. RunWait, %A_ScriptDir%\ressources\packer.exe --unpack --input=%A_ScriptDir%\backup --output=%A_ScriptDir%\tmp
  48. RunWait, %A_ScriptDir%\ressources\7za.exe x tmp\cache_Pc\cache4.7z -otmp\cache_Pc\cache4
  49. FileAppend, %ccg2%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`n, %A_ScriptDir%\tmp\cache_Pc\cache4\localization\maingame.csv
  50. RunWait, %A_ScriptDir%\ressources\7za.exe a tmp\cache_Pc\cache4.7z .\tmp\cache_Pc\cache4\*
  51. RunWait, %A_ScriptDir%\ressources\7za.exe x tmp\cache_Pc\cache7.7z -otmp\cache_Pc\cache7
  52. FileRead, guitarshsan, %A_ScriptDir%\tmp\cache_Pc\cache7\manifests\guitars\guitars.hsan
  53. StringReplace, guitarshsannew, guitarshsan, "F4F8F798ACCB7071F546CB7BD98E18C5" : {, "%ID1MAJ%" : {`n "Attributes" : {`n "DLC" : true`,`n "LocName" : "$[%ccg2%]%guitarname%"`,`n "ManifestUrn" : "urn:database:json-db:guitar_%guitarnamesix%"`,`n "Name" : "%guitarname%"`,`n "PersistentID" : "%ID1MAJ%"`,`n "PreviewArt" : "urn:image:dds:reward_inlay_%guitarnamesix%"`n }`n }`, `n "F4F8F798ACCB7071F546CB7BD98E18C5" : {
  54. FileDelete, %A_ScriptDir%\tmp\cache_Pc\cache7\manifests\guitars\guitars.hsan
  55. FileAppend, %guitarshsannew%, %A_ScriptDir%\tmp\cache_Pc\cache7\manifests\guitars\guitars.hsan
  56. RunWait, %A_ScriptDir%\ressources\7za.exe a tmp\cache_Pc\cache7.7z .\tmp\cache_Pc\cache7\*
  57. FileAppend, `n, %A_ScriptDir%\tmp\cache_Pc\appid.appid
  58. newfilesjson = {`n "Entries": {`n "%ID1MAJ%": {`n "Attributes": {`n "DecorativeInlays": "urn:application:gamebryo-scenegraph:%guitarnamesix%"`,`n "DLC": true`,`n "LocName": "$[%ccg2%]%guitarname%"`,`n "ManifestUrn": "urn:database:json-db:guitar_%guitarnamesix%"`,`n "Name": "%guitarname%",`n "PreviewArt": "urn:image:dds:reward_inlay_%guitarnamesix%"`,`n "PersistentID": "%ID1MAJ%"`n }`n }`n }`,`n "ModelName": "RSEnumerable_Guitar"`,`n "IterationVersion": 2`,`n "InsertRoot": "Static.Guitars.Entries"`n}`n
  59. FileAppend, %newfilesjson%, %A_ScriptDir%\tmp\guitars_Pc\manifests\guitars\guitar_%guitarnamesix%.json
  60. FileRead, guitarshsan2, %A_ScriptDir%\tmp\guitars_Pc\manifests\guitars\guitars.hsan
  61. StringReplace, guitarshsannew2, guitarshsan2, "F4F8F798ACCB7071F546CB7BD98E18C5" : {, "%ID1MAJ%" : {`n "Attributes" : {`n "DLC" : true`,`n "LocName" : "$[%ccg2%]%guitarname%"`,`n "ManifestUrn" : "urn:database:json-db:guitar_%guitarnamesix%"`,`n "Name" : "%guitarname%"`,`n "PersistentID" : "%ID1MAJ%"`,`n "PreviewArt" : "urn:image:dds:reward_inlay_%guitarnamesix%"`n }`n }`, `n "F4F8F798ACCB7071F546CB7BD98E18C5" : {
  62. FileDelete, %A_ScriptDir%\tmp\guitars_Pc\manifests\guitars\guitars.hsan
  63. FileAppend, %guitarshsannew2%, %A_ScriptDir%\tmp\guitars_Pc\manifests\guitars\guitars.hsan
  64. newfilesxblock = <?xml version="1.0" encoding="utf-8"?>`n<game>`n <entitySet>`n <entity id="%ID1%" modelName="RSEnumerable_Guitar" name="%guitarnamesix%" iterations="0">`n <properties>`n <property name="Header">`n <set value="urn:database:hsan-db:guitars" />`n </property>`n <property name="Manifest">`n <set value="urn:database:json-db:guitar_%guitarnamesix%" />`n </property>`n <property name="PreviewArt">`n <set value="urn:image:dds:reward_inlay_%guitarnamesix%" />`n </property>`n <property name="DecorativeInlays">`n <set value="urn:application:gamebryo-scenegraph:%guitarnamesix%" />`n </property>`n </properties>`n </entity>`n </entitySet>`n</game>`n
  65. FileAppend, %newfilesxblock%, %A_ScriptDir%\tmp\guitars_Pc\gamexblocks\nguitars\guitar_%guitarnamesix%.xblock
  66. FileCopy, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%.dds, %A_ScriptDir%\tmp\guitars_Pc\assets\gameplay\inlay\inlay_%guitarnamesix%.dds
  67. TestString = inlay_%guitarnamesix%.dds
  68. Output := StringToHex(TestString)
  69. Ootput = %Output%
  70. newhexname = %Output%
  71. StringReplace newhexname, newhexname, %A_Space%, , All
  72. filenifname = %guitarnamesix%.nif
  73. StringToHex(String)
  74. {
  75. local Old_A_FormatInteger, CharHex, HexString
  76.  
  77. ;Return '0' if the string was blank
  78. If !String
  79. Return 0
  80.  
  81. ;Save the current Integer format
  82. Old_A_FormatInteger := A_FormatInteger
  83.  
  84. ;Set the format of integers to their Hex value
  85. SetFormat, INTEGER, H
  86.  
  87. ;Parse the String
  88. Loop, Parse, String
  89. {
  90. ;Get the ASCII value of the Character (will be converted to the Hex value by the SetFormat Line above)
  91. CharHex := Asc(A_LoopField)
  92.  
  93. ;Comment out the following line to leave the '0x' intact
  94. StringTrimLeft, CharHex, CharHex, 2
  95.  
  96. ;Build the return string
  97. HexString .= CharHex . " "
  98. }
  99. ;Set the integer format to what is was prior to the call
  100. SetFormat, INTEGER, %Old_A_FormatInteger%
  101.  
  102. ;Return the string to the caller
  103. Return HexString
  104. }
  105. /*
  106. BinReadWrite.ahk
  107.  
  108. Routines to read and write binary data from/to files.
  109. Based on original functions written by Laszlo
  110. http://www.autohotkey.com/forum/viewtopic.php?t=4604
  111.  
  112. TODO: Perhaps set a lastError variable to explicit the errors.
  113.  
  114. // by Philippe Lhoste <PhiLho(a)GMX.net> http://Phi.Lho.free.fr
  115. // File/Project history:
  116. 1.03.000 -- 2006/02/15 (PL) -- Moved Bin2Hex & Hex2Bin to DllCallStruct, apply code rules.
  117. 1.02.000 -- 2006/01/24 (PL) -- Slight change of the API: all functions return -1 if error.
  118. Integrated Laszlo suggestions on improving Bin2Hex and Hex2Bin.
  119. 1.01.000 -- 2006/01/23 (PL) -- Declaration of the local variables, to get access to global
  120. WinAPI constants, and for consistency.
  121. 1.00.000 -- 2006/01/19 (PL) -- Rewrote the functions to separate opening and closing,
  122. allowing efficient multiple operations.
  123. */
  124.  
  125. ; WinAPI constants
  126. INVALID_HANDLE_VALUE = -1
  127. INVALID_FILE_SIZE = 0xFFFFFFFF
  128. FILE_BEGIN = 0
  129. FILE_CURRENT = 1
  130. FILE_END = 2
  131.  
  132. /*
  133. // Open the file for reading.
  134. // Return the file handle to provide in further read operations and in the final close operation,
  135. // or INVALID_HANDLE_VALUE if an error was found.
  136. */
  137. OpenFileForRead(_filename)
  138. {
  139. local handle
  140.  
  141. handle := DllCall("CreateFile"
  142. , "Str", _filename ; lpFileName
  143. , "UInt", 0x80000000 ; dwDesiredAccess (GENERIC_READ)
  144. , "UInt", 3 ; dwShareMode (FILE_SHARE_READ|FILE_SHARE_WRITE)
  145. , "UInt", 0 ; lpSecurityAttributes
  146. , "UInt", 3 ; dwCreationDisposition (OPEN_EXISTING)
  147. , "UInt", 0 ; dwFlagsAndAttributes
  148. , "UInt", 0) ; hTemplateFile
  149. If (handle = INVALID_HANDLE_VALUE or handle = 0)
  150. {
  151. ErrorLevel = -1
  152. }
  153. IfNotEqual ErrorLevel, 0, Return INVALID_HANDLE_VALUE ; Couldn't open the file
  154. Return handle
  155. }
  156.  
  157. /*
  158. // Open the file for writing.
  159. // Return the file handle to provide in further write operations and in the final close operation,
  160. // or INVALID_HANDLE_VALUE if an error was found.
  161. */
  162. OpenFileForWrite(_filename)
  163. {
  164. local handle
  165.  
  166. handle := DllCall("CreateFile"
  167. , "Str", _filename ; lpFileName
  168. , "UInt", 0x40000000 ; dwDesiredAccess (GENERIC_WRITE)
  169. , "UInt", 3 ; dwShareMode (FILE_SHARE_READ|FILE_SHARE_WRITE)
  170. , "UInt", 0 ; lpSecurityAttributes
  171. , "UInt", 4 ; dwCreationDisposition (OPEN_ALWAYS: create if not exists)
  172. , "UInt", 0 ; dwFlagsAndAttributes
  173. , "UInt", 0) ; hTemplateFile
  174. If (handle = INVALID_HANDLE_VALUE or handle = 0)
  175. {
  176. ErrorLevel = -1
  177. }
  178. IfNotEqual ErrorLevel, 0, Return INVALID_HANDLE_VALUE ; Couldn't open the file
  179. Return handle
  180. }
  181.  
  182. /*
  183. // Close the file.
  184. */
  185. CloseFile(_handle)
  186. {
  187. local result
  188.  
  189. result := DllCall("CloseHandle"
  190. , "UInt", _handle)
  191. If (result = 0)
  192. {
  193. ErrorLevel = -1
  194. }
  195. }
  196.  
  197. /*
  198. // Get the size of the opened file, in bytes.
  199. // Limited to 4GB, so it is more limited that AHK's FileGetSize.
  200. // It is here for consistency, and because it accepts a file handle instead of a path.
  201. //
  202. // Return the size in bytes, -1 if there was an error.
  203. */
  204. GetFileSize(_handle)
  205. {
  206. local fileSize
  207.  
  208. fileSize := DllCall("GetFileSize"
  209. , "UInt", _handle
  210. , "UInt", 0)
  211. If (fileSize = INVALID_FILE_SIZE)
  212. {
  213. ErrorLevel = -1
  214. }
  215. IfNotEqual ErrorLevel, 0, Return -1
  216. Return fileSize
  217. }
  218.  
  219. /*
  220. // Move the file pointer in the file to the given offset relative to moveMethod.
  221. //
  222. // moveMethod can be FILE_BEGIN, FILE_CURRENT or FILE_END.
  223. // If moveMethod is -1, nothing is done (default, for operations at current position).
  224. // To get the current position, call this function with just FILE_CURRENT (null offset).
  225. // offset can be positive (toward end of the file) or negative (toward start of the file).
  226. //
  227. // Return -1 if there was an error, the new file pointer position if OK.
  228. // Note: Currently it doesn't work for files larger than 2GB...
  229. */
  230. MoveInFile(_handle, _moveMethod=-1, _offset=0)
  231. {
  232. local result
  233.  
  234. result = %INVALID_FILE_SIZE%
  235. if (_moveMethod != -1)
  236. {
  237. result := DllCall("SetFilePointer"
  238. , "UInt", _handle ; hFile
  239. , "Int", _offset ; lDistanceToMove
  240. , "UInt", 0 ; lpDistanceToMoveHigh
  241. , "UInt", _moveMethod) ; dwMoveMethod
  242. if (result = -1) ; INVALID_SET_FILE_POINTER
  243. {
  244. ErrorLevel = -1
  245. }
  246. IfNotEqual ErrorLevel, 0, Return -1 ; Couldn't make the move
  247. }
  248. Return result
  249. }
  250.  
  251. /*
  252. // Write in a file opened for writing.
  253. //
  254. // Move to position given by moveMethod and offset
  255. // (by default stand at current position) and
  256. // write byteNb bytes from data (all data if byteNb = 0;
  257. // data contains binary bytes that can be a string or
  258. // raw bytes generated from hexa data with the Hex2Bin routine).
  259. //
  260. // moveMethod, defaulting to -1 (no move, write at current position),
  261. // can also be FILE_BEGIN, FILE_CURRENT or FILE_END.
  262. // offset can be positive (toward end of file) or negative (toward beginning of file).
  263. //
  264. // Return the number of bytes written (-1 if there was an error).
  265. */
  266. WriteInFile(_handle, ByRef @data, _byteNb=0, _moveMethod=-1, _offset=0)
  267. {
  268. local dataSize, result, written
  269.  
  270. _offset := MoveInFile(_handle, _moveMethod, _offset)
  271. IfNotEqual ErrorLevel, 0, Return -1 ; Couldn't make the move
  272.  
  273. dataSize := VarSetCapacity(@data) ; Get the capacity (>= used length!)
  274. If (_byteNb < 1 or _byteNb > dataSize)
  275. {
  276. byteNb := dataSize
  277. }
  278. result := DllCall("WriteFile"
  279. , "UInt", _handle ; hFile
  280. , "Str", @data ; lpBuffer
  281. , "UInt", _byteNb ; nNumberOfBytesToWrite
  282. , "UInt *", written ; lpNumberOfBytesWritten
  283. , "UInt", 0) ; lpOverlapped
  284. if (result = 0 or written < _byteNb)
  285. {
  286. ErrorLevel = -2
  287. }
  288. IfNotEqual ErrorLevel, 0, Return -1 ; Couldn't write in the file
  289. Return written
  290. }
  291.  
  292. /*
  293. // Read from a file opened for reading.
  294. //
  295. // Move to position given by moveMethod and offset
  296. // (by default stand at current position) and
  297. // read byteNb bytes in data (the whole file if byteNb = 0;
  298. // data contains binary bytes that can be a string or
  299. // raw bytes that can be converted to hex digits with the Bin2Hex routine).
  300. //
  301. // moveMethod, defaulting to -1 (no move, read at current position),
  302. // can also be FILE_BEGIN, FILE_CURRENT or FILE_END.
  303. // offset can be positive (toward end of file) or negative (toward beginning of file).
  304. //
  305. // Return the number of bytes read (-1 if there was an error), which can be less
  306. // than requested if end-of-file is meet.
  307. */
  308. ReadFromFile(_handle, ByRef @data, _byteNb=0, _moveMethod=-1, _offset=0)
  309. {
  310. local fileSize, granted, result, read
  311.  
  312. _offset := MoveInFile(_handle, _moveMethod, _offset)
  313. IfNotEqual ErrorLevel, 0, Return -1 ; Couldn't make the move
  314.  
  315. if (_byteNb = 0)
  316. {
  317. ; Read whole file (or less if file pointer isn't at start)
  318. fileSize := GetFileSize(_handle)
  319. IfNotEqual ErrorLevel, 0, Return -1 ; Couldn't get the file size
  320. _byteNb := fileSize
  321. }
  322. granted := VarSetCapacity(@data, _byteNb, 0)
  323. if (granted < _byteNb)
  324. {
  325. ; Cannot allocate enough memory
  326. ErrorLevel = Mem=%granted%
  327. Return -1
  328. }
  329.  
  330. result := DllCall("ReadFile"
  331. , "UInt", _handle ; hFile
  332. , "Str", @data ; lpBuffer
  333. , "UInt", _byteNb ; nNumberOfBytesToRead
  334. , "UInt *", read ; lpNumberOfBytesRead
  335. , "UInt", 0) ; lpOverlapped
  336. if (result = 0)
  337. {
  338. ErrorLevel = -2
  339. }
  340. ;~ MsgBox fileSize: %fileSize% - offset: %_offset% - byteNb: %_byteNb% - granted: %granted% - read: %read%
  341. IfNotEqual ErrorLevel, 0, Return -1 ; Couldn't read the file
  342.  
  343. ; Note that we can have read less data than requested,
  344. ; eg. if end of file has been meet
  345. Return read
  346. }
  347. /*
  348. // Convert raw bytes stored in a variable to a string of hexa digit pairs.
  349. // Convert either byteNb bytes or, if null, the whole content of the variable.
  350. //
  351. // Return the number of converted bytes, or -1 if error (memory allocation)
  352. */
  353. Bin2Hex(ByRef @hex, ByRef @bin, _byteNb=0)
  354. {
  355. local intFormat, dataSize, dataAddress, granted, x
  356.  
  357. ; Save original integer format
  358. intFormat = %A_FormatInteger%
  359. ; For converting bytes to hex
  360. SetFormat Integer, Hex
  361.  
  362. ; Get size of data
  363. dataSize := VarSetCapacity(@bin)
  364. If (_byteNb < 1 or _byteNb > dataSize)
  365. {
  366. _byteNb := dataSize
  367. }
  368. dataAddress := &@bin
  369. ; Make enough room (faster)
  370. granted := VarSetCapacity(@hex, _byteNb * 2)
  371. if (granted < _byteNb * 2)
  372. {
  373. ; Cannot allocate enough memory
  374. ErrorLevel = Mem=%granted%
  375. Return -1
  376. }
  377. Loop %_byteNb%
  378. {
  379. ; Get byte in hexa
  380. x := *dataAddress + 0x100
  381. StringRight x, x, 2 ; 2 hex digits
  382. StringUpper x, x
  383. @hex = %@hex%%x%
  384. dataAddress++ ; Next byte
  385. }
  386. ; Restore original integer format
  387. SetFormat Integer, %intFormat%
  388.  
  389. Return _byteNb
  390. }
  391.  
  392. /*
  393. // Convert a string of hexa digit pairs to raw bytes stored in a variable.
  394. // Convert either byteNb bytes or, if null, the whole content of the variable.
  395. //
  396. // Return the number of converted bytes, or -1 if error (memory allocation)
  397. */
  398. Hex2Bin(ByRef @bin, _hex, _byteNb=0)
  399. {
  400. local dataSize, granted, dataAddress, x
  401.  
  402. ; Get size of data
  403. x := StrLen(_hex)
  404. dataSize := Ceil(x / 2)
  405. if (x = 0 or dataSize * 2 != x)
  406. {
  407. ; Invalid string, empty or odd number of digits
  408. ErrorLevel = Param
  409. Return -1
  410. }
  411. If (_byteNb < 1 or _byteNb > dataSize)
  412. {
  413. _byteNb := dataSize
  414. }
  415. ; Make enough room
  416. granted := VarSetCapacity(@bin, _byteNb, 0)
  417. if (granted < _byteNb)
  418. {
  419. ; Cannot allocate enough memory
  420. ErrorLevel = Mem=%granted%
  421. Return -1
  422. }
  423. dataAddress := &@bin
  424.  
  425. Loop Parse, _hex
  426. {
  427. if (A_Index & 1) ; Odd
  428. {
  429. x = %A_LoopField% ; Odd digit
  430. }
  431. else
  432. {
  433. ; Concatenate previous x and even digit, converted to hex
  434. x := "0x" . x . A_LoopField
  435. ; Store integer in memory
  436. DllCall("RtlFillMemory"
  437. , "UInt", dataAddress
  438. , "UInt", 1
  439. , "UChar", x)
  440. dataAddress++
  441. }
  442. }
  443.  
  444. Return _byteNb
  445. }
  446. HexString=
  447. ( Join
  448. 47616D656272796F2046696C6520466F726D61742C2056657273696F6E2033302E312E302E330A0300011E010000000049000000000000000B00110000004E694461746153747265616D0131013138110000004E694461746153747265616D0130013138110000004E69537472696E67457874726144617461060000004E694D657368120000004E694D6174657269616C50726F7065727479150000004E69566572746578436F6C6F7250726F70657274790F0000004E69416C70686150726F70657274790F0000004E69536F7572636554657874757265130000004E69546578747572696E6750726F7065727479110000004E695A42756666657250726F7065727479060000004E694E6F64650000010002000300000001000200030000000100020003000000010002000300000001000200030000000100020003000000010002000300000001000200030000000100020003000000010002000300000001000200030000000100020003000000010002000300000001000200030000000100020003000000010004000500060007000800090002000300050009000A00710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC000000710000002900000008000000BC0000007100000029000000440000000E0000000F00000024000000280000000E00000008000000BC0000000E0000000E0000009A00000018000000100000000A0000005363656E6520526F6F7407000000696E6C61795F330E0000005573657250726F704275666665720B0000000D0A7A4D6F646531300D0A10000000%newhexname%0B0000004D6174657269616C20233205000000494E44455808000000504F534954494F4E08000000544558434F4F524407000000696E6C61795F3407000000696E6C61795F3507000000696E6C61795F3607000000696E6C61795F3707000000696E6C61795F3807000000696E6C61795F3908000000696E6C61795F313008000000696E6C61795F313108000000696E6C61795F313208000000696E6C61795F313308000000696E6C61795F313408000000696E6C61795F313508000000696E6C61795F313608000000696E6C61795F313708000000696E6C61795F31380000000050000000000000000100000000000000040000000200000037040300360402008EDBA1C2D26F80C049382037B18A633FEA6B6F3F01A3A8C2D26F80C06CF22637E7077B3FEA6B6F3F02A3A8C2D36F80406CF22637EB077B3F3A04FB3E8FDBA1C2D36F804049382037B98A633F3A04FB3E010C000000000000000100000000000000060000000100000015020100020003000000000001000200010200000003000000170000000100000002000000FFFFFFFF10009C2727B7B8C850C2A68B5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000483FA5C2000080345A952337DC6A8B400200000001000000000100000001000000060000000000000000000000000100000002000000070000000000000008000000000000000000000050000000000000000100000000000000040000000200000037040300360402002DF799C2D26F80C0AF6318374532483FEA6B6F3F1E14A1C2D26F80C065721F37A7D7603FEA6B6F3F1F14A1C2D36F804065721F37AFD7603F3A04FB3E2EF799C2D36F8040AF6318374932483F3A04FB3E010C000000000000000100000000000000060000000100000015020100020003000000000001000200010200000003000000160000000100000006000000FFFFFFFF100021431FB7B8C850C29D8C5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000A6859DC2000080340AEB1B376F7A8C400200000005000000000100000001000000060000000000000004000000000100000002000000070000000000000008000000000000000000000050000000000000000100000000000000040000000200000037040300360402001E1A92C2D26F80C0609710372BF32C3FEA6B6F3FBD2F99C2D26F80C0DC9D17373B7F453FEA6B6F3FBE2F99C2D36F8040DD9D17373B7F453F3A04FB3E1E1A92C2D36F80406097103727F32C3F3A04FB3E010C00000000000000010000000000000006000000010000001502010002000300000000000100020001020000000300000015000000010000000A000000FFFFFFFF1000E64517B7B8C850C29A8D5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000EEA495C2000080349E1A1437C0628C40020000000900000000010000000100000006000000000000000800000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200C6D489C2D26F80C0E4630837C34A103FEA6B6F3FAE5291C2D26F80C09DD10F3729402A3FEA6B6F3FAE5291C2D36F80409ED10F3725402A3F3A04FB3EC6D489C2D36F8040E6630837BF4A103F3A04FB3E010C00000000000000010000000000000006000000010000001502010002000300000000000100020001020000000300000014000000010000000E000000FFFFFFFF1000F5290FB7B8C850C29C8E5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000BA938DC200008034C11A0C3794BB8D40020000000D00000000010000000100000006000000000000000C00000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200B88581C2D26F80C0CD2700376301E73EEA6B6F3F560D89C2D26F80C0319E0737B9970D3FEA6B6F3F560D89C2D36F8040339E0737B7970D3F3A04FB3EB88581C2D36F8040CE2700376001E73E3A04FB3E010C000000000000000100000000000000060000000100000015020100020003000000000001000200010200000003000000130000000100000012000000FFFFFFFF1000ECE906B7B8C850C2A58F5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000874985C20000803400E303377FDC8D40020000001100000000010000000100000006000000000000001000000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200BE0372C2D26F80C04E70EF3668FFAB3EEA6B6F3F48BE80C2D26F80C05EC4FE364F9BE13EEA6B6F3F48BE80C2D36F804060C4FE364F9BE13E3A04FB3EC00372C2D36F80405170EF3661FFAB3E3A04FB3E010C000000000000000100000000000000060000000100000015020100020003000000000001000200010200000003000000120000000100000016000000FFFFFFFF1000302CFCB6B8C850C2B2905ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF000000000001000027C079C200008034571AF736D6918E40020000001500000000010000000100000006000000000000001400000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200FC9160C2D26F80C08529DE3681D8693E903B6F3FE07470C2D26F80C036E5ED367D6BA73E8E3B6F3FE27470C2D36F804039E5ED36816BA73E82A3FA3EFE9160C2D36F80408929DE368FD8693E82A3FA3E010C00000000000000010000000000000006000000010000001502010002000300000000000100020001020000000300000011000000010000001A000000FFFFFFFF10008441EBB6B8C850C2C6915ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF00000000000100006F8368C2000080345F07E636054C8F400200000019000000000100000001000000060000000000000018000000000100000002000000070000000000000008000000000000000000000050000000000000000100000000000000040000000200000037040300360402008F854EC2D26F80C0D54ACC362E36EE3D903B6F3F1E035FC2D26F80C08D9EDC36C6F05F3E903B6F3F20035FC2D36F8040919EDC36CDF05F3E82A3FA3E92854EC2D36F8040D94ACC365A36EE3D82A3FA3E010C00000000000000010000000000000006000000010000001502010002000300000000000100020001020000000300000010000000010000001E000000FFFFFFFF10004604D9B6B8C850C2E2925ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF000000000001000058C456C200008034B374D43689629040020000001D00000000010000000100000006000000000000001C00000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200BE1E3CC2D26F80C0A514BA366CC2073B903B6F3FB1F64CC2D26F80C001C0CA36C666DA3D903B6F3FB4F64CC2D36F804005C0CA36E366DA3D82A3FA3EC21E3CC2D36F8040A914BA36E4C7073B82A3FA3E010C0000000000000001000000000000000600000001000000150201000200030000000000010002000102000000030000000F0000000100000022000000FFFFFFFF10006E79C6B6B8C850C205945ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000B98A44C200008034556AC2361C099140020000002100000000010000000100000006000000000000002000000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200873A29C2D26F80C02E64A7369CE45E3FA2AFEC3EE08F3AC2D26F80C0FA89B83640387D3FA2AFEC3EE48F3AC2D36F8040FE89B83647387D3F40C08D3C8B3A29C2D36F80403264A736A1E45E3F40C08D3C010C0000000000000001000000000000000600000001000000150201000200030000000000010002000102000000030000000E0000000100000026000000FFFFFFFF100043AAB3B6B8C850C230955ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF000000000001000036E531C20000803416F7AF36C6F4914002000000250000000001000000010000000600000000000000240000000001000000020000000700000000000000080000000000000000000000500000000000000001000000000000000400000002000000370403003604020041CC15C2D26F80C0F72C94368DE53C3FA2AFEC3EA9AB27C2D26F80C0A9D9A536BE2A5C3FA2AFEC3EADAB27C2D36F8040ADD9A536C62A5C3F40C08D3C44CC15C2D36F8040FA2C943693E53C3F40C08D3C010C0000000000000001000000000000000600000001000000150201000200030000000000010002000102000000030000000D000000010000002A000000FFFFFFFF1000A987A0B6B8C850C262965ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000F7BB1EC20000803452039D363BFE92400200000029000000000100000001000000060000000000000028000000000100000002000000070000000000000008000000000000000000000050000000000000000100000000000000040000000200000037040300360402005E8201C2D26F80C0B01D80364366193FA2AFEC3E633D14C2D26F80C08FA29236B02B3A3FA2AFEC3E663D14C2D36F804092A29236B62B3A3F40C08D3C618201C2D36F8040B41D80364566193F40C08D3C010C0000000000000001000000000000000600000001000000150201000200030000000000010002000102000000030000000C000000010000002E000000FFFFFFFF1000CCF38BB6B8C850C2A0975ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000E2DF0AC2000080342160893634B19440020000002D00000000010000000100000006000000000000002C00000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200EF68DAC1D26F80C0141C5836E4BFEB3EA2AFEC3E00E7FFC1D26F80C0EE267D3664AC163FA2AFEC3E06E7FFC1D36F8040F5267D366BAC163F40C08D3CF368DAC1D36F80401A1C5836EBBFEB3E40C08D3C010C0000000000000001000000000000000600000001000000150201000200030000000000010002000102000000030000000B0000000100000032000000FFFFFFFF10003E3270B6B8C850C2E5985ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000FA27EDC10000803484A16A364DB9944002000000310000000001000000010000000600000000000000300000000001000000020000000700000000000000080000000000000000000000500000000000000001000000000000000400000002000000370403003604020077C6AFC1D26F80C04DFE2D36C627A13EA2AFEC3E334BD7C1D26F80C0FC075536294CE63EA2AFEC3E374BD7C1D36F8040010855362F4CE63E40C08D3C7AC6AFC1D36F804052FE2D36C627A13E40C08D3C010C0000000000000001000000000000000600000001000000150201000200030000000000010002000102000000030000000A0000000100000036000000FFFFFFFF10001CD645B6B8C850C2329A5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000D788C3C10000803427834136B2CE9640020000003500000000010000000100000006000000000000003400000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200E4E083C1D26F80C0D1A50236AEB4283EA2AFEC3EBBA8ACC1D26F80C06EEA2A3609B49B3EA2AFEC3EBEA8ACC1D36F804073EA2A360FB49B3E40C08D3CE8E083C1D36F8040D2A50236C6B4283E80C08D3C010C00000000000000010000000000000006000000010000001502010000000100020002000300000001020000000300000009000000010000003A000000FFFFFFFF10006A6F1AB6B8C850C28C9B5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F0500000042000000400000003F0000003E00000043000000FFFFFFFF00000000FFFFFFFF0000000000010000D14498C10000803422C8163642259840020000003900000000010000000100000006000000000000003800000000010000000200000007000000000000000800000000000000000000005000000000000000010000000000000004000000020000003704030036040200E61B2DC1D26F80C0F2D1AB353AB6213CA2AFEC3E28C380C1D26F80C08424FF3540CD1D3EA2AFEC3E2CC380C1D36F80408624FF354CCD1D3E80C08D3CE81B2DC1D36F8040ECD1AB353AB6213C80C08D3C010C000000000000000100000000000000060000000100000015020100020003000000000001000200010500000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000803F0000803F0000803F000020410000803FFFFFFFFF00000000FFFFFFFF0000FFFFFFFF00000000FFFFFFFFED1000FFFFFFFF00000000FFFFFFFF0104000000FFFFFFFF060000000100000003000000010000FFFFFFFF00000000FFFFFFFF04000900000001410000000032010000000000000000000000000000FFFFFFFF00000000FFFFFFFF0D000200000003000000010000000100000044000000FFFFFFFF1000705DD8B5B8C850C2F19C5ABC000080B4000080B3000080BF000080BF0000000000004034000080330000803F000000B40000803F050000003E0000003F000000400000004200000043000000FFFFFFFF00000000FFFFFFFF00000000000100001F5157C100008034397BD535D3B19940020000003D00000000010000000100000006000000000000003C0000000001000000020000000700000000000000080000000000000000000000FFFFFFFF00000000FFFFFFFF0800FFFFFFFF00000000FFFFFFFF0F000000000000000000FFFFFFFF10010000000000000000000000000000803F0000000000000000000000000000803F0000000000000000000000000000803F0000803F020000004600000047000000FFFFFFFF10000000450000003B00000037000000330000002F0000002B00000027000000230000001F0000001B00000017000000130000000F0000000B0000000700000003000000000000000100000048000000
  449. )
  450. Tfh := OpenFileForWrite(filenifname)
  451. l := Hex2Bin(data, HexString)
  452. WriteInFile(Tfh, data, l)
  453. CloseFile(Tfh)
  454. FileCopy,%A_ScriptDir%\%filenifname%, %A_ScriptDir%\tmp\guitars_Pc\assets\gameplay\inlay\%filenifname%
  455. FileDelete,%A_ScriptDir%\%filenifname%
  456. FileAppend, `n, %A_ScriptDir%\tmp\guitars_Pc\appid.appid
  457. FileAppend, %ccg2%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`,%guitarname%`n, %A_ScriptDir%\tmp\static_Pc\localization\maingame.csv
  458. FileCopy, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_512.dds, %A_ScriptDir%\tmp\static_Pc\gfxassets\rewards\guitar_inlays\reward_inlay_%guitarnamesix%_512.dds
  459. FileCopy, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_256.dds, %A_ScriptDir%\tmp\static_Pc\gfxassets\rewards\guitar_inlays\reward_inlay_%guitarnamesix%_256.dds
  460. FileCopy, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_128.dds, %A_ScriptDir%\tmp\static_Pc\gfxassets\rewards\guitar_inlays\reward_inlay_%guitarnamesix%_128.dds
  461. FileCopy, %A_ScriptDir%\tmp\images\inlay_%guitarnamesix%_64.dds, %A_ScriptDir%\tmp\static_Pc\gfxassets\rewards\guitar_inlays\reward_inlay_%guitarnamesix%_64.dds
  462. FileRemoveDir, %A_ScriptDir%\tmp\cache_Pc\cache7, 1
  463. FileRemoveDir, %A_ScriptDir%\tmp\cache_Pc\cache4, 1
  464. RunWait, %A_ScriptDir%\ressources\packer.exe --pack --input=%A_ScriptDir%\tmp\cache_Pc --output=%A_ScriptDir%\output\cache.psarc
  465. RunWait, %A_ScriptDir%\ressources\packer.exe --pack --input=%A_ScriptDir%\tmp\guitars_Pc --output=%A_ScriptDir%\output\guitars.psarc
  466. RunWait, %A_ScriptDir%\ressources\packer.exe --pack --input=%A_ScriptDir%\tmp\static_Pc --output=%A_ScriptDir%\output\static.psarc
  467. IniWrite, %RS2014DIR%, CustomGuitarList.ini, Rocksmith2014Directory, Rocksmith2014dir
  468. IniWrite, %ccg2% - %guitarname%, CustomGuitarList.ini, GuitarList, %ID1%
  469. IniWrite, %ID1%, CustomGuitarList.ini, CustomGuitarMasterID, MasterID%ccg%
  470. IniWrite, %ccg2%, CustomGuitarList.ini, CustomGuitarLinkToID, %ID1%
  471. IniWrite, %guitarname%, CustomGuitarList.ini, CustomGuitarNameList, Guitar%ccg%
  472. ccg++
  473. ccg2++
  474. IniWrite, %ccg%, CustomGuitarList.ini, NumberInstance, NumberSet
  475. IniWrite, %ccg2%, CustomGuitarList.ini, NumberInstance, NumberGuitar
  476. FileDelete, %A_ScriptDir%\tmp\images\*.*
  477. FileRemoveDir, %A_ScriptDir%\tmp\cache_Pc, 1
  478. FileRemoveDir, %A_ScriptDir%\tmp\guitars_Pc, 1
  479. FileRemoveDir, %A_ScriptDir%\tmp\static_Pc, 1
Advertisement
Add Comment
Please, Sign In to add comment