Public paste
Undefined
By: Guest | Date: Aug 14 2015 22:25 | Format: None | Expires: never | Size: 9.75 KB | Hits: 1016

  1. :: League of Legends Language Unlocker Script v8
  2. :: By: nothingxs
  3. :: Twitter: nothingxs / Reddit: http://reddit.com/u/nothingxs
  4. :: The user does not need to edit anything: simply copy the script to a .bat
  5. :: file and run it.
  6. :: New ideas by http://reddit.com/u/Nominance
  7. ::
  8. :: Changes in v8
  9. :: - Bugfixes!
  10. :: Changes in v7
  11. :: - Properly implements Delayed Expansion, now properly stores variables in
  12. ::   settings file
  13. :: - Looks a little prettier and now also includes instructions.
  14. :: - Will check registry when first initialized; may never need to interact to
  15. ::   set up the program. A lot more user-friendly as a result.
  16.  
  17. @ECHO OFF
  18. COLOR 1F
  19. SET lusver=v8
  20. TITLE League of Legends Language Unlocker %lusver%
  21. SETLOCAL EnableDelayedExpansion
  22.  
  23. :: This checks to see if unlocker.ini exists and tries to load your game's path
  24. :: from it. If it does not find the game there, it will prompt the user to
  25. :: manually input the path.
  26. :CHECKSET
  27. CLS
  28. ECHO +-----------------------------------------------------------------------------+
  29. ECHO ¦                   League of Legends Language Unlocker %lusver%                    ¦
  30. ECHO +-----------------------------------------------------------------------------+
  31. IF EXIST .\unlocker.ini GOTO LOAD
  32.  
  33. :: First, we're going to check the registry to see if we can find where League
  34. :: is installed. If we find a path, we don't need to do anything else special.
  35. :: Some people do run the game off of a flash drive, however, so we want to be
  36. :: able to set the path manually in that case.
  37. :REGCHECK
  38. ECHO +-----------------------------------------------------------------------------+
  39. ECHO ¦ No settings file found, checking registry...                                ¦
  40. ECHO +-----------------------------------------------------------------------------+
  41. REG QUERY "HKLM\Software\Wow6432Node\Riot Games\League of Legends">NUL
  42. IF %ERRORLEVEL% EQU 1 GOTO PROMPT
  43.  
  44. :: We found a registry entry that might contain the path. Check that first and
  45. :: save that to the unlocker.ini settings file, then try to load with that.
  46. :FETCH
  47. ECHO +-----------------------------------------------------------------------------+
  48. ECHO ¦ Registry entry found.                                                       ¦
  49. ECHO +-----------------------------------------------------------------------------+
  50. FOR /f "skip=2 tokens=1,2*" %%A IN ('REG QUERY "HKLM\Software\Wow6432Node\Riot Games\League of Legends" /v Path 2^>NUL') DO SET temptarget=%%C
  51. ECHO !temptarget!>unlocker.ini
  52. ECHO.
  53. ECHO       ^(!temptarget!^)
  54. ECHO.
  55. GOTO LOAD
  56.  
  57. :PROMPT
  58. ECHO +-----------------------------------------------------------------------------+
  59. ECHO ¦ Settings file not found. ^(unlocker.ini^)                                     ¦
  60. ECHO +-----------------------------------------------------------------------------¦
  61. ECHO ¦ Paste your League of Legends folder location here.                          ¦
  62. ECHO ¦ The default is usually C:\Riot Games\League of Legends                      ¦
  63. ECHO +-----------------------------------------------------------------------------¦
  64. ECHO ¦ INSTRUCTIONS                                                                ¦
  65. ECHO ¦ 1^) Locate the folder that contains the file lol.launcher.exe.               ¦
  66. ECHO ¦ 2^) Copy the full path ^(with CTRL+C or right click, copy^).                   ¦
  67. ECHO ¦ 3^) Right-click this window and click "Paste", then press Enter / Return.    ¦
  68. ECHO +-----------------------------------------------------------------------------+
  69.  
  70. :QUESTION
  71. ECHO.
  72. SET /p target=^>
  73. ECHO !target!>unlocker.ini
  74. GOTO CHECKSET
  75.  
  76. :LOAD
  77. SET /p target=<unlocker.ini
  78. IF NOT EXIST "!target!\lol.launcher.exe" (
  79.     ECHO +-----------------------------------------------------------------------------+
  80.     ECHO &#166; Could not find League of Legends at the saved location.                     &#166;
  81.     ECHO +-----------------------------------------------------------------------------+
  82.     ECHO.
  83.     ECHO       ^(!target!^)
  84.     ECHO       is not a valid location.
  85.     ECHO.
  86.     ECHO +-----------------------------------------------------------------------------+
  87.     ECHO &#166; Paste your League of Legends folder location here.                          &#166;
  88.     ECHO &#166; The default is usually C:\Riot Games\League of Legends                      &#166;
  89.     ECHO +-----------------------------------------------------------------------------&#166;
  90.     ECHO &#166; INSTRUCTIONS:                                                               &#166;
  91.     ECHO &#166; 1^) Locate the folder that contains the file lol.launcher.exe.               &#166;
  92.     ECHO &#166; 2^) Copy the full path ^(with CTRL+C or right click, copy^).                   &#166;
  93.     ECHO &#166; 3^) Right-click this window and click "Paste", then press Enter / Return.    &#166;
  94.     ECHO +-----------------------------------------------------------------------------+
  95. )
  96. IF NOT EXIST "!target!\lol.launcher.exe" GOTO QUESTION
  97.  
  98. :: This string determines what languages you want to use.
  99. :: cs_CZ Czech          de_DE German
  100. :: el_GR Greek          en_AU English AU
  101. :: en_GB English UK     en_US English US
  102. :: es_AR Spanish AR     es_ES Spanish ES
  103. :: es_MX Spanish MX     fr_FR French
  104. :: hu_HU Hungarian      it_IT Italian
  105. :: ko_KR Korean         pl_PL Polish
  106. :: pt_BR Portuguese BR  ro_RO Romanian
  107. :: ru_RU Russian        tr_TR Turkish
  108.  
  109. :: The string must always end in , A
  110. :: Every pipe character that's used in this string must be escaped.
  111. SET lollanguages=cs_CZ^|de_DE^|el_GR^|en_AU^|en_GB^|en_US^|es_AR^|es_ES^|es_MX^|fr_FR^|hu_HU^|it_IT^|ko_KR^|pl_PL^|pt_BR^|ro_RO^|ru_RU^|tr_TR, A
  112. SET regionfile=RADS\projects\lol_patcher\managedfiles\0.0.0.0\regions.txt
  113. SET regionbackup=RADS\projects\lol_patcher\managedfiles\0.0.0.0\regions-backup.txt
  114.  
  115. :: We must set the regions.txt to not be read-only.
  116. :: We set the file to read-only so that, in the event you forget to run this when
  117. :: you update League of Legends, you should still be able to play in the language
  118. :: you want.
  119. ATTRIB -R "!target!\!regionfile!"
  120.  
  121. :: Let's back up the old regions.txt.
  122. :: This will only happen if regions-backup.txt doesn't already exist.
  123. :: Idea by /u/Nominance
  124. ECHO +-----------------------------------------------------------------------------+
  125. ECHO &#166; Backing up regions.txt...                                                   &#166;
  126. IF NOT EXIST "!target!\!regionbackup!" COPY /Y "!target!\!regionfile!" "!target!\!regionbackup!"
  127.  
  128. :: We delete the old regions.txt as we will be writing a new one from scratch.
  129. ECHO &#166; Deleting old regions.txt file...                                            &#166;
  130. DEL /Q "!target!\!regionfile!"
  131.  
  132. :: The following commands write a brand new regions.txt file with all languages
  133. :: enabled from all available regions.
  134. ECHO &#166; Writing new regions.txt file with all languages enabled...                  &#166;
  135. ECHO na,            na,            !lollanguages! > "!target!\!regionfile!"
  136. ECHO br,            br,            !lollanguages! >> "!target!\!regionfile!"
  137. ECHO tr,            tr,            !lollanguages! >> "!target!\!regionfile!"
  138. ECHO euw,           euw,           !lollanguages! >> "!target!\!regionfile!"
  139. ECHO eune,          eune,          !lollanguages! >> "!target!\!regionfile!"
  140. ECHO ru,            ru,            !lollanguages! >> "!target!\!regionfile!"
  141. ECHO la1,           la1,           !lollanguages! >> "!target!\!regionfile!"
  142. ECHO la2,           la2,           !lollanguages! >> "!target!\!regionfile!"
  143. ECHO oc1,           oc1,           !lollanguages! >> "!target!\!regionfile!"
  144. ECHO &#166; Write complete.                                                             &#166;
  145.  
  146. :: We set the new regions.txt as read-only.
  147. ECHO +-----------------------------------------------------------------------------+
  148. ATTRIB +R "!target!\!regionfile!"
  149.  
  150. :: The below shows you what languages are installed.
  151. :: Some of the languages just show like an "empty" row in the language/region
  152. :: selection. When you run this script, the following will tell you what those
  153. :: languages are. There's also multiple entries for English and Spanish, so you
  154. :: can also know which of the varieties of languages you're using.
  155. CLS
  156. ECHO +-----------------------------------------------------------------------------+
  157. ECHO &#166;                   League of Legends Language Unlocker %lusver%                    &#166;
  158. ECHO +-----------------------------------------------------------------------------+
  159. ECHO +-----------------------------------------------------------------------------+
  160. ECHO &#166; LANGUAGES                                                                   &#166;
  161. ECHO +-----------------------------------------------------------------------------&#166;
  162. ECHO &#166; Czech, German, Greek, English (AU), English (UK), English (NA),             &#166;
  163. ECHO &#166; Spanish (AR), Spanish (ES), Spanish (MX), French, Hungarian, Italian,       &#166;
  164. ECHO &#166; Korean, Polish, Portuguese (BR), Romanian, Russian, Turkish                 &#166;
  165. ECHO +-----------------------------------------------------------------------------+
  166. ECHO.
  167.  
  168. :: The following starts League of Legends and pauses this screen so that you can
  169. :: view the list of languages, in case you need to.
  170. ECHO +-----------------------------------------------------------------------------+
  171. ECHO &#166; Starting League of Legends...                                               &#166;
  172. ECHO +-----------------------------------------------------------------------------+
  173. START /D"!target!\" lol.launcher.exe
  174. ECHO.
  175. ECHO.
  176. ECHO.
  177. ECHO (You can press any key to close this window.)
  178. PAUSE > NUL