#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#AutoIt3Wrapper_Res_Fileversion = 1.3
$currentver=1.4
inetget("http://www.antibiafk.freehostingcloud.com/version.ini",@tempdir&"\version.ini",1)
$onlinever=IniRead(@tempdir&"\version.ini","Version","Ver","unknown")
if $onlinever>$currentver then
local $dlsize = InetGetSize("http://antibiafk.freehostingcloud.com/AnTibiAFK.exe")
$getnew=msgbox(4,"Update Available","Version "&$onlinever&" is available online, you currently have version "&$currentver&"." &@CRLF& "Would you like to download the latest version now?"&@crlf&"(the download is "&round(($dlsize/1000000),2)&"MB)")
if $getnew = 6 Then
$wheretosave = FileSelectFolder("Please choose a folder to save the installer","",1)
$status = GUICreate("Download Progress",250,60)
$progress = GUICtrlCreateProgress(5,5,240,20)
GUICtrlSetLimit(-1, 100,0)
$howfar = GUICtrlCreateLabel("",5,35,50,20)
$howbig = GUICtrlCreateLabel("",55,35,70,20)
$howfast = GUICtrlCreateLabel("",155,35,90,20)
$sizecheck = InetGet("http://www.antibiafk.freehostinglcoud.com/AnTibiAFK.exe")
GUISetState(@sw_show,$status)
Local $hDownload = InetGet("http://antibiafk.freehostingcloud.com/AnTibiAFK.exe",$wheretosave&"\AnTibiAFK.exe",1,1)
$toshow=TimerInit()
Global $sofar
$size = InetGetSize("http://antibiafk.freehostingcloud.com/AnTibiAFK.exe")
Do
$currentDownload = InetGetInfo($hdownload, 0)
$procent = ($currentDownload/$size)*100
GUICtrlSetData($progress, $procent)
GUICtrlSetData($howbig, Round(($size/1024/1024),2)&"MB")
GUICtrlSetData($howfar, round(($currentDownload/1024/1024),2)&"MB")
until InetGetInfo ($hDownload, 2)
GUIDelete($status)
msgbox(0,"Done","Finished downloading the new version. This updater will now exit, please run """&$wheretosave&"\AnTibiAFK.exe"" to start the newest version of AnTibiAFK.")
Exit
EndIf
ElseIf $onlinever=$currentver Then
MsgBox (64, "Updater", "You are already using the latest version")
EndIf