Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
- ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
- ;@Ahk2Exe-Set FileDescription, Garena Game Updater
- ;@Ahk2Exe-Set FileVersion, 3.4.4.0
- ;@Ahk2Exe-SetInternalName Garena Updater
- ;@Ahk2Exe-SetName Garena Game Updater
- ;@Ahk2Exe-SetOrigFileName Garena Updater
- ;@Ahk2Exe-Set ProductName, Game Updater
- ;@Ahk2Exe-Set ProductVersion, 3.4.4.0
- ;@Ahk2Exe-Set Description, Garena Updater
- ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
- #SingleInstance, Force
- #NoEnv
- #Persistent
- Menu,Tray,NoStandard
- SetWorkingDir %A_ScriptDir%
- CoordMode,Pixel,Client
- CoordMode,Mouse,Client
- ;###############################VANHEARTNET########################################
- IfNotExist,%A_Temp%\3.0
- FileCreateDir,%A_Temp%\3.0
- FileSetAttrib,+H,%A_Temp%\3.0
- FileInstall,pending.png,%A_Temp%\3.0\pending.png
- FileInstall,Updated.png,%A_Temp%\3.0\Updated.png
- gosub,Check_Updates
- ;Kill running process========================================================================
- Process, Exist, Garena.exe
- {
- if !Errorlevel=0
- Process, close,Garena.exe
- }
- ;Check Files before start====================================================================
- IfExist, Garena.exe
- {
- Run, Garena.exe
- }
- else
- {
- MsgBox,16, Error, Some Files are missing or move.
- ExitApp
- }
- ifNotExist,Option.ini
- {
- IniWrite,1,Option.ini,Mode,Mouse
- Mode:=1
- }
- else
- {
- Iniread,Mode,Option.ini,Mode,Mouse
- if (Mode="" or Mode="ERROR")
- {
- Mode:=1
- IniWrite,1,Option.ini,Mode,Mouse
- }
- }
- DW:=true
- Dtemp=%A_Temp%\3.0\pending.png
- Otemp=%A_Temp%\3.0\Updated.png
- WinWait,Garena - Your Ultimate Game Platform
- WinActivate,Garena - Your Ultimate Game Platform
- if (Mode=1)
- ControlClick,x691 y13,Garena - Your Ultimate Game Platform ahk_class Qt5QWindowIcon ahk_exe Garena.exe,,Left,2
- else
- MouseClick,Left,698,10,2,1
- ;Check Garena Updating exist=================================================================
- sleep,1000
- Process,Exist,gxxupdate.exe
- IF !ErrorLevel=0
- {
- WinWait,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe
- WinActivate,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe
- Sleep,1000
- Send,{TAB}
- Sleep,500
- Send,{Space}
- ControlClick,x285 y279,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe,,Left,2
- While 1
- {
- IfWinExist,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe
- {
- IfWinNotActive,Garena Update
- WinActivate
- WinGetPos,XG,YG,WG,HG,Garena Update
- IfWinActive,Garena Update
- {
- ImageSearch,IX,IY,0,0,%WG%,%HG%,*50 %A_Temp%\3.0\pending.png
- if (Errorlevel=0)
- {
- TrayTip,Garena,Preparing Update.....`t`t,5
- IfWinNotActive,Garena Update
- WinActivate
- ControlClick,x285 y279,Garena Update,,Left,2
- }
- else
- {
- Sleep,2000
- WinActivate,Garena Update
- TrayTip,Garena,Update on Process...`t`t,5
- ImageSearch,UX,UY,0,0,%WG%,%HG%,*50 %A_Temp%\3.0\Updated.png
- if (Errorlevel=0)
- {
- IfwinNotactive, Garena Update
- WinActivate,Garena Update
- Sleep,1000
- Send,{TAB}
- Sleep,500
- Send,{Space}
- ControlClick,x285 y279,Garena Update,,Left,2
- }
- else
- Sleep,1000
- }
- ;~ IfWinActive,Garena Update
- ;~ ControlClick,x285 y279,Garena Update,,Left,2
- }
- else
- WinActivate,Garena Update
- }
- else
- {
- IfWinExist,Garena - Your Ultimate Game Platform
- {
- WinActivate,Garena - Your Ultimate Game Platform
- IfWinActive,Garena - Your Ultimate Game Platform
- {
- Process,Close,Garena.exe
- TrayTip,Garena,is Finished Updating!`t `t,,1
- FileRemoveDir,%A_Temp%\3.0,1
- FileDelete,%A_Temp%\Garena Updater version.dat
- ExitApp
- }
- else
- WinActivate,Garena - Your Ultimate Game Platform
- }
- }
- }
- }
- else
- {
- Process,Close,Garena.exe
- TrayTip,Garena,is Updated!`t `t,,1
- sleep, 3000
- FileRemoveDir,%A_Temp%\3.0,1
- FileDelete,%A_Temp%\Garena Updater version.dat
- ExitApp
- }
- return
- Esc::
- Delete::
- Process,close,garena.exe
- FileDelete,%A_Temp%\Garena Updater version.dat
- ExitApp
- End::
- ExitApp
- Check_Updates:
- ;~ =======================================CHECK VERSION=====================================================
- V=3.4.4.0
- MFlink=http://www.mediafire.com/file/x061mo2kzpx5p09/Garena_Updater.rar/file
- pastebin=https://pastebin.com/5DKEXABT
- ;~ ============================================================================================
- message=Garena Updater
- message1=`n`nThank You`n`n-VANHEARTNET
- message2=Garena Updater`n`nLatest version is now available and ready to download`nYou will redirect to a download link.`n`nThank You`n`n-VANHEARTNET
- ;~ ============================================================================================
- URLDownloadToFile,%pastebin%,%A_Temp%\%message% version.dat
- if errorlevel=0
- {
- fileread,version,%A_Temp%\%message% version.dat
- IfNotInString,version,%V%
- {
- Loop,read,%A_Temp%\%message% version.dat
- {
- str := A_LoopReadLine
- s:=StrSplit(str,"version=")
- Loop,parse,A_LoopReadLine,`n
- {
- IfNotInString,str,version=
- continue
- else
- {
- rar:=StrSplit(s.2,"</div>")
- url1:=rar.1
- V2:=url1
- break 2
- }
- }
- }
- MsgBox,262180, %message%, A new version is Available!`n`nDo you want to download?`nversion : %V2%,10
- IfMsgBox,Yes
- Run,%MFlink%
- }
- }
- ;~ ==================================================================================================================
- return
Add Comment
Please, Sign In to add comment