vanheartnet

Garena Updater

Feb 13th, 2020 (edited)
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
  2. ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
  3. ;@Ahk2Exe-Set FileDescription, Garena Game Updater
  4. ;@Ahk2Exe-Set FileVersion, 3.4.4.0
  5. ;@Ahk2Exe-SetInternalName Garena Updater
  6. ;@Ahk2Exe-SetName Garena Game Updater
  7. ;@Ahk2Exe-SetOrigFileName Garena Updater
  8. ;@Ahk2Exe-Set ProductName, Game Updater
  9. ;@Ahk2Exe-Set ProductVersion, 3.4.4.0
  10. ;@Ahk2Exe-Set Description, Garena Updater
  11. ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
  12.  
  13. #SingleInstance, Force
  14. #NoEnv
  15. #Persistent
  16. Menu,Tray,NoStandard
  17. SetWorkingDir %A_ScriptDir%
  18. CoordMode,Pixel,Client
  19. CoordMode,Mouse,Client
  20.  
  21.  
  22.  
  23. ;###############################VANHEARTNET########################################
  24. IfNotExist,%A_Temp%\3.0
  25. FileCreateDir,%A_Temp%\3.0
  26. FileSetAttrib,+H,%A_Temp%\3.0
  27. FileInstall,pending.png,%A_Temp%\3.0\pending.png
  28. FileInstall,Updated.png,%A_Temp%\3.0\Updated.png
  29.  
  30. gosub,Check_Updates
  31. ;Kill running process========================================================================
  32. Process, Exist, Garena.exe
  33. {
  34. if !Errorlevel=0
  35. Process, close,Garena.exe
  36. }
  37. ;Check Files before start====================================================================
  38. IfExist, Garena.exe
  39. {
  40. Run, Garena.exe
  41. }
  42. else
  43. {
  44. MsgBox,16, Error, Some Files are missing or move.
  45. ExitApp
  46. }
  47. ifNotExist,Option.ini
  48. {
  49. IniWrite,1,Option.ini,Mode,Mouse
  50. Mode:=1
  51. }
  52. else
  53. {
  54. Iniread,Mode,Option.ini,Mode,Mouse
  55. if (Mode="" or Mode="ERROR")
  56. {
  57. Mode:=1
  58. IniWrite,1,Option.ini,Mode,Mouse
  59. }
  60.  
  61. }
  62. DW:=true
  63. Dtemp=%A_Temp%\3.0\pending.png
  64. Otemp=%A_Temp%\3.0\Updated.png
  65.  
  66. WinWait,Garena - Your Ultimate Game Platform
  67. WinActivate,Garena - Your Ultimate Game Platform
  68. if (Mode=1)
  69. ControlClick,x691 y13,Garena - Your Ultimate Game Platform ahk_class Qt5QWindowIcon ahk_exe Garena.exe,,Left,2
  70. else
  71. MouseClick,Left,698,10,2,1
  72.  
  73. ;Check Garena Updating exist=================================================================
  74. sleep,1000
  75. Process,Exist,gxxupdate.exe
  76. IF !ErrorLevel=0
  77. {
  78. WinWait,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe
  79. WinActivate,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe
  80. Sleep,1000
  81. Send,{TAB}
  82. Sleep,500
  83. Send,{Space}
  84. ControlClick,x285 y279,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe,,Left,2
  85. While 1
  86. {
  87. IfWinExist,Garena Update ahk_class Qt5QWindowIcon ahk_exe gxxupdate.exe
  88. {
  89. IfWinNotActive,Garena Update
  90. WinActivate
  91. WinGetPos,XG,YG,WG,HG,Garena Update
  92. IfWinActive,Garena Update
  93. {
  94. ImageSearch,IX,IY,0,0,%WG%,%HG%,*50 %A_Temp%\3.0\pending.png
  95. if (Errorlevel=0)
  96. {
  97. TrayTip,Garena,Preparing Update.....`t`t,5
  98. IfWinNotActive,Garena Update
  99. WinActivate
  100. ControlClick,x285 y279,Garena Update,,Left,2
  101. }
  102. else
  103. {
  104. Sleep,2000
  105. WinActivate,Garena Update
  106. TrayTip,Garena,Update on Process...`t`t,5
  107. ImageSearch,UX,UY,0,0,%WG%,%HG%,*50 %A_Temp%\3.0\Updated.png
  108. if (Errorlevel=0)
  109. {
  110. IfwinNotactive, Garena Update
  111. WinActivate,Garena Update
  112. Sleep,1000
  113. Send,{TAB}
  114. Sleep,500
  115. Send,{Space}
  116. ControlClick,x285 y279,Garena Update,,Left,2
  117.  
  118. }
  119. else
  120. Sleep,1000
  121.  
  122. }
  123. ;~ IfWinActive,Garena Update
  124. ;~ ControlClick,x285 y279,Garena Update,,Left,2
  125. }
  126. else
  127. WinActivate,Garena Update
  128. }
  129. else
  130. {
  131. IfWinExist,Garena - Your Ultimate Game Platform
  132. {
  133. WinActivate,Garena - Your Ultimate Game Platform
  134. IfWinActive,Garena - Your Ultimate Game Platform
  135. {
  136. Process,Close,Garena.exe
  137. TrayTip,Garena,is Finished Updating!`t `t,,1
  138. FileRemoveDir,%A_Temp%\3.0,1
  139. FileDelete,%A_Temp%\Garena Updater version.dat
  140. ExitApp
  141. }
  142. else
  143. WinActivate,Garena - Your Ultimate Game Platform
  144. }
  145.  
  146. }
  147.  
  148. }
  149. }
  150. else
  151. {
  152. Process,Close,Garena.exe
  153. TrayTip,Garena,is Updated!`t `t,,1
  154. sleep, 3000
  155. FileRemoveDir,%A_Temp%\3.0,1
  156. FileDelete,%A_Temp%\Garena Updater version.dat
  157. ExitApp
  158. }
  159. return
  160.  
  161.  
  162.  
  163. Esc::
  164. Delete::
  165. Process,close,garena.exe
  166. FileDelete,%A_Temp%\Garena Updater version.dat
  167. ExitApp
  168.  
  169.  
  170. End::
  171. ExitApp
  172.  
  173. Check_Updates:
  174. ;~ =======================================CHECK VERSION=====================================================
  175. V=3.4.4.0
  176. MFlink=http://www.mediafire.com/file/x061mo2kzpx5p09/Garena_Updater.rar/file
  177. pastebin=https://pastebin.com/5DKEXABT
  178. ;~ ============================================================================================
  179. message=Garena Updater
  180. message1=`n`nThank You`n`n-VANHEARTNET
  181. 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
  182. ;~ ============================================================================================
  183.  
  184. URLDownloadToFile,%pastebin%,%A_Temp%\%message% version.dat
  185. if errorlevel=0
  186. {
  187. fileread,version,%A_Temp%\%message% version.dat
  188. IfNotInString,version,%V%
  189. {
  190. Loop,read,%A_Temp%\%message% version.dat
  191. {
  192. str := A_LoopReadLine
  193. s:=StrSplit(str,"version=")
  194. Loop,parse,A_LoopReadLine,`n
  195. {
  196. IfNotInString,str,version=
  197. continue
  198. else
  199. {
  200. rar:=StrSplit(s.2,"</div>")
  201. url1:=rar.1
  202. V2:=url1
  203. break 2
  204. }
  205. }
  206. }
  207.  
  208. MsgBox,262180, %message%, A new version is Available!`n`nDo you want to download?`nversion : %V2%,10
  209. IfMsgBox,Yes
  210. Run,%MFlink%
  211. }
  212. }
  213. ;~ ==================================================================================================================
  214. return
Add Comment
Please, Sign In to add comment