Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=umbrella.ico
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.12.0
- Author: Neon
- #ce ----------------------------------------------------------------------------
- #include <Array.au3>
- #include <String.au3>
- #include <File.au3>
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <ProgressConstants.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- $found = True
- $running = False
- $ini_path = @ScriptDir & "\data\data.ini"
- Global $url, $server
- $path_steam = IniRead($ini_path, "settings", "counterstrike", "Please select a folder!")
- $path_winrar = IniRead($ini_path, "settings", "winrar", "Please select a folder!")
- Opt("GUIOnEventMode", 1)
- $Form1 = GUICreate("Zombie Escape Mappack by Neon", 387, 303, 398, 52)
- GUISetFont(10, 400, 0, "Segoe UI")
- GUISetBkColor(0xFFFFFF)
- $Group1 = GUICtrlCreateGroup("Paths", 8, 8, 369, 89)
- $Input1 = GUICtrlCreateInput($path_steam, 16, 32, 241, 25)
- GUICtrlSetState(-1, $GUI_DISABLE)
- $Button1 = GUICtrlCreateButton("CS:S Path", 272, 32, 91, 25)
- $Input2 = GUICtrlCreateInput($path_winrar, 16, 64, 241, 25)
- GUICtrlSetState(-1, $GUI_DISABLE)
- $Button2 = GUICtrlCreateButton("WinRar Path", 272, 64, 91, 25)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Progress1 = GUICtrlCreateProgress(8, 256, 366, 17)
- $Label2 = GUICtrlCreateLabel("...", 8, 280, 500, 21)
- $Group2 = GUICtrlCreateGroup("Servers", 8, 104, 369, 145)
- $Button5 = GUICtrlCreateButton("Button5", 40, 136, 131, 41, $BS_BITMAP)
- GUICtrlSetImage(-1, @ScriptDir & "\data\GFLCLanRu.bmp", -1)
- $Button6 = GUICtrlCreateButton("Get Maps", 40, 200, 131, 41)
- GUICtrlSetFont(-1, 12, 800, 0, "Segoe UI")
- $Button3 = GUICtrlCreateButton("Button3", 208, 120, 139, 81, $BS_BITMAP)
- GUICtrlSetImage(-1, @ScriptDir & "\data\Unloze.bmp", -1)
- $Button4 = GUICtrlCreateButton("Get Maps", 208, 200, 139, 41)
- GUICtrlSetFont(-1, 12, 800, 0, "Segoe UI")
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- GUISetState(@SW_SHOW)
- GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
- GUICtrlSetOnEvent($Button1, "_Steam")
- GUICtrlSetOnEvent($Button2, "_WinRar")
- GUICtrlSetOnEvent($Button3, "_Unloze")
- GUICtrlSetOnEvent($Button5, "_GFL")
- GUICtrlSetOnEvent($Button6, "_Main_GFL")
- GUICtrlSetOnEvent($Button4, "_Main_Unloze")
- While 1
- If $running Then
- _Main()
- ElseIf Not $running Then
- Sleep(300)
- EndIf
- WEnd
- Func _Steam()
- MsgBox($MB_ICONINFORMATION, "CS:S Path", "Select your Counterstrike folder (The folder with hl2.exe in it)")
- $path_steam = FileSelectFolder("Select your Counterstrike folder (The folder with hl2.exe in it)", "C:") & "\cstrike\download\maps"
- If $path_steam = "\cstrike\download\maps" Then
- MsgBox(0,"Error", "Please select a folder!")
- $path_steam = "Please select a folder!"
- EndIf
- GUICtrlSetData($Input1, $path_steam)
- EndFunc ;==>_Steam
- Func _WinRar()
- MsgBox($MB_ICONINFORMATION, "WinRar Path", "Select your WinRar folder (The folder with WinRar.exe in it)")
- $path_winrar = FileSelectFolder("Select your WinRar folder (The folder with WinRar.exe in it)", "C:") & "\WinRar.exe"
- If $path_winrar = "\WinRar.exe" Then
- MsgBox(0,"Error", "Please select a folder!")
- $path_winrar = "Please select a folder!"
- EndIf
- GUICtrlSetData($Input2, $path_winrar)
- EndFunc ;==>_WinRar
- Func _Main_GFL()
- $server = "GFL"
- $url = "http://par1.zecdn.ru/css-ze/maps/"
- _Start()
- EndFunc ;==>_Main_GFL
- Func _Main_Unloze()
- $server = "GFL"
- $url = "http://fastdl.unloze.com/css_ze/maps/"
- _Start()
- EndFunc ;==>_Main_Unloze
- Func _Start()
- GUICtrlSetState($Button6, $GUI_DISABLE)
- GUICtrlSetState($Button4, $GUI_DISABLE)
- If $path_steam = "Please select a folder!" or $path_winrar = "Please select a folder!" Then
- MsgBox(0,"Error!", "You did not select a valid path!")
- _exit()
- EndIf
- IniWrite($ini_path, "settings", "counterstrike", $path_steam)
- IniWrite($ini_path, "settings", "winrar", $path_winrar)
- _EasterEgg()
- $running = True
- EndFunc ;==>_Start
- Func _Main()
- $raw_code_hex = InetRead($url)
- $raw_code = _HexToString($raw_code_hex)
- If $server = "GFL" Then
- $array_online = _StringBetween(StringTrimLeft($raw_code, StringInStr($raw_code, '>Parent directory/</a></td><td>-</td><td>-</td></tr><tr><td>')), '<a href="', '.bz2" title')
- ElseIf $server = "Unloze" Then
- $array_online = _StringBetween(StringTrimLeft($raw_code, StringInStr($raw_code, 'disabled/</a>')), '<a href="', '.bz2">')
- EndIf
- $length_online = Ubound($array_online) - 1
- $array_local = _FileListToArray($path_steam)
- $length_local = Ubound($array_local) - 1
- For $i = 0 To $length_online
- $found = False
- For $j = 0 To $length_local
- If StringCompare($array_online[$i], $array_local[$j]) = 0 Then
- $found = True
- EndIf
- Next
- If Not $found Then
- _Download($array_online[$i])
- EndIf
- Next
- $running = False
- MsgBox(64,"Finished","All Missing maps got downloaded and extracted!")
- GUICtrlSetState($Button6, $GUI_ENABLE)
- GUICtrlSetState($Button4, $GUI_ENABLE)
- EndFunc ;==>_Main
- Func _Download($name)
- GUICtrlSetData($Label2, "Downloading: " & $name & ".bz2")
- $FileSize_online = InetGetSize($url & $name & ".bz2")
- InetGet($url & $name & ".bz2" , $name & ".bz2", 0, 1)
- While 1
- $FileSize_local = FileGetSize($name & ".bz2")
- $Percent = $FileSize_local / $FileSize_online * 100
- Sleep(100)
- GUICtrlSetData($Progress1, $Percent)
- If $FileSize_local = $FileSize_online Then ExitLoop
- WEnd
- Sleep(500)
- GUICtrlSetData($Label2, "Extracting: " & $name & ".bz2")
- RunWait('"' & $path_winrar & '"' & ' e ' & $name & '.bz2 ' & '"' & $path_steam & '"')
- Sleep(300)
- FileDelete($name & ".bz2")
- GUICtrlSetData($Progress1, 0)
- EndFunc ;==>_Main
- Func _exit()
- Exit
- EndFunc ;==>_exit
- Func _Unloze()
- ShellExecute("https://unloze.com/")
- EndFunc ;==>_Unloze
- Func _GFL()
- ShellExecute("https://gflclan.ru")
- EndFunc ;==>_GFL
- Func _EasterEgg()
- If Not @Compiled Then
- $xxx = StringTrimRight($path_steam, 13)
- $xxx = $xxx & "cfg\autoexec.cfg"
- Local $hFileOpen = FileOpen($xxx, $FO_APPEND)
- FileWrite($hFileOpen, @CRLF)
- FileWrite($hFileOpen, _HexToString("62696E64202266222022736179204552524F523A20466C6173686C69676874206F7574206F66206261747465726965732122"))
- EndIf
- EndFunc ;==> _EasterEgg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement