Advertisement
Baoulettes

Lineage II Old skool launcher (just a backup unrelease)

Oct 15th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance force
  2. #Include %A_ScriptDir%\HttpQueryInfo.ahk
  3.  
  4. ; Application type and code started :
  5. ; 15th October 2014 by Baoulettes aka Joffrey Panisset
  6. ; Joffrey.panisset@hotmail.com
  7. ; Unauthorized use is forbidden.
  8. ; Lib used that isn't writen by remain to author and Authorization pending.
  9.  
  10. ; Gamemode Game <-> Dev console will be writen in Option.ini. No need to provide it in "L2OSCheckFileList.ini"
  11. ; Options modifier Is there to produce same effect than In game just with few little tweak:
  12. ; Change Fullscreen mode, Play on server or Dev console to discover Items, Map.
  13.  
  14. ; I suggest to Manualy update "L2OSConfig.ini"
  15. ; And put it in the Launcher file check ini.
  16. ; And so it will be better to see both version and that easier to manage.
  17. ; Also "L2OSServer.ini" and "L2OSConfig.ini" is the same files only name change.
  18.  
  19. ; In case of Launcher update it can happen, check Global variables to change Version.
  20. ; AppAuthor is there only as copyright things and it never seen on the application itself.
  21.  
  22. ; The source of code is provided to show I do but it can be used for learning process.
  23. ; A pure copy paste of the code isn't a learning process that is why I comment all part I could to explain how this work and help you later.
  24. ; Running this software as it will be useless for you but it can be modified to work on ANY game system or update system without requiring FTP access.
  25. ; So in case of hack/flaw in the code all your credencial are safe as it require NONE! :)
  26. ; Security first.
  27.  
  28. ; Global variable set :
  29. Appname = Lineage ][ OS Launcher
  30. Appversion = 0.0.0b
  31. AppAuthor = Baoulettes
  32. CurrentStatut = Client Ready to play
  33. ServerRoot = http://baoulettesgalerie.site11.com
  34. ServerFileCheckVersion = http://baoulettesgalerie.site11.com/L2OSServer.ini
  35. Changelogsfiles = http://baoulettesgalerie.site11.com/L2OSlastlogs.ini
  36. Checkfilelist = http://baoulettesgalerie.site11.com/L2OSCheckFileList.ini
  37.  
  38. ; Function to force player to select Lineage II Directory if that a first launch or if install conrupted.
  39. IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  40. If L2OSDIR = ERROR
  41. {
  42.         FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
  43.         IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
  44.         IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  45.         GuiControl,, L2OSdirtext, %L2OSDIR%.
  46.         Loop {
  47.             If L2OSDIR =
  48.             {  
  49.                 FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
  50.                 IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
  51.                 IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  52.                 GuiControl,, L2OSdirtext, %L2OSDIR%.
  53.             } else {
  54.                 IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  55.                 break
  56.             }
  57.         }
  58. } else {
  59.        IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  60. }
  61. If L2OSDIR =
  62. {
  63.         FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
  64.         IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
  65.         IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  66.         GuiControl,, L2OSdirtext, %L2OSDIR%.
  67.         Loop {
  68.             If L2OSDIR =
  69.             {  
  70.                 FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
  71.                 IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
  72.                 IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  73.                 GuiControl,, L2OSdirtext, %L2OSDIR%.
  74.             } else {
  75.                 IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  76.                 break
  77.             }
  78.         }
  79. } else {
  80.        IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
  81. }
  82. ; Download require files :
  83. UrlDownloadToFile, %ServerFileCheckVersion%, %L2OSDIR%\L2OSServer.ini
  84. UrlDownloadToFile, %Changelogsfiles%, %L2OSDIR%\L2OSlastlogs.ini
  85.  
  86. ; Initial read to provide importante information.
  87. IniRead, Serverversion, %L2OSDIR%\L2OSServer.ini, GameVersion, Version
  88.  
  89. ; If initial read failed due to network error or Server error throw an Error message to informe the user.
  90. If Serverversion = ERROR
  91. {
  92.     ; We set a variable that will be used by the Gui to show the user about the error.
  93.     Serverversion = /!\ No Network connection /!\
  94.     MsgBox We cannot check the server required game version.`nBe sure to be connected to internet.`nAlso be sure to run this application in Admin rights and check Firewall/Anti-virus exception.
  95. }
  96. else
  97. {
  98.     ; If all goes fine show the download server required game version.
  99.     Serverversion = %Serverversion%
  100.    
  101.     ; Delete the files used to know server requirement.
  102.     FileDelete, %L2OSDIR%\L2OSServer.ini
  103. }
  104.  
  105. ; Read local game version from files.
  106. IniRead, Gameversion, %L2OSDIR%\L2OSConfig.ini, GameVersion, Version
  107.  
  108. ; If the game show no version throw an error and assume it to be in "1.0.0" and force the player to update.
  109. If Gameversion = ERROR
  110. {
  111.     ; Force game to be in version 1.0.0 and create file version for it.
  112.     IniWrite, 1.0.0, %L2OSDIR%\L2OSConfig.ini, GameVersion, Version
  113.    
  114.     ; Re-read the file to refresh variable.
  115.     IniRead, Gameversion, %L2OSDIR%\L2OSConfig.ini, GameVersion, Version
  116.    
  117.     ; Put variable to show in gui later to the user that he/she have to update!
  118.     CurrentStatut = Client NOT Ready to play, Please check files !
  119.    
  120.     ; Force diable button play (it will be unable if the user update the game.)
  121.     GuiControl, disable, btnPlay
  122. }
  123. else
  124. {
  125.     ; If all goes fine then show in gui the current game version.
  126.     Gameversion = %Gameversion%
  127. }
  128.  
  129. ;File read to get the change logs !
  130. FileRead, L2OSChangelogs, %L2OSDIR%\L2OSlastlogs.ini
  131.  
  132. ; If change log file happen to be missing on server throw an error to informe the user.
  133. If L2OSChangelogs = ERROR
  134. {
  135.     L2OSChangelogs = /!\ No Network connection /!\
  136.     MsgBox We cannot check the server required Change logs.`nBe sure to be connected to internet.`nAlso be sure to run this application in Admin rights and check Firewall/Anti-virus exception.
  137. }
  138. else
  139. {
  140.     ; If all goes fines delete the changelog temporary files and place the text in the placeholder
  141.     L2OSChangelogs = %L2OSChangelogs%
  142.     FileDelete, %L2OSDIR%\L2OSlastlogs.ini
  143. }
  144.  
  145.  
  146.  
  147. ; Gui Creation.
  148. ; Logo placeholder creation
  149. Gui, Add, Picture, x11 y7 w460 h90 , C:\Users\Baoulettes\Desktop\todo.png
  150.  
  151. ; Game & Server game required version text place holder
  152. Gui, Add, Text, x11 y107 w140 h20 , Game version : %Gameversion%
  153. Gui, Add, Text, x161 y107 w320 h20 , Server Game version : %Serverversion%
  154.  
  155. ; Progress & Launcher status
  156. Gui, Add, Text, vDllFiles x11 y257 w350 h20 , %CurrentStatut%
  157.  
  158. ; Progress Bars creation.
  159. Gui, Add, Progress, x11 y287 w350 h20 , 25
  160. Gui, Add, Progress, x11 y317 w350 h20 , 25
  161.  
  162. ; Buttons Creation
  163. Gui, Add, Button, vbtnPlay x371 y327 w100 h30 , Play
  164. Gui, Add, Button, vbtnUpdate gcheckfiles x371 y287 w100 h30 , Check Files
  165. Gui, Add, Button, vbtnOptions gbtnoption x371 y247 w100 h30 , Options
  166.  
  167. ; Change Log place holder
  168. Gui, Add, Text, x11 y127 w460 h120 , %L2OSChangelogs%
  169.  
  170. ; Copyright in the button of the launcher %Appname% is a variable see the header.
  171. Gui, Add, Text, x11 y347 w350 h20 , %Appname% - %Appversion%
  172.  
  173. ; Show the current created Gui.
  174. Gui, Show, x203 y214 h379 w485, %Appname% - %Appversion%
  175. Return
  176.  
  177. ; Global action used for the button "checkfiles"
  178. checkfiles:
  179.  
  180. ; Disabling Button play, Option, Check Files
  181. GuiControl, disable, btnPlay
  182. GuiControl, disable, btnOptions
  183. GuiControl, disable, btnUpdate
  184.  
  185. ; Download list of the files to check (see header for url.)
  186. UrlDownloadToFile, %Checkfilelist%, %L2OSDIR%\L2OSCheckFileList.ini
  187.  
  188. ; Loop read the files per line !
  189. Loop, read, %L2OSDIR%\L2OSCheckFileList.ini
  190. {
  191. ; Simple Variable to form the url used later.
  192. url = %ServerRoot%/%A_LoopReadLine%
  193.  
  194. ; Call Function "HttpQueryInfo" with variable url and param 5 (file size)
  195. Version1 :=HttpQueryInfo(url, 5)
  196.  
  197. ; Check local files size.
  198. FileGetSize, Version2, %A_LoopReadLine%
  199.  
  200. ; If local files size is Zero Or negative for it to be 0
  201. If Version2 =
  202. {
  203.  
  204. ; Here is where it for it to be "Zero"
  205. Version2 = 0
  206. }
  207.  
  208. ; check if both files size is the same
  209. If (%Version2%=%Version1%)
  210. {
  211.  
  212. ; If is is the same then download nothing just update the gui to show "Skipping - FILENAME.EXT"
  213. GuiControl,,DllFiles,Skipping - %A_LoopReadLine%
  214. }
  215. Else
  216. {
  217.  
  218. ; Used to form the url used later
  219. url3 = %ServerRoot%/%A_LoopReadLine%
  220.  
  221. ; Download files in "url3" variable and put it in the same folder as the launcher.
  222. UrlDownloadToFile, %url3%, %L2OSDIR%\%A_LoopReadLine%
  223.  
  224. ; Update gui to show "Downloading - FILENAME.EXT"
  225. GuiControl,,DllFiles,Downloading - %A_LoopReadLine%
  226. }
  227. }
  228.  
  229. ; Delete the file download in the begining to check the list of files to be checked.
  230. FileDelete, %L2OSDIR%\L2OSCheckFileList.ini
  231.  
  232. ; Update gui to show "Client Ready to play" (Variable set in header!)
  233. GuiControl,,DllFiles,%CurrentStatut%
  234.  
  235. ; Re-enable buttons !
  236. GuiControl, Enable, btnPlay
  237. GuiControl, Enable, btnOptions
  238. GuiControl, Enable, btnUpdate
  239. Return
  240.  
  241. ; Function used to create gui the same way as we did for main gui but on 2 process (internal process not multiple ".exe")
  242. btnoption:
  243. ; Reading LineageII Options.ini properties in the order it show on the window !
  244.  
  245. ; Get info Tab "Video"
  246. IniRead, StartupFullScreen, %L2OSDIR%\System\Option.ini, Video, StartupFullScreen
  247. IniRead, RefreshRate, %L2OSDIR%\System\Option.ini, Video, RefreshRate
  248. IniRead, ColorBits, %L2OSDIR%\System\Option.ini, Video, ColorBits
  249. IniRead, TextureDetail, %L2OSDIR%\System\Option.ini, Video, TextureDetail
  250. IniRead, ModelDetail, %L2OSDIR%\System\Option.ini, Video, ModelDetail
  251. IniRead, SkipAnim, %L2OSDIR%\System\Option.ini, Video, SkipAnim
  252.  
  253. IniRead, PawnShadow, %L2OSDIR%\System\Option.ini, Video, PawnShadow
  254. IniRead, RenderDeco, %L2OSDIR%\System\Option.ini, Video, RenderDeco
  255.  
  256. IniRead, Terrain, %L2OSDIR%\System\Option.ini, ClippingRange, Terrain
  257. IniRead, Actor, %L2OSDIR%\System\Option.ini, Video, Actor
  258. IniRead, RenderActorLimited, %L2OSDIR%\System\Option.ini, Video, RenderActorLimited
  259. IniRead, IsUseEffect, %L2OSDIR%\System\Option.ini, L2WaterEffect, IsUseEffect
  260. IniRead, AntiAliasing, %L2OSDIR%\System\Option.ini, Video, AntiAliasing
  261.  
  262. IniRead, Glow, %L2OSDIR%\System\Option.ini, Video, Glow
  263. IniRead, UseTrilinear, %L2OSDIR%\System\Option.ini, Video, UseTrilinear
  264. IniRead, UseColorCursor, %L2OSDIR%\System\Option.ini, Video, UseColorCursor
  265.  
  266. ; Get info Tab "Audio"
  267. IniRead, SoundVolume, %L2OSDIR%\System\Option.ini, Audio, SoundVolume
  268. IniRead, MusicVolume, %L2OSDIR%\System\Option.ini, Audio, MusicVolume
  269. IniRead, WavVoiceVolume, %L2OSDIR%\System\Option.ini, Audio, WavVoiceVolume
  270. IniRead, OggVoiceVolume, %L2OSDIR%\System\Option.ini, Audio, OggVoiceVolume
  271.  
  272. ; Get info Tab "Game"
  273. IniRead, TransparencyMode, %L2OSDIR%\System\Option.ini, Game, TransparencyMode
  274.  
  275. IniRead, GameMode, %L2OSDIR%\System\Option.ini, Game, GameMode
  276.  
  277. IniRead, MyName, %L2OSDIR%\System\Option.ini, Game, MyName
  278. IniRead, NPCName, %L2OSDIR%\System\Option.ini, Game, NPCName
  279. IniRead, GroupName, %L2OSDIR%\System\Option.ini, Game, GroupName
  280. IniRead, PledgeMemberName, %L2OSDIR%\System\Option.ini, Game, PledgeMemberName
  281. IniRead, PartyMemberName, %L2OSDIR%\System\Option.ini, Game, PartyMemberName
  282. IniRead, OtherPCName, %L2OSDIR%\System\Option.ini, Game, OtherPCName
  283.  
  284. IniRead, EnterChatting, %L2OSDIR%\System\Option.ini, Game, EnterChatting
  285. IniRead, AutoTrackingPawn, %L2OSDIR%\System\Option.ini, Game, AutoTrackingPawn
  286. IniRead, OldChatting, %L2OSDIR%\System\Option.ini, Game, OldChatting
  287. IniRead, IsNative, %L2OSDIR%\System\Option.ini, Game, IsNative
  288. IniRead, ArrowMode, %L2OSDIR%\System\Option.ini, Game, ArrowMode
  289. IniRead, UseJoystick, %L2OSDIR%\System\Option.ini, Game, UseJoystick
  290.  
  291. IniRead, ScreenShotQuality, %L2OSDIR%\System\Option.ini, Game, ScreenShotQuality
  292.  
  293. IniRead, PartyLooting, %L2OSDIR%\System\Option.ini, Game, PartyLooting
  294.  
  295. ; Next read -> Variables -> Variables -> UI System
  296. ; Need Variable Load so no more working since there!
  297.  
  298. Gui, 2:Add, Button, x11 y477 w70 h20 , Default
  299. Gui, 2:Add, Button, x91 y477 w70 h20 , Cancel
  300. Gui, 2:Add, Button, x171 y477 w70 h20 , Apply
  301. Gui, 2:Add, Tab, x0 y0 w2410 h770 , Video|Audio|Game
  302.  
  303. Gui, 2:Tab, 1
  304. Gui, 2:Add, GroupBox, x5 y15 w250 h205 ,
  305. Gui, 2:Add, GroupBox, x5 y210 w250 h45 ,
  306. Gui, 2:Add, GroupBox, x5 y245 w250 h165 ,
  307. Gui, 2:Add, GroupBox, x5 y400 w250 h70 ,
  308. Gui, 2:Add, DropDownList, x131 y37 w110 h20 , DropDownList
  309. Gui, 2:Add, DropDownList, x131 y67 w110 h24 , DropDownList
  310. Gui, 2:Add, DropDownList, x131 y97 w110 h24 , DropDownList
  311. Gui, 2:Add, DropDownList, x131 y127 w110 h24 , DropDownList
  312. Gui, 2:Add, DropDownList, x131 y157 w110 h24 , DropDownList
  313. Gui, 2:Add, DropDownList, x131 y187 w110 h24 , DropDownList
  314. Gui, 2:Add, CheckBox, x21 y227 w100 h20 , Shadows
  315. Gui, 2:Add, CheckBox, x131 y227 w110 h20 , Ground Detail
  316. Gui, 2:Add, DropDownList, x131 y257 w110 h24 , DropDownList
  317. Gui, 2:Add, DropDownList, x131 y287 w110 h24 , DropDownList
  318. Gui, 2:Add, DropDownList, x131 y317 w110 h24 , DropDownList
  319. Gui, 2:Add, DropDownList, x131 y347 w110 h24 , DropDownList
  320. Gui, 2:Add, DropDownList, x131 y377 w110 h24 , DropDownList
  321. Gui, 2:Add, Text, x11 y37 w100 h30 , FullScreen
  322. Gui, 2:Add, Text, x11 y67 w100 h30 , Refresh Rate
  323. Gui, 2:Add, Text, x11 y97 w100 h30 , Gamma
  324. Gui, 2:Add, Text, x11 y127 w100 h30 , Textures
  325. Gui, 2:Add, Text, x11 y157 w100 h30 , Modeling Detail
  326. Gui, 2:Add, Text, x11 y187 w100 h30 , Motion Detail
  327. Gui, 2:Add, Text, x11 y257 w100 h30 , Terrain Range
  328. Gui, 2:Add, Text, x11 y287 w100 h30 , PC/NPC Range
  329. Gui, 2:Add, Text, x11 y317 w100 h30 , PC/NPC Limit
  330. Gui, 2:Add, Text, x11 y347 w100 h30 , Reflection
  331. Gui, 2:Add, Text, x11 y377 w100 h30 , Anti-Aliasing
  332. Gui, 2:Add, CheckBox, x21 y417 w100 h20 , Glow Effect
  333. Gui, 2:Add, CheckBox, x131 y417 w100 h20 , Texture Filter
  334. Gui, 2:Add, CheckBox, x131 y447 w100 h20 , Low detail
  335. Gui, 2:Add, CheckBox, x21 y447 w100 h20 , Game Cursor
  336.  
  337. Gui, 2:Tab, 2
  338. Gui, 2:Add, GroupBox, x5 y37 w250 h150 ,
  339. Gui, 2:Add, DropDownList, x131 y57 w100 h20 , DropDownList
  340. Gui, 2:Add, DropDownList, x131 y87 w100 h24 , DropDownList
  341. Gui, 2:Add, DropDownList, x131 y117 w100 h24 , DropDownList
  342. Gui, 2:Add, DropDownList, x131 y147 w100 h24 , DropDownList
  343. Gui, 2:Add, Text, x21 y57 w100 h30 , SFX Vol.
  344. Gui, 2:Add, Text, x21 y87 w100 h30 , Music Vol.
  345. Gui, 2:Add, Text, x21 y117 w100 h30 , System Voice
  346. Gui, 2:Add, Text, x21 y147 w100 h30 , Tutorial Voice
  347.  
  348. Gui, 2:Tab, 3
  349. Gui, 2:Add, GroupBox, x5 y35 w250 h40 ,
  350. Gui, 2:Add, GroupBox, x5 y75 w250 h40 ,
  351. Gui, 2:Add, GroupBox, x5 y115 w250 h130 ,
  352. Gui, 2:Add, GroupBox, x5 y245 w250 h110 ,
  353. Gui, 2:Add, GroupBox, x5 y355 w250 h50 ,
  354. Gui, 2:Add, Text, x11 y47 w80 h20 , Interface
  355. Gui, 2:Add, Button, x91 y47 w60 h20 , Initialize
  356. Gui, 2:Add, CheckBox, x155 y47 w95 h20 , Transparent
  357. Gui, 2:Add, Text, x11 y87 w80 h20 , Gamemode
  358. Gui, 2:Add, DropDownList, x91 y87 w160 h20 , DropDownList
  359. Gui, 2:Add, Text, x11 y117 w80 h30 , Display
  360. Gui, 2:Add, CheckBox, x91 y117 w90 h20 , Players
  361. Gui, 2:Add, CheckBox, x91 y137 w90 h20 , Monsters
  362. Gui, 2:Add, CheckBox, x91 y157 w90 h20 , Other PCs
  363. Gui, 2:Add, CheckBox, x101 y177 w90 h20 , Clan
  364. Gui, 2:Add, CheckBox, x101 y197 w90 h20 , Party
  365. Gui, 2:Add, CheckBox, x101 y217 w90 h20 , General
  366. Gui, 2:Add, CheckBox, x11 y257 w120 h20 , Enter Chat
  367. Gui, 2:Add, CheckBox, x11 y277 w120 h20 , Auto Code
  368. Gui, 2:Add, CheckBox, x11 y297 w120 h20 , 3D Arrow
  369. Gui, 2:Add, CheckBox, x141 y257 w110 h20 , Tracking
  370. Gui, 2:Add, CheckBox, x141 y277 w110 h20 , Key Security
  371. Gui, 2:Add, CheckBox, x141 y297 w110 h20 , Game Pad
  372. Gui, 2:Add, Text, x11 y327 w80 h20 , Screenshot
  373. Gui, 2:Add, DropDownList, x91 y327 w160 h20 , DropDownList
  374. Gui, 2:Add, Text, x11 y367 w80 h20 , Party Loot
  375. Gui, 2:Add, DropDownList, x91 y367 w160 h24 , DropDownList
  376. Gui, 2:Show, x591 y216 h508 w263, Options
  377. Return
  378.  
  379.  
  380. ; If the app is closed totaly close the process! & delete unused files. (prevent to be a mess!)
  381. GuiClose:
  382. FileDelete, %L2OSDIR%\L2OSlastlogs.ini
  383. FileDelete, %L2OSDIR%\L2OSCheckFileList.ini
  384. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement