Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance force
- #Include %A_ScriptDir%\HttpQueryInfo.ahk
- ; Application type and code started :
- ; 15th October 2014 by Baoulettes aka Joffrey Panisset
- ; Joffrey.panisset@hotmail.com
- ; Unauthorized use is forbidden.
- ; Lib used that isn't writen by remain to author and Authorization pending.
- ; Gamemode Game <-> Dev console will be writen in Option.ini. No need to provide it in "L2OSCheckFileList.ini"
- ; Options modifier Is there to produce same effect than In game just with few little tweak:
- ; Change Fullscreen mode, Play on server or Dev console to discover Items, Map.
- ; I suggest to Manualy update "L2OSConfig.ini"
- ; And put it in the Launcher file check ini.
- ; And so it will be better to see both version and that easier to manage.
- ; Also "L2OSServer.ini" and "L2OSConfig.ini" is the same files only name change.
- ; In case of Launcher update it can happen, check Global variables to change Version.
- ; AppAuthor is there only as copyright things and it never seen on the application itself.
- ; The source of code is provided to show I do but it can be used for learning process.
- ; 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.
- ; 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.
- ; So in case of hack/flaw in the code all your credencial are safe as it require NONE! :)
- ; Security first.
- ; Global variable set :
- Appname = Lineage ][ OS Launcher
- Appversion = 0.0.0b
- AppAuthor = Baoulettes
- CurrentStatut = Client Ready to play
- ServerRoot = http://baoulettesgalerie.site11.com
- ServerFileCheckVersion = http://baoulettesgalerie.site11.com/L2OSServer.ini
- Changelogsfiles = http://baoulettesgalerie.site11.com/L2OSlastlogs.ini
- Checkfilelist = http://baoulettesgalerie.site11.com/L2OSCheckFileList.ini
- ; Function to force player to select Lineage II Directory if that a first launch or if install conrupted.
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- If L2OSDIR = ERROR
- {
- FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
- IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- GuiControl,, L2OSdirtext, %L2OSDIR%.
- Loop {
- If L2OSDIR =
- {
- FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
- IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- GuiControl,, L2OSdirtext, %L2OSDIR%.
- } else {
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- break
- }
- }
- } else {
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- }
- If L2OSDIR =
- {
- FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
- IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- GuiControl,, L2OSdirtext, %L2OSDIR%.
- Loop {
- If L2OSDIR =
- {
- FileSelectFolder, L2OSDIR,, 3, Select Lineage II Folder
- IniWrite, %L2OSDIR%, L2OSConfig.ini, GameDirectory, Loc
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- GuiControl,, L2OSdirtext, %L2OSDIR%.
- } else {
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- break
- }
- }
- } else {
- IniRead, L2OSDIR, L2OSConfig.ini, GameDirectory, Loc
- }
- ; Download require files :
- UrlDownloadToFile, %ServerFileCheckVersion%, %L2OSDIR%\L2OSServer.ini
- UrlDownloadToFile, %Changelogsfiles%, %L2OSDIR%\L2OSlastlogs.ini
- ; Initial read to provide importante information.
- IniRead, Serverversion, %L2OSDIR%\L2OSServer.ini, GameVersion, Version
- ; If initial read failed due to network error or Server error throw an Error message to informe the user.
- If Serverversion = ERROR
- {
- ; We set a variable that will be used by the Gui to show the user about the error.
- Serverversion = /!\ No Network connection /!\
- 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.
- }
- else
- {
- ; If all goes fine show the download server required game version.
- Serverversion = %Serverversion%
- ; Delete the files used to know server requirement.
- FileDelete, %L2OSDIR%\L2OSServer.ini
- }
- ; Read local game version from files.
- IniRead, Gameversion, %L2OSDIR%\L2OSConfig.ini, GameVersion, Version
- ; If the game show no version throw an error and assume it to be in "1.0.0" and force the player to update.
- If Gameversion = ERROR
- {
- ; Force game to be in version 1.0.0 and create file version for it.
- IniWrite, 1.0.0, %L2OSDIR%\L2OSConfig.ini, GameVersion, Version
- ; Re-read the file to refresh variable.
- IniRead, Gameversion, %L2OSDIR%\L2OSConfig.ini, GameVersion, Version
- ; Put variable to show in gui later to the user that he/she have to update!
- CurrentStatut = Client NOT Ready to play, Please check files !
- ; Force diable button play (it will be unable if the user update the game.)
- GuiControl, disable, btnPlay
- }
- else
- {
- ; If all goes fine then show in gui the current game version.
- Gameversion = %Gameversion%
- }
- ;File read to get the change logs !
- FileRead, L2OSChangelogs, %L2OSDIR%\L2OSlastlogs.ini
- ; If change log file happen to be missing on server throw an error to informe the user.
- If L2OSChangelogs = ERROR
- {
- L2OSChangelogs = /!\ No Network connection /!\
- 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.
- }
- else
- {
- ; If all goes fines delete the changelog temporary files and place the text in the placeholder
- L2OSChangelogs = %L2OSChangelogs%
- FileDelete, %L2OSDIR%\L2OSlastlogs.ini
- }
- ; Gui Creation.
- ; Logo placeholder creation
- Gui, Add, Picture, x11 y7 w460 h90 , C:\Users\Baoulettes\Desktop\todo.png
- ; Game & Server game required version text place holder
- Gui, Add, Text, x11 y107 w140 h20 , Game version : %Gameversion%
- Gui, Add, Text, x161 y107 w320 h20 , Server Game version : %Serverversion%
- ; Progress & Launcher status
- Gui, Add, Text, vDllFiles x11 y257 w350 h20 , %CurrentStatut%
- ; Progress Bars creation.
- Gui, Add, Progress, x11 y287 w350 h20 , 25
- Gui, Add, Progress, x11 y317 w350 h20 , 25
- ; Buttons Creation
- Gui, Add, Button, vbtnPlay x371 y327 w100 h30 , Play
- Gui, Add, Button, vbtnUpdate gcheckfiles x371 y287 w100 h30 , Check Files
- Gui, Add, Button, vbtnOptions gbtnoption x371 y247 w100 h30 , Options
- ; Change Log place holder
- Gui, Add, Text, x11 y127 w460 h120 , %L2OSChangelogs%
- ; Copyright in the button of the launcher %Appname% is a variable see the header.
- Gui, Add, Text, x11 y347 w350 h20 , %Appname% - %Appversion%
- ; Show the current created Gui.
- Gui, Show, x203 y214 h379 w485, %Appname% - %Appversion%
- Return
- ; Global action used for the button "checkfiles"
- checkfiles:
- ; Disabling Button play, Option, Check Files
- GuiControl, disable, btnPlay
- GuiControl, disable, btnOptions
- GuiControl, disable, btnUpdate
- ; Download list of the files to check (see header for url.)
- UrlDownloadToFile, %Checkfilelist%, %L2OSDIR%\L2OSCheckFileList.ini
- ; Loop read the files per line !
- Loop, read, %L2OSDIR%\L2OSCheckFileList.ini
- {
- ; Simple Variable to form the url used later.
- url = %ServerRoot%/%A_LoopReadLine%
- ; Call Function "HttpQueryInfo" with variable url and param 5 (file size)
- Version1 :=HttpQueryInfo(url, 5)
- ; Check local files size.
- FileGetSize, Version2, %A_LoopReadLine%
- ; If local files size is Zero Or negative for it to be 0
- If Version2 =
- {
- ; Here is where it for it to be "Zero"
- Version2 = 0
- }
- ; check if both files size is the same
- If (%Version2%=%Version1%)
- {
- ; If is is the same then download nothing just update the gui to show "Skipping - FILENAME.EXT"
- GuiControl,,DllFiles,Skipping - %A_LoopReadLine%
- }
- Else
- {
- ; Used to form the url used later
- url3 = %ServerRoot%/%A_LoopReadLine%
- ; Download files in "url3" variable and put it in the same folder as the launcher.
- UrlDownloadToFile, %url3%, %L2OSDIR%\%A_LoopReadLine%
- ; Update gui to show "Downloading - FILENAME.EXT"
- GuiControl,,DllFiles,Downloading - %A_LoopReadLine%
- }
- }
- ; Delete the file download in the begining to check the list of files to be checked.
- FileDelete, %L2OSDIR%\L2OSCheckFileList.ini
- ; Update gui to show "Client Ready to play" (Variable set in header!)
- GuiControl,,DllFiles,%CurrentStatut%
- ; Re-enable buttons !
- GuiControl, Enable, btnPlay
- GuiControl, Enable, btnOptions
- GuiControl, Enable, btnUpdate
- Return
- ; Function used to create gui the same way as we did for main gui but on 2 process (internal process not multiple ".exe")
- btnoption:
- ; Reading LineageII Options.ini properties in the order it show on the window !
- ; Get info Tab "Video"
- IniRead, StartupFullScreen, %L2OSDIR%\System\Option.ini, Video, StartupFullScreen
- IniRead, RefreshRate, %L2OSDIR%\System\Option.ini, Video, RefreshRate
- IniRead, ColorBits, %L2OSDIR%\System\Option.ini, Video, ColorBits
- IniRead, TextureDetail, %L2OSDIR%\System\Option.ini, Video, TextureDetail
- IniRead, ModelDetail, %L2OSDIR%\System\Option.ini, Video, ModelDetail
- IniRead, SkipAnim, %L2OSDIR%\System\Option.ini, Video, SkipAnim
- IniRead, PawnShadow, %L2OSDIR%\System\Option.ini, Video, PawnShadow
- IniRead, RenderDeco, %L2OSDIR%\System\Option.ini, Video, RenderDeco
- IniRead, Terrain, %L2OSDIR%\System\Option.ini, ClippingRange, Terrain
- IniRead, Actor, %L2OSDIR%\System\Option.ini, Video, Actor
- IniRead, RenderActorLimited, %L2OSDIR%\System\Option.ini, Video, RenderActorLimited
- IniRead, IsUseEffect, %L2OSDIR%\System\Option.ini, L2WaterEffect, IsUseEffect
- IniRead, AntiAliasing, %L2OSDIR%\System\Option.ini, Video, AntiAliasing
- IniRead, Glow, %L2OSDIR%\System\Option.ini, Video, Glow
- IniRead, UseTrilinear, %L2OSDIR%\System\Option.ini, Video, UseTrilinear
- IniRead, UseColorCursor, %L2OSDIR%\System\Option.ini, Video, UseColorCursor
- ; Get info Tab "Audio"
- IniRead, SoundVolume, %L2OSDIR%\System\Option.ini, Audio, SoundVolume
- IniRead, MusicVolume, %L2OSDIR%\System\Option.ini, Audio, MusicVolume
- IniRead, WavVoiceVolume, %L2OSDIR%\System\Option.ini, Audio, WavVoiceVolume
- IniRead, OggVoiceVolume, %L2OSDIR%\System\Option.ini, Audio, OggVoiceVolume
- ; Get info Tab "Game"
- IniRead, TransparencyMode, %L2OSDIR%\System\Option.ini, Game, TransparencyMode
- IniRead, GameMode, %L2OSDIR%\System\Option.ini, Game, GameMode
- IniRead, MyName, %L2OSDIR%\System\Option.ini, Game, MyName
- IniRead, NPCName, %L2OSDIR%\System\Option.ini, Game, NPCName
- IniRead, GroupName, %L2OSDIR%\System\Option.ini, Game, GroupName
- IniRead, PledgeMemberName, %L2OSDIR%\System\Option.ini, Game, PledgeMemberName
- IniRead, PartyMemberName, %L2OSDIR%\System\Option.ini, Game, PartyMemberName
- IniRead, OtherPCName, %L2OSDIR%\System\Option.ini, Game, OtherPCName
- IniRead, EnterChatting, %L2OSDIR%\System\Option.ini, Game, EnterChatting
- IniRead, AutoTrackingPawn, %L2OSDIR%\System\Option.ini, Game, AutoTrackingPawn
- IniRead, OldChatting, %L2OSDIR%\System\Option.ini, Game, OldChatting
- IniRead, IsNative, %L2OSDIR%\System\Option.ini, Game, IsNative
- IniRead, ArrowMode, %L2OSDIR%\System\Option.ini, Game, ArrowMode
- IniRead, UseJoystick, %L2OSDIR%\System\Option.ini, Game, UseJoystick
- IniRead, ScreenShotQuality, %L2OSDIR%\System\Option.ini, Game, ScreenShotQuality
- IniRead, PartyLooting, %L2OSDIR%\System\Option.ini, Game, PartyLooting
- ; Next read -> Variables -> Variables -> UI System
- ; Need Variable Load so no more working since there!
- Gui, 2:Add, Button, x11 y477 w70 h20 , Default
- Gui, 2:Add, Button, x91 y477 w70 h20 , Cancel
- Gui, 2:Add, Button, x171 y477 w70 h20 , Apply
- Gui, 2:Add, Tab, x0 y0 w2410 h770 , Video|Audio|Game
- Gui, 2:Tab, 1
- Gui, 2:Add, GroupBox, x5 y15 w250 h205 ,
- Gui, 2:Add, GroupBox, x5 y210 w250 h45 ,
- Gui, 2:Add, GroupBox, x5 y245 w250 h165 ,
- Gui, 2:Add, GroupBox, x5 y400 w250 h70 ,
- Gui, 2:Add, DropDownList, x131 y37 w110 h20 , DropDownList
- Gui, 2:Add, DropDownList, x131 y67 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y97 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y127 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y157 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y187 w110 h24 , DropDownList
- Gui, 2:Add, CheckBox, x21 y227 w100 h20 , Shadows
- Gui, 2:Add, CheckBox, x131 y227 w110 h20 , Ground Detail
- Gui, 2:Add, DropDownList, x131 y257 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y287 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y317 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y347 w110 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y377 w110 h24 , DropDownList
- Gui, 2:Add, Text, x11 y37 w100 h30 , FullScreen
- Gui, 2:Add, Text, x11 y67 w100 h30 , Refresh Rate
- Gui, 2:Add, Text, x11 y97 w100 h30 , Gamma
- Gui, 2:Add, Text, x11 y127 w100 h30 , Textures
- Gui, 2:Add, Text, x11 y157 w100 h30 , Modeling Detail
- Gui, 2:Add, Text, x11 y187 w100 h30 , Motion Detail
- Gui, 2:Add, Text, x11 y257 w100 h30 , Terrain Range
- Gui, 2:Add, Text, x11 y287 w100 h30 , PC/NPC Range
- Gui, 2:Add, Text, x11 y317 w100 h30 , PC/NPC Limit
- Gui, 2:Add, Text, x11 y347 w100 h30 , Reflection
- Gui, 2:Add, Text, x11 y377 w100 h30 , Anti-Aliasing
- Gui, 2:Add, CheckBox, x21 y417 w100 h20 , Glow Effect
- Gui, 2:Add, CheckBox, x131 y417 w100 h20 , Texture Filter
- Gui, 2:Add, CheckBox, x131 y447 w100 h20 , Low detail
- Gui, 2:Add, CheckBox, x21 y447 w100 h20 , Game Cursor
- Gui, 2:Tab, 2
- Gui, 2:Add, GroupBox, x5 y37 w250 h150 ,
- Gui, 2:Add, DropDownList, x131 y57 w100 h20 , DropDownList
- Gui, 2:Add, DropDownList, x131 y87 w100 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y117 w100 h24 , DropDownList
- Gui, 2:Add, DropDownList, x131 y147 w100 h24 , DropDownList
- Gui, 2:Add, Text, x21 y57 w100 h30 , SFX Vol.
- Gui, 2:Add, Text, x21 y87 w100 h30 , Music Vol.
- Gui, 2:Add, Text, x21 y117 w100 h30 , System Voice
- Gui, 2:Add, Text, x21 y147 w100 h30 , Tutorial Voice
- Gui, 2:Tab, 3
- Gui, 2:Add, GroupBox, x5 y35 w250 h40 ,
- Gui, 2:Add, GroupBox, x5 y75 w250 h40 ,
- Gui, 2:Add, GroupBox, x5 y115 w250 h130 ,
- Gui, 2:Add, GroupBox, x5 y245 w250 h110 ,
- Gui, 2:Add, GroupBox, x5 y355 w250 h50 ,
- Gui, 2:Add, Text, x11 y47 w80 h20 , Interface
- Gui, 2:Add, Button, x91 y47 w60 h20 , Initialize
- Gui, 2:Add, CheckBox, x155 y47 w95 h20 , Transparent
- Gui, 2:Add, Text, x11 y87 w80 h20 , Gamemode
- Gui, 2:Add, DropDownList, x91 y87 w160 h20 , DropDownList
- Gui, 2:Add, Text, x11 y117 w80 h30 , Display
- Gui, 2:Add, CheckBox, x91 y117 w90 h20 , Players
- Gui, 2:Add, CheckBox, x91 y137 w90 h20 , Monsters
- Gui, 2:Add, CheckBox, x91 y157 w90 h20 , Other PCs
- Gui, 2:Add, CheckBox, x101 y177 w90 h20 , Clan
- Gui, 2:Add, CheckBox, x101 y197 w90 h20 , Party
- Gui, 2:Add, CheckBox, x101 y217 w90 h20 , General
- Gui, 2:Add, CheckBox, x11 y257 w120 h20 , Enter Chat
- Gui, 2:Add, CheckBox, x11 y277 w120 h20 , Auto Code
- Gui, 2:Add, CheckBox, x11 y297 w120 h20 , 3D Arrow
- Gui, 2:Add, CheckBox, x141 y257 w110 h20 , Tracking
- Gui, 2:Add, CheckBox, x141 y277 w110 h20 , Key Security
- Gui, 2:Add, CheckBox, x141 y297 w110 h20 , Game Pad
- Gui, 2:Add, Text, x11 y327 w80 h20 , Screenshot
- Gui, 2:Add, DropDownList, x91 y327 w160 h20 , DropDownList
- Gui, 2:Add, Text, x11 y367 w80 h20 , Party Loot
- Gui, 2:Add, DropDownList, x91 y367 w160 h24 , DropDownList
- Gui, 2:Show, x591 y216 h508 w263, Options
- Return
- ; If the app is closed totaly close the process! & delete unused files. (prevent to be a mess!)
- GuiClose:
- FileDelete, %L2OSDIR%\L2OSlastlogs.ini
- FileDelete, %L2OSDIR%\L2OSCheckFileList.ini
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement