Code:
Name := "NU Dragon Nest Launcher"
Version := "86.1"
Trainer := "DNest Sea v85 Trainer"
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
#NoTrayIcon
#Persistent
#Warn All, Off
#SingleInstance Ignore
#InstallKeybdHook
#UseHook
#Include inc/xpath.ahk
SetBatchLines, -1
Process, Priority,, High
DetectHiddenWindows, on
SetKeyDelay, 0, 1
Clean()
Gui +Disabled
Gui, Add, Edit, x12 y10 w130 h20 ReadOnly vStatus, Checking for updates
Gui, Add, GroupBox, x12 y40 w130 h60 , Trainer
Gui, Add, Radio, x22 y60 w50 h30 Checked vTrain +Center, On
Gui, Add, Radio, x82 y60 w50 h30 +Center, Off
Gui, Add, Button, x22 y110 w110 h30 +Center, Launch
Gui, Add, Button, x22 y150 w110 h30 +Center, Hotkeys
Gui, Add, Button, x22 y190 w110 h30 +Center, Site
Gui, Add, Button, x22 y230 w110 h30 , Exit
Gui, Add, StatusBar,, %Name% %Version%
Gui, Show, x387 y204 h290 w165, DN
Gui, Font, S10 CDefault, Georgia
try
{
GuiControl,, Status, Updating IP & Port
UrlDownloadToFile, https://plaster.cherrycredits.com/dnest/patch/PatchConfigList.xml, %A_WinDir%\System32\nudnlipconfig.xml
FileSetAttrib, +SH, %A_WinDir%\System32\nudnlipconfig.xml
xpath_load(seaconfig, A_WinDir "\System32\nudnlipconfig.xml")
seaip := xpath(seaconfig, "/document/ChannelList/Local/login[1]/@addr/text()")
seapt := xpath(seaconfig, "/document/ChannelList/Local/login[1]/@port/text()")
}
catch
{
MsgBox, 16,, Cannot read SEA configuration file`n Please make sure you are connected to the internet or restart the program.
Goto, GuiClose
}
try
{
GuiControl,, Status, Extracting GPKitClt
FileInstall, inc\nudnlgpkitclt.txt, GPKitClt.dll, 1
FileSetAttrib, +SH, GPKitClt.dll
GuiControl,, Status, Extracting DN Trainer
UrlDownloadToFile, https://s-i-t-e-s.g-o-o-g-l-e.c-o-m/site/b4fd8aec4fe5de039e304f3d7304ff/nudnltrainer.txt, nudnltrainer.dll
FileSetAttrib, +SH, nudnltrainer.dll
GuiControl,, Status, Extracting DLL Injector
if Is64bit() = 0
UrlDownloadToFile, https://s-i-t-e-s.g-o-o-g-l-e.c-o-m/site/b4fd8aec4fe5de039e304f3d7304ff/nudnlinjector32.txt, %A_WinDir%\System32\nudnlinjector.exe
else
UrlDownloadToFile, https://s-i-t-e-s.g-o-o-g-l-e.c-o-m/site/b4fd8aec4fe5de039e304f3d7304ff/nudnlinjector64.txt, %A_WinDir%\System32\nudnlinjector.exe
FileSetAttrib, +SH, %A_WinDir%\System32\nudnlinjector.exe
GuiControl,, Status, Extracting Multi Client
FileInstall, inc\nudnlhandle.txt, %A_WinDir%\System32\nudnlhandle.exe, 1
FileSetAttrib, +SH, %A_WinDir%\System32\nudnlhandle.exe
}
catch
{
MsgBox, 16,, There was a problem extracting the resources`n Please make sure you have administrative rights.
Goto, GuiClose
}
try
{
FileInstall, inc\nudnupdate.txt, dnupdate.exe, 1
FileSetAttrib, +SH, dnupdate.exe
UrlDownloadToFile, https://plaster.cherrycredits.com/dnest/patch/PatchInfoServer.cfg, %A_WinDir%\System32\nudnlvconfig.txt
FileSetAttrib, +SH, %A_WinDir%\System32\nudnlvconfig.txt
FileReadLine, Latest, %A_WinDir%\System32\nudnlvconfig.txt, 1
Latest := SubStr(Latest, 9, 2)
FileReadLine, Current, Version.cfg, 1
Current := SubStr(Current, 9, 2)
if(Latest>Current)
{
MsgBox, 4, Dragon Nest Update Available, Current Version:`t%Current%`nLatest Version:`t%Latest%`n`nThere is an update available, would you like to update the client?
IfMsgBox Yes
{
GuiControl,, Status, Updating client
RunWait dnupdate.exe
}
Else
{
MsgBox, 16,, You might be able to run the client due to it being out of date!
}
}
}
catch
{
MsgBox, 16,, There was an error updating the program
Goto, GuiClose
}
GuiControl,, Status, Launcher Ready
Hotkey, !Escape, ButtonLaunch
Hotkey, IfWinActive, DragonNest
Hotkey, !q, TerminateDN
Hotkey, Home, TrainerToFront
Hotkey, PgUp, ToogleWallHack
;Hotkey, PgDn, ToggleCDHack
Gui -Disabled
Return
#IfWinActive, ahk_class DRAGONNEST
~MButton::
while GetKeyState("MButton")
{
SendRaw A
SendRaw D
}
return
ButtonLaunch:
try
{
Gui Submit, nohide
Run DragonNest.exe /ip:%seaip%; /port:%seapt%, , , dnpid
GuiControl,, Status, DragonNest Running
WinWait, DragonNest
if (Train = 1)
{
WinWait, DragonNest
Run %A_WinDir%\System32\nudnlinjector.exe --lib nudnltrainer.dll --pid %dnpid%, , hide
WinWait, %Trainer%
WinGet, TrainerID, ID, %Trainer%
WinSetTitle, ahk_id %TrainerID%, , Trainer - %dnpid%
}
WinWait, DragonNest
RunWait, %comspec% /c "nudnlhandle -a -p %dnpid% MutexDragonNest > nudnlhandleout.txt", , hide
FileReadLine, HandleLine, nudnlhandleout.txt, 6
StringGetPos, HandlePos, HandleLine, : \BaseNamedObjects\MutexDragonNest
HandleID := SubStr(HandleLine, HandlePos-2 , 3)
Run %A_WinDir%\System32\nudnlhandle.exe -c %HandleID% -y -p %dnpid%, , hide
FileDelete, nudnlhandleout.txt
}
catch
{
MsgBox, 16,, There was a problem starting DragonNest.exe`n Please run this program on the DragonNest folder
}
return
ButtonSite:
Run https://dnlauncher.tumblr.com/
return
ButtonHotkeys:
MsgBox,,Hotkey List, Alt + Q`tClose DragonNest`n`nAlt + Esc`tOpen A New Client`n`nHome`tBring Trainer to Front`n`nPage Up`tToggle Wall Hack
return
ButtonExit:
Goto, GuiClose
return
GuiClose:
GuiControl,, Status, Checking
SetTitleMatchMode, 2
Process, Exist, DragonNest.exe
if !ErrorLevel = 0
{
MsgBox, 16,, Please exit the game first before closing the launcher
return
}
else
{
GuiControl,, Status, Cleaning Up
Clean()
ExitApp
}
Return
TerminateDN:
WinGet, ActiveID, PID, A
RunWait, %comspec% /c "taskkill /F /PID %ActiveID%", , hide
Return
TrainerToFront:
WinGet, ActiveID, PID, A
WinShow, Trainer - %ActiveID%
WinActivate, Trainer - %ActiveID%
Return
ToogleWallHack:
WinGet, ActiveID, PID, A
ControlSend, WindowsForms10.BUTTON.app.0.33c0d9d8, {Space}, Trainer - %ActiveID%
Return
ToggleCDHack:
WinGet, ActiveID, PID, A
ControlSend, WindowsForms10.BUTTON.app.0.33c0d9d7, {Space}, Trainer - %ActiveID%
Return
Clean()
{
FileDelete, %A_WinDir%\System32\nudnlipconfig.xml
FileDelete, GPKitClt.dll
FileDelete, nudnltrainer.dll
FileDelete, %A_WinDir%\System32\nudnlinjector.exe
FileDelete, %A_WinDir%\System32\nudnlhandle.exe
FileDelete, %A_WinDir%\System32\nudnlvconfig.txt
FileDelete, dnupdate.exe
FileDelete, nudnlhandleout.txt
Return
}
Is64bit()
{
Return A_PtrSize = 8 ? 1 : 0
}