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 Me remain to author and Authorization pending.
- ;This script use "Runfirst" from :
- ;
- ;http://www.activeplus.com/Products/RunFirst
- ;
- ; 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.
- ; Data Used on compilation change path your path -(can't be variable path !)
- ; RunFirst is used only if "AltTabFix" is checked!
- FileInstall, D:\Softwares\AutoHotkey\L2 OS Launcher\runfirst.exe, %L2OSDIR%/System/runfirst.exe,1
- ; Global variable set / read from DLL :
- Appname = Lineage ][ OS Launcher
- Appversion = 0.0.0b
- AppAuthor = Baoulettes
- CurrentStatut = Client Ready to play
- IniRead, LogoURL, L2OSLConf.dll, Setup, LogoUrl
- IniRead, ServerRoot, L2OSLConf.dll, Setup, ServerRoot
- IniRead, ServerFileCheckVersion, L2OSLConf.dll, Setup, ServerFileCheckVersion
- IniRead, Changelogsfiles, L2OSLConf.dll, Setup, Changelogsfiles
- IniRead, Checkfilelist, L2OSLConf.dll, Setup, Checkfilelist
- ; 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
- ; All "If" there check if the dll is present and correct. else just close the app.
- If ServerRoot = ERROR
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- If ServerRoot =
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- If ServerFileCheckVersion = ERROR
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- If ServerFileCheckVersion =
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- If Changelogsfiles = ERROR
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- If Changelogsfiles =
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- If Checkfilelist = ERROR
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- If Checkfilelist =
- {
- Msgbox Required dll is missing or conrupted : L2OSLConf.dll, App now fail to load.
- ExitApp
- }
- ; 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
- IfNotExist %L2OSDIR%\banner-logo.png
- {
- UrlDownloadToFile, %LogoUrl%, %L2OSDIR%\banner-logo.png
- }
- ; 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, 1:Add, Picture, x0 y0 w485 h110 , %L2OSDIR%\banner-logo.png
- ; Game & Server game required version text place holder
- Gui, 1:Add, Text, x11 y107 w140 h20 , Game version : %Gameversion%
- Gui, 1:Add, Text, x161 y107 w320 h20 , Server Game version : %Serverversion%
- ; Progress & Launcher status
- Gui, 1:Add, Text, vDllFiles x11 y257 w350 h20 , %CurrentStatut%
- ; Progress Bars creation.
- Gui, 1:Add, Progress, x11 y287 w350 h20 , 25
- Gui, 1:Add, Progress, x11 y317 w350 h20 , 25
- ; Buttons Creation
- Gui, 1:Add, Button, vbtnPlay gbtnPlay x371 y327 w100 h30 , Play
- Gui, 1:Add, Button, vbtnUpdate gcheckfiles x371 y287 w100 h30 , Check Files
- Gui, 1:Add, Button, vbtnOptions gbtnoption x371 y247 w100 h30 , Options
- ; Change Log place holder
- Gui, 1:Add, Text, x11 y127 w460 h120 , %L2OSChangelogs%
- ; Copyright in the button of the launcher %Appname% is a variable see the header.
- Gui, 1:Add, Text, x11 y347 w350 h20 , %Appname% - %Appversion%
- ; Show the current created Gui.
- Gui, 1: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:
- ; Destroy older Gui 2 (in case user had an exploit to bypass windows caption system
- Gui, 2:Destroy
- ; Creating Gui base to allow later use (Needed for Checkbox to make them working between tabs)
- ; Simple logic as it :
- ; Button creation (Default Cancel and Apply that is present on ALL tabs so it is created before the tabs itself.
- ; Then Tab creation and then what the tab need to load and create.
- Gui, 2:Add, Button, x11 y477 w70 h20 , Default
- Gui, 2:Add, Button, gcancelgui2 x91 y477 w70 h20 , Cancel
- Gui, 2:Add, Button, gapplygui x171 y477 w70 h20 , Apply
- Gui, 2:Add, Tab, x0 y0 w2410 h770 , Video|Audio|Game
- ; 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, AltTabFix, %L2OSDIR%/System/Option.ini, Game, AltTabFix
- IniRead, Gamma, %L2OSDIR%/System/Option.ini, Video, Gamma
- 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, Pawn, %L2OSDIR%/System/Option.ini, ClippingRange, Pawn
- 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
- IniRead, LowDetail, %L2OSDIR%/System/Option.ini, Video, LowDetail
- ; 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
- ;Read L2.ini to know what map DEV-console would need.
- IfExist, %L2OSDIR%\system\L2-off.ini
- {
- IniRead, LocalMap, %L2OSDIR%/System/L2.ini, URL, LocalMap
- ; Directly Set variable there to do less coding stuff.
- StringTrimRight, LocalMapReC, LocalMap, 4
- LocalMapDD = %LocalMapReC%
- }
- Else
- {
- IniRead, LocalMap, %L2OSDIR%/System/L2-dev.ini, URL, LocalMap
- StringTrimRight, LocalMapReC, LocalMap, 4
- LocalMapDD = %LocalMapReC%
- }
- ; Convert parsed data to variable compatible.
- ; Check if the data StartupFullScreen is true or false and arrange the gui in the proper way.
- If StartupFullScreen = False
- {
- StartupFullScreenDD=True|False||
- }
- If StartupFullScreen = True
- {
- StartupFullScreenDD=True||False
- }
- ; Check if the data AltTabFix is true or false or empty and arrange the gui in the proper way.
- If AltTabFix =
- {
- AltTabFixDD = True|False||
- ; I used this trick to write the properties for next time to make it a bit faster in the check.
- IniWrite, False, %L2OSDIR%/System/Option.ini, Game, AltTabFix
- }
- If AltTabFix = ERROR
- {
- AltTabFixDD = True|False||
- IniWrite, False, %L2OSDIR%/System/Option.ini, Game, AltTabFix
- }
- If AltTabFix = False
- {
- AltTabFixDD = True|False||
- }
- If AltTabFix = True
- {
- AltTabFixDD = True||False
- }
- ; Check the data Gamma and arrange the gui in the proper way it can be any of this :
- ; Gamma=0.800000|0.900000|1.000000|1.100000|1.200000
- ; Game= 1 |2 |3 |4 |5
- ; I made a little variable check and rename to make it user-friendly & Lineage like.
- If Gamma =
- {
- GammaDD = 1|2|3||4|5
- }
- If Gamma = ERROR
- {
- GammaDD = 1|2|3||4|5
- }
- If Gamma = 0.800000
- {
- GammaDD = 1||2|3|4|5
- }
- If Gamma = 0.900000
- {
- GammaDD = 1|2||3|4|5
- }
- If Gamma = 1.000000
- {
- GammaDD = 1|2|3||4|5
- }
- If Gamma = 1.100000
- {
- GammaDD = 1|2|3|4||5
- }
- If Gamma = 1.200000
- {
- GammaDD = 1|2|3|4|5||
- }
- ; Check the data TextureDetail and arrange the gui in the proper way.
- If TextureDetail = 0
- {
- TextureDetailDD = 0||1|2
- }
- If TextureDetail = 1
- {
- TextureDetailDD = 0|1||2
- }
- If TextureDetail = 2
- {
- TextureDetailDD = 0|1|2||
- }
- ; Check the data ModelDetail and arrange the gui in the proper way.
- If ModelDetail = 0
- {
- ModelDetailDD = 0||1
- }
- If ModelDetail = 1
- {
- ModelDetailDD = 0|1||
- }
- ; Check the data SkipAnim and arrange the gui in the proper way.
- If SkipAnim = 0
- {
- SkipAnimDD = 0||1
- }
- If SkipAnim = 1
- {
- SkipAnimDD = 0|1||
- }
- ; Check the data PawnShadow and arrange the gui in the proper way.
- If PawnShadow = false
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vPawnShadowDD x21 y227 w100 h20 , Shadows
- }
- If PawnShadow = true
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, Checked vPawnShadowDD x21 y227 w100 h20 , Shadows
- }
- ; Check the data RenderDeco and arrange the gui in the proper way.
- If RenderDeco = false
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vRenderDecoDD x131 y227 w110 h20 , Ground Detail
- }
- If RenderDeco = true
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, Checked vRenderDecoDD x131 y227 w110 h20 , Ground Detail
- }
- ; Check the data Terrain and arrange the gui in the proper way.
- If Terrain = 4.000000
- {
- TerrainDD = 1||2|3|4|5
- }
- If Terrain = 5.000000
- {
- TerrainDD = 1|2||3|4|5
- }
- If Terrain = 6.000000
- {
- TerrainDD = 1|2|3||4|5
- }
- If Terrain = 7.000000
- {
- TerrainDD = 1|2|3|4||5
- }
- If Terrain = 8.000000
- {
- TerrainDD = 1|2|3|4|5||
- }
- ; Check the data Pawn and arrange the gui in the proper way.
- If Pawn = 1.000000
- {
- PawnDD = 1||2|3|4|5
- }
- If Pawn = 1.500000
- {
- PawnDD = 1|2||3|4|5
- }
- If Pawn = 2.000000
- {
- PawnDD = 1|2|3||4|5
- }
- If Pawn = 2.500000
- {
- PawnDD = 1|2|3|4||5
- }
- If Pawn = 3.000000
- {
- PawnDD = 1|2|3|4|5||
- }
- ; Check the data RenderActorLimited and arrange the gui in the proper way.
- ; Used a little trik to change "6" to "None" to make it more Lineage Like.
- If RenderActorLimited = 1
- {
- RenderActorLimitedDD = 1||2|3|4|5|None
- }
- If RenderActorLimited = 2
- {
- RenderActorLimitedDD = 1|2||3|4|5|None
- }
- If RenderActorLimited = 3
- {
- RenderActorLimitedDD = 1|2|3||4|5|None
- }
- If RenderActorLimited = 4
- {
- RenderActorLimitedDD = 1|2|3|4||5|None
- }
- If RenderActorLimited = 5
- {
- RenderActorLimitedDD = 1|2|3|4|5||None
- }
- If RenderActorLimited = 6
- {
- RenderActorLimitedDD = 1|2|3|4|5|None||
- }
- ; Check the data IsUseEffect and arrange the gui in the proper way.
- If IsUseEffect = False
- {
- IsUseEffectDD = True|False||
- }
- If IsUseEffect = True
- {
- IsUseEffectDD = True||False
- }
- ; Check the data AntiAliasing and arrange the gui in the proper way.
- If AntiAliasing = 0
- {
- AntiAliasingDD = 0||1|2
- }
- If AntiAliasing = 1
- {
- AntiAliasingDD = 0|1||2
- }
- If AntiAliasing = 2
- {
- AntiAliasingDD = 0|1|2||
- }
- ; Check the data Glow and arrange the gui in the proper way.
- If Glow = false
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vGlowDD x21 y417 w100 h20 , Glow Effect
- }
- If Glow = true
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, Checked vGlowDD x21 y417 w100 h20 , Glow Effect
- }
- ; Check the data UseTrilinear and arrange the gui in the proper way.
- If UseTrilinear = false
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vUseTrilinearDD x131 y417 w100 h20 , Texture Filter
- }
- If UseTrilinear = true
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, Checked vUseTrilinearDD x131 y417 w100 h20 , Texture Filter
- }
- ; Check the data UseColorCursor and arrange the gui in the proper way.
- If UseColorCursor = false
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vUseColorCursorDD x21 y447 w100 h20 , Game Cursor
- }
- If UseColorCursor = true
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, Checked vUseColorCursorDD x21 y447 w100 h20 , Game Cursor
- }
- ; Check the data LowDetail and arrange the gui in the proper way.
- If LowDetail = false
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vLowDetailDD x131 y447 w100 h20 , Low detail
- }
- If LowDetail = true
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, Checked vLowDetailDD x131 y447 w100 h20 , Low detail
- }
- ; In case that a first launch !
- If LowDetail =
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vLowDetailDD x131 y447 w100 h20 , Low detail
- IniWrite, False, %L2OSDIR%/System/Option.ini, Video, LowDetail
- }
- If LowDetail = ERROR
- {
- Gui, 2:Tab, 1
- Gui, 2:Add, CheckBox, vLowDetailDD x131 y447 w100 h20 , Low detail
- IniWrite, False, %L2OSDIR%/System/Option.ini, Video, LowDetail
- }
- ; Check the data SoundVolume and arrange the gui in the proper way.
- ; Used a little trik to change "6" to "Off" to make it more Lineage Like.
- If SoundVolume = 0.200000
- {
- SoundVolumeDD = Off|1||2|3|4|5
- }
- If SoundVolume = 0.400000
- {
- SoundVolumeDD = Off|1|2||3|4|5
- }
- If SoundVolume = 0.600000
- {
- SoundVolumeDD = Off|1|2|3||4|5
- }
- If SoundVolume = 0.800000
- {
- SoundVolumeDD = Off|1|2|3|4||5
- }
- If SoundVolume = 1.000000
- {
- SoundVolumeDD = Off|1|2|3|4|5||
- }
- If SoundVolume = 0.000000
- {
- SoundVolumeDD = Off||1|2|3|4|5
- }
- ; Check the data MusicVolume and arrange the gui in the proper way.
- ; Used a little trik to change "6" to "Off" to make it more Lineage Like.
- If MusicVolume = 0.200000
- {
- MusicVolumeDD = Off|1||2|3|4|5
- }
- If MusicVolume = 0.400000
- {
- MusicVolumeDD = Off|1|2||3|4|5
- }
- If MusicVolume = 0.600000
- {
- MusicVolumeDD = Off|1|2|3||4|5
- }
- If MusicVolume = 0.800000
- {
- MusicVolumeDD = Off|1|2|3|4||5
- }
- If MusicVolume = 1.000000
- {
- MusicVolumeDD = Off|1|2|3|4|5||
- }
- If MusicVolume = 0.000000
- {
- MusicVolumeDD = Off||1|2|3|4|5
- }
- ; Check the data WavVoiceVolume and arrange the gui in the proper way.
- ; Used a little trik to change "6" to "Off" to make it more Lineage Like.
- If WavVoiceVolume = 0.200000
- {
- WavVoiceVolumeDD = Off|1||2|3|4|5
- }
- If WavVoiceVolume = 0.400000
- {
- WavVoiceVolumeDD = Off|1|2||3|4|5
- }
- If WavVoiceVolume = 0.600000
- {
- WavVoiceVolumeDD = Off|1|2|3||4|5
- }
- If WavVoiceVolume = 0.800000
- {
- WavVoiceVolumeDD = Off|1|2|3|4||5
- }
- If WavVoiceVolume = 1.000000
- {
- WavVoiceVolumeDD = Off|1|2|3|4|5||
- }
- If WavVoiceVolume = 0.000000
- {
- WavVoiceVolumeDD = Off||1|2|3|4|5
- }
- ; Check the data OggVoiceVolume and arrange the gui in the proper way.
- ; Used a little trik to change "6" to "Off" to make it more Lineage Like.
- If OggVoiceVolume = 0.200000
- {
- OggVoiceVolumeDD = Off|1||2|3|4|5
- }
- If OggVoiceVolume = 0.400000
- {
- OggVoiceVolumeDD = Off|1|2||3|4|5
- }
- If OggVoiceVolume = 0.600000
- {
- OggVoiceVolumeDD = Off|1|2|3||4|5
- }
- If OggVoiceVolume = 0.800000
- {
- OggVoiceVolumeDD = Off|1|2|3|4||5
- }
- If OggVoiceVolume = 1.000000
- {
- OggVoiceVolumeDD = Off|1|2|3|4|5||
- }
- If OggVoiceVolume = 0.000000
- {
- OggVoiceVolumeDD = Off||1|2|3|4|5
- }
- ; Check the data TransparencyMode and arrange the gui in the proper way.
- If TransparencyMode = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vTransparencyModeDD x155 y47 w95 h20 , Transparent
- }
- If TransparencyMode = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, checked vTransparencyModeDD x155 y47 w95 h20 , Transparent
- }
- ; Check if the data GameMode is Dev-Mode or Original or empty and arrange the gui in the proper way.
- If GameMode =
- {
- GameModeDD = Dev-Mode|Original||
- ; I used this trick to write the properties for next time to make it a bit faster in the check.
- IniWrite, Original, %L2OSDIR%/System/Option.ini, Game, GameMode
- }
- If GameMode = ERROR
- {
- GameModeDD = Dev-Mode|Original||
- IniWrite, Original, %L2OSDIR%/System/Option.ini, Game, GameMode
- }
- If GameMode = Original
- {
- GameModeDD = Dev-Mode|Original||
- }
- If GameMode = Dev-Mode
- {
- GameModeDD = Dev-Mode||Original
- }
- ; Check the data MyName and arrange the gui in the proper way.
- If MyName = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vMyNameDD x91 y117 w90 h20 , Players
- }
- If MyName = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vMyNameDD x91 y117 w90 h20 , Players
- }
- ; Check the data NPCName and arrange the gui in the proper way.
- If NPCName = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vNPCNameDD x91 y137 w90 h20 , Monster
- }
- If NPCName = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vNPCNameDD x91 y137 w90 h20 , Monster
- }
- ; Check the data OtherPCName and arrange the gui in the proper way.
- If OtherPCName = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vOtherPCNameDD x91 y157 w90 h20 , Other PCs
- }
- If OtherPCName = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vOtherPCNameDD x91 y157 w90 h20 , Other PCs
- }
- ; Check the data PledgeMemberName and arrange the gui in the proper way.
- If PledgeMemberName = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vPledgeMemberNameDD x101 y177 w90 h20 , Clan
- }
- If PledgeMemberName = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vPledgeMemberNameDD x101 y177 w90 h20 , Clan
- }
- ; Check the data PartyMemberName and arrange the gui in the proper way.
- If PartyMemberName = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vPartyMemberNameDD x101 y197 w90 h20 , Party
- }
- If PartyMemberName = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vPartyMemberNameDD x101 y197 w90 h20 , Party
- }
- ; Check the data GroupName and arrange the gui in the proper way.
- If GroupName = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vGroupNameDD x101 y217 w90 h20 , General
- }
- If GroupName = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vGroupNameDD Checked x101 y217 w90 h20 , General
- }
- ; Check the data EnterChatting and arrange the gui in the proper way.
- If EnterChatting = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vEnterChattingDD x11 y257 w120 h20 , Enter Chat
- }
- If EnterChatting = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vEnterChattingDD x11 y257 w120 h20 , Enter Chat
- }
- ; Check the data OldChatting and arrange the gui in the proper way.
- If OldChatting = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vOldChattingDD x11 y277 w120 h20 , Auto Code
- }
- If OldChatting = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vOldChattingDD x11 y277 w120 h20 , Auto Code
- }
- ; Check the data ArrowMode and arrange the gui in the proper way.
- If ArrowMode = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vArrowModeDD x11 y297 w120 h20 , 3D Arrow
- }
- If ArrowMode = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vArrowModeDD x11 y297 w120 h20 , 3D Arrow
- }
- ; Check the data AutoTrackingPawn and arrange the gui in the proper way.
- If AutoTrackingPawn = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vAutoTrackingPawnDD x141 y257 w110 h20 , Tracking
- }
- If AutoTrackingPawn = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vAutoTrackingPawnDD x141 y257 w110 h20 , Tracking
- }
- ; Check the data IsNative and arrange the gui in the proper way.
- If IsNative = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vIsNativeDD x141 y277 w110 h20 , Key Security
- }
- If IsNative = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vIsNativeDD x141 y277 w110 h20 , Key Security
- }
- ; Check the data UseJoystick and arrange the gui in the proper way.
- If UseJoystick = false
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, vUseJoystickDD x141 y297 w110 h20 , Game Pad
- }
- If UseJoystick = true
- {
- Gui, 2:Tab, 3
- Gui, 2:Add, CheckBox, Checked vUseJoystickDD x141 y297 w110 h20 , Game Pad
- }
- ; Check the data ScreenShotQuality and arrange the gui in the proper way.
- If ScreenShotQuality = 0
- {
- ScreenShotQualityDD = Bitmap||High Quality - JPG|Medium Quality - JPG|Low Quality - JPG
- }
- If ScreenShotQuality = 1
- {
- ScreenShotQualityDD = Bitmap|High Quality - JPG||Medium Quality - JPG|Low Quality - JPG
- }
- If ScreenShotQuality = 2
- {
- ScreenShotQualityDD = Bitmap|High Quality - JPG|Medium Quality - JPG||Low Quality - JPG
- }
- If ScreenShotQuality = 3
- {
- ScreenShotQualityDD = Bitmap|High Quality - JPG|Medium Quality - JPG|Low Quality - JPG||
- }
- ; Check the data PartyLooting and arrange the gui in the proper way.
- If PartyLooting = 0
- {
- PartyLootingDD = Finders Keepers||Random|Random Including Spoil|By Turn|By Turn Including Spoil
- }
- If PartyLooting = 1
- {
- PartyLootingDD = Finders Keepers|Random||Random Including Spoil|By Turn|By Turn Including Spoil
- }
- If PartyLooting = 2
- {
- PartyLootingDD = Finders Keepers|Random|Random Including Spoil||By Turn|By Turn Including Spoil
- }
- If PartyLooting = 3
- {
- PartyLootingDD = Finders Keepers|Random|Random Including Spoil|By Turn||By Turn Including Spoil
- }
- If PartyLooting = 4
- {
- PartyLootingDD = Finders Keepers|Random|Random Including Spoil|By Turn|By Turn Including Spoil||
- }
- ; Creating rest of Gui with default Variable in case the one provided is empty and the check failed for unknown reason.
- ; All checkbox are in their corresponding "If" !
- 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, Text, x11 y37 w100 h30 , FullScreen
- Gui, 2:Add, DropDownList, vStartupFullScreenDD r2 x131 y37 w110 h20 , %StartupFullScreenDD%
- Gui, 2:Add, Text, x11 y67 w100 h30 , Alt+Tab Fix
- Gui, 2:Add, DropDownList, vAltTabFixDD r2 x131 y67 w110 h24 , %AltTabFixDD%
- Gui, 2:Add, Text, x11 y97 w100 h30 , Gamma
- Gui, 2:Add, DropDownList, vGammaDD r5 x131 y97 w110 h24 , %GammaDD%
- Gui, 2:Add, Text, x11 y127 w100 h30 , Textures
- Gui, 2:Add, DropDownList, vTextureDetailDD r3 x131 y127 w110 h24 , %TextureDetailDD%
- Gui, 2:Add, Text, x11 y157 w100 h30 , Modeling Detail
- Gui, 2:Add, DropDownList, vModelDetailDD r2 x131 y157 w110 h24 , %ModelDetailDD%
- Gui, 2:Add, Text, x11 y187 w100 h30 , Motion Detail
- Gui, 2:Add, DropDownList, vSkipAnimDD r2 x131 y187 w110 h24 , %SkipAnimDD%
- Gui, 2:Add, Text, x11 y257 w100 h30 , Terrain Range
- Gui, 2:Add, DropDownList, vTerrainDD r5 x131 y257 w110 h24 , %TerrainDD%
- Gui, 2:Add, Text, x11 y287 w100 h30 , PC/NPC Range
- Gui, 2:Add, DropDownList, vPawnDD r5 x131 y287 w110 h24 , %PawnDD%
- Gui, 2:Add, Text, x11 y317 w100 h30 , PC/NPC Limit
- Gui, 2:Add, DropDownList, vRenderActorLimitedDD r6 x131 y317 w110 h24 , %RenderActorLimitedDD%
- Gui, 2:Add, Text, x11 y347 w100 h30 , Reflection
- Gui, 2:Add, DropDownList, vIsUseEffectDD r2 x131 y347 w110 h24 , %IsUseEffectDD%
- Gui, 2:Add, Text, x11 y377 w100 h30 , Anti-Aliasing
- Gui, 2:Add, DropDownList, vAntiAliasingDD r3 x131 y377 w110 h24 , %AntiAliasingDD%
- Gui, 2:Tab, 2
- Gui, 2:Add, GroupBox, x5 y37 w250 h150 ,
- Gui, 2:Add, Text, x21 y57 w100 h30 , SFX Vol.
- Gui, 2:Add, DropDownList, vSoundVolumeDD x131 y57 w100 h20 , %SoundVolumeDD%
- Gui, 2:Add, Text, x21 y87 w100 h30 , Music Vol.
- Gui, 2:Add, DropDownList, vMusicVolumeDD x131 y87 w100 h24 , %MusicVolumeDD%
- Gui, 2:Add, Text, x21 y117 w100 h30 , System Voice
- Gui, 2:Add, DropDownList, vWavVoiceVolumeDD x131 y117 w100 h24 , %WavVoiceVolumeDD%
- Gui, 2:Add, Text, x21 y147 w100 h30 , Tutorial Voice
- Gui, 2:Add, DropDownList, vOggVoiceVolumeDD x131 y147 w100 h24 , %OggVoiceVolumeDD%
- 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, GroupBox, x5 y410 w250 h50 ,
- Gui, 2:Add, Text, x11 y47 w80 h20 , Interface
- Gui, 2:Add, Button, x91 y47 w60 h20 , Initialize
- Gui, 2:Add, Text, x11 y87 w80 h20 , GameMode
- Gui, 2:Add, DropDownList, vGameModeDD r2 x91 y87 w160 h20 , %GameModeDD%
- Gui, 2:Add, Text, x11 y117 w80 h30 , Display
- Gui, 2:Add, Text, x11 y327 w80 h20 , Screenshot
- Gui, 2:Add, DropDownList, vScreenShotQualityDD r4 x91 y327 w160 h20 , %ScreenShotQualityDD%
- Gui, 2:Add, Text, x11 y367 w80 h20 , Party Loot
- Gui, 2:Add, DropDownList, vPartyLootingDD r5 x91 y367 w160 h24 , %PartyLootingDD%
- Gui, 2:Add, Text, x11 y427 w100 h30 , Dev-Mod Map
- Gui, 2:Add, Edit, vLocalMapDD x111 y423 w100 h25 , %LocalMapDD%
- Gui, 2:Add, Text, x211 y427 w40 h30 , .unr
- gui, 1:+Disabled
- Gui, 2:Show, x591 y216 h508 w263, Options
- Return
- cancelgui2:
- goto 2GuiClose
- return
- applygui:
- Gui 2:Submit,Nohide
- msgbox,
- (
- StartupFullScreenDD = %StartupFullScreenDD%
- AltTabFixDD = %AltTabFixDD%
- GammaDD = %GammaDD%
- TextureDetailDD = %TextureDetailDD%
- ModelDetailDD = %ModelDetailDD%
- SkipAnimDD = %SkipAnimDD%
- PawnShadowDD = %PawnShadowDD%
- RenderDecoDD = %RenderDecoDD%
- TerrainDD = %TerrainDD%
- PawnDD = %PawnDD%
- RenderActorLimitedDD = %RenderActorLimitedDD%
- IsUseEffectDD = %IsUseEffectDD%
- AntiAliasingDD = %AntiAliasingDD%
- GlowDD = %GlowDD%
- UseTrilinearDD = %UseTrilinearDD%
- UseColorCursorDD = %UseColorCursorDD%
- LowDetailDD = %LowDetailDD%
- SoundVolumeDD = %SoundVolumeDD%
- MusicVolumeDD = %MusicVolumeDD%
- WavVoiceVolumeDD = %WavVoiceVolumeDD%
- OggVoiceVolumeDD = %OggVoiceVolumeDD%
- TransparencyModeDD = %TransparencyModeDD%
- GameModeDD = %GameModeDD%
- MyNameDD = %MyNameDD%
- NPCNameDD = %NPCNameDD%
- GroupNameDD = %GroupNameDD%
- PledgeMemberNameDD = %PledgeMemberNameDD%
- PartyMemberNameDD = %PartyMemberNameDD%
- OtherPCNameDD = %OtherPCNameDD%
- EnterChattingDD = %EnterChattingDD%
- AutoTrackingPawnDD = %AutoTrackingPawnDD%
- OldChattingDD = %OldChattingDD%
- IsNativeDD = %IsNativeDD%
- ArrowModeDD = %ArrowModeDD%
- UseJoystickDD = %UseJoystickDD%
- ScreenShotQualityDD = %ScreenShotQualityDD%
- PartyLootingDD = %PartyLootingDD%
- LocalMapDD = %LocalMapDD%
- )
- return
- 2GuiClose:
- gui, 2:+Disabled
- MsgBox, 4,, Any unsaved change will be lost, Are you sure?
- IfMsgBox Yes
- {
- Gui, 2:Destroy
- gui, 1:-Disabled
- Return
- }
- else
- {
- gui, 2:-Disabled
- Return
- }
- btnPlay:
- IniRead, GameMode, %L2OSDIR%/System/Option.ini, Game, GameMode
- IniRead, AltTabFix, %L2OSDIR%/System/Option.ini, Game, AltTabFix
- If GameMode = Dev-Mode
- {
- If AltTabFix = True
- {
- IfExist, %L2OSDIR%\system\L2-dev.ini
- {
- FileMove, %L2OSDIR%\system\L2.ini, %L2OSDIR%\system\L2-off.ini
- FileMove, %L2OSDIR%\system\L2-dev.ini, %L2OSDIR%\system\L2.ini
- }
- Run, cmd /c CD %L2OSDIR%\system\ & runfirst.exe L2.exe,,Hide
- Goto GuiClose
- }
- else
- {
- IfExist, %L2OSDIR%\system\L2-dev.ini
- {
- FileMove, %L2OSDIR%\system\L2.ini, %L2OSDIR%\system\L2-off.ini
- FileMove, %L2OSDIR%\system\L2-dev.ini, %L2OSDIR%\system\L2.ini
- }
- Run, cmd /c CD %L2OSDIR%\system\ & L2.exe,,Hide
- Goto GuiClose
- }
- }
- Else
- {
- If AltTabFix = True
- {
- IfExist, %L2OSDIR%\system\L2-off.ini
- {
- FileMove, %L2OSDIR%\system\L2.ini, %L2OSDIR%\system\L2-dev.ini
- FileMove, %L2OSDIR%\system\L2-off.ini, %L2OSDIR%\system\L2.ini
- }
- Run, cmd /c CD %L2OSDIR%\system\ & runfirst.exe L2.exe",,Hide
- Goto GuiClose
- }
- else
- {
- IfExist, %L2OSDIR%\system\L2-off.ini
- {
- FileMove, %L2OSDIR%\system\L2.ini, %L2OSDIR%\system\L2-dev.ini
- FileMove, %L2OSDIR%\system\L2-off.ini, %L2OSDIR%\system\L2.ini
- }
- Run, cmd /c CD %L2OSDIR%\system\ & L2.exe,,Hide
- Goto GuiClose
- }
- }
- 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