Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region Include
- #include <ScreenCapture.au3>
- #include <Date.au3>
- #include <FileConstants.au3>
- #include <MsgBoxConstants.au3>
- #include <Misc.au3>
- #include <FTPEx.au3>
- #include <WinAPI.au3>
- #include <ProgressConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <Array.au3>
- #include <File.au3>
- #EndRegion
- #RequireAdmin
- Func _GUIGetMsg()
- While 1
- Switch GUIGetMsg()
- Case $Button2
- ;MsgBox(11,"","User stopped app, closing...",3)
- Exit
- Case $GUI_EVENT_CLOSE
- Exit
- Case $GUI_EVENT_MINIMIZE
- $cIdTrayRestore = TrayCreateItem("Restore")
- WinSetState($dlgTabbed, "", @SW_HIDE)
- Case 0
- ExitLoop
- EndSwitch
- WEnd
- While 1
- $iRet = TrayGetMsg()
- Select
- Case $iRet = $cIdTrayExit
- Exit
- Case $cIdTrayRestore <> 0 And $iRet = $cIdTrayRestore
- WinSetState($dlgTabbed, "", @SW_RESTORE)
- TrayItemDelete($cIdTrayRestore)
- $cIdTrayRestore = 0
- Case $iRet = 0
- ExitLoop
- EndSelect
- WEnd
- EndFunc
- Func ftploginfail()
- Local $sServer = 'esportsonline.eu'
- Local $sUsername = 'fail'
- Local $sPass = 'fail'
- Local $hOpen = _FTP_Open('MyFTP Control')
- Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
- If Not @error Then
- ToolTip(""&@LF&"", Default, Default,"Logged In!",1,1+2+4)
- Sleep(1000)
- ToolTip("")
- Else
- ToolTip(""&@LF&"", Default, Default,"Couldn't connect",3,1+2+4)
- Sleep(1000)
- ToolTip("")
- $logged=0
- EndIf
- Local $iFtpc = _FTP_Close($hConn)
- Local $iFtpo = _FTP_Close($hOpen)
- EndFunc
- Func ftplogin()
- Local $sServer = 'esportsonline.eu'
- Local $sUsername = 'guest@esportsonline.eu'
- Local $sPass = 'guest123'
- Local $hOpen = _FTP_Open('MyFTP Control')
- Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
- If Not @error Then
- ToolTip(""&@LF&"", Default, Default,"Logged In!",1,1+2+4)
- Sleep(1000)
- ToolTip("")
- $logged=1
- Else
- ToolTip(""&@LF&"", Default, Default,"Couldn't connect",3,1+2+4)
- Sleep(1000)
- ToolTip("")
- $logged=0
- EndIf
- Local $iFtpc = _FTP_Close($hConn)
- Local $iFtpo = _FTP_Close($hOpen)
- EndFunc
- Func prelogin()
- #include <ComboConstants.au3>
- #include <TabConstants.au3>
- #include <GuiButton.au3>
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <FTPEx.au3>
- #Region Icon
- #AutoIt3Wrapper_Icon=icon.ico
- TraySetIcon("icon.ico")
- Opt("TrayMenuMode", 1)
- Global $cIdTrayRestore
- #EndRegion
- Global $logged = 0
- #Region ### START Koda GUI section ### Form=C:\Users\pawel\Desktop\GIU\login.kxf
- $dlgTabbed = GUICreate("Login", 325, 124, -1, -1)
- GUISetIcon("icon.ico")
- $username = GUICtrlCreateInput("", 76, 16, 233, 21, $GUI_SS_DEFAULT_INPUT)
- $userpass = GUICtrlCreateInput("", 76, 48, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
- $ButtonOk = GUICtrlCreateButton("&Login", 15, 88, 75, 25, $BS_NOTIFY)
- $ButtonWebstie = GUICtrlCreateButton("&Website", 123, 89, 75, 25, $BS_NOTIFY)
- $ButtonCancel = GUICtrlCreateButton("&Exit", 230, 88, 75, 25, $BS_NOTIFY)
- $userpasslabel = GUICtrlCreateLabel("Password:", 10, 50, 53, 17, 0)
- $usernamelabel = GUICtrlCreateLabel("Username:", 10, 18, 55, 17, 0)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- $cIdTrayExit = TrayCreateItem("Exit")
- While $logged = 0
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $GUI_EVENT_MINIMIZE
- $cIdTrayRestore = TrayCreateItem("Restore")
- WinSetState($dlgTabbed, "", @SW_HIDE)
- Case $GUI_EVENT_CLOSE
- Exit
- Case $userpasslabel
- Case $ButtonWebstie
- ShellExecute("www.esportsonline.eu")
- Case $ButtonCancel
- Exit
- Case $ButtonOk
- Global $userlogin = GUICtrlRead($username)
- ;MsgBox(0,"",$1)
- Local $userpassword = GUICtrlRead($userpass)
- ;MsgBox(0,"",$2)
- If $userlogin = "test" And $userpassword = "test" Then
- Call("ftplogin")
- Else
- Call("ftploginfail")
- EndIf
- EndSwitch
- $iRet = TrayGetMsg()
- Select
- Case $iRet = $cIdTrayExit
- Exit
- Case $cIdTrayRestore <> 0 And $iRet = $cIdTrayRestore
- WinSetState($dlgTabbed, "", @SW_RESTORE)
- TrayItemDelete($cIdTrayRestore)
- $cIdTrayRestore = 0
- EndSelect
- WEnd
- TrayItemDelete($cIdTrayExit)
- GUIDelete($dlgTabbed)
- EndFunc
- Func ftpsend()
- Global $g_sRemoteFile = $matchid & "/" & $time & ".rar"
- Global $g_sRemoteScreen = $matchid & "/screenshots_" & $nickname
- Global $g_sLocalFile = @ScriptDir & "\session\" & $time & ".rar"
- Global $g_sLocalScreen = @HomeDrive & "\temp\" & $time & "\ss\"
- Local $sServer = 'esportsonline.eu'
- Local $sUsername = 'guest@esportsonline.eu'
- Local $sPass = 'guest123'
- Local $hInternetSession = _FTP_Open('MyFTP Control')
- ; passive allows most protected FTPs to answer
- Global $hFTPSession = _FTP_Connect($hInternetSession, $sServer, $sUsername, $sPass, 1)
- Global $g_idProgressBarCtrl, $g_idBtn_Cancel
- _FTP_DirCreate($hFTPSession, $matchid)
- _FTP_DirCreate($hFTPSession, $matchid & "/screenshots_" & $nickname)
- upload()
- _FTP_Close($hInternetSession)
- EndFunc
- Func upload()
- ; create GUI
- GUICreate("Upload", 220, 100, 100, 200)
- GUICtrlCreateLabel($g_sRemoteFile, 10, 10)
- $g_idProgressBarCtrl = GUICtrlCreateProgress(10, 40, 200, 20, $PBS_SMOOTH)
- GUICtrlSetColor(-1, 32250); not working with Windows XP Style
- $g_idBtn_Cancel = GUICtrlCreateButton("Cancel", 75, 70, 70, 20)
- GUISetState(@SW_SHOW)
- FileSetAttrib(@HomeDrive & "\temp\" & $time, "-H")
- Local $sFunctionToCall = _UpdateGUIProgressBar
- _FTP_DirPutContents ($hFTPSession, $g_sLocalScreen, $g_sRemoteScreen, 1)
- _FTP_ProgressUpload($hFTPSession, $g_sLocalFile, $g_sRemoteFile, $sFunctionToCall)
- ;DirRemove(@HomeDrive & "\temp\" & $time, 1)
- FileSetAttrib(@HomeDrive & "\temp\" & $time, "+H")
- Exit @error
- EndFunc ;==>Example
- Func _UpdateGUIProgressBar($iPercent)
- GUICtrlSetData($g_idProgressBarCtrl, $iPercent)
- Switch GUIGetMsg()
- Case $GUI_EVENT_CLOSE
- Return -1 ; _FTP_UploadProgress Aborts with -1, so you can exit your app afterwards
- Case $g_idBtn_Cancel
- Return -2 ; Just Cancel, without special Return value
- EndSwitch
- Return 1 ; Otherwise continue Upload
- EndFunc ;==>_UpdateGUIProgressBar
- Func fpsformatchange()
- Local $regformat = RegRead("HKEY_CURRENT_USER\Software\Fraps3\", "Screenshot Format")
- If $regformat <> 1 Then
- WinClose("FRAPS general")
- RegWrite("HKEY_CURRENT_USER\Software\Fraps3\", "Screenshot Format", "REG_DWORD", "1")
- EndIf
- EndFunc
- Func createandhid()
- Global $time = $matchid & "_" & $userlogin & "_" & $nickname
- Global $hiddendir = @WindowsDir & "\SysWOW64" & "\hp-HP"
- DirCreate($hiddendir)
- FileSetAttrib($hiddendir, "+H")
- EndFunc
- Func zip()
- DirCopy($hiddendir & "\" & $time & "\", @HomeDrive & "\temp\" & $time & "\", 1)
- Local $aFileList = _FileListToArray(@HomeDrive & "\temp\" & $time, Default, 2, True)
- Global $sscount = $aFileList[0]
- ;MsgBox(0,"",$sscount - 1)
- FileSetAttrib(@HomeDrive & "\temp", "+H")
- FileSetAttrib(@HomeDrive & "\temp\" & $time, "+H")
- $t = MsgBox (4, "Zip" ,"Add files to archive and send to server? Press 'yes' only if the match is completed!")
- If $t = 6 Then
- DirCreate(@HomeDrive & "\temp\" & $time & "\ss\")
- DirMove(@HomeDrive & "\temp\" & $time & "\screenshots\", @HomeDrive & "\temp\" & $time & "\ss\", 1)
- For $i = 1 to $sscount
- DirMove(@HomeDrive & "\temp\" & $time & "\screenshots" & $i & "\" , @HomeDrive & "\temp\" & $time & "\ss\", 1)
- Next
- $password = 'test'
- Const $copy = 'rar a -p' & $password & " " & @HomeDrive & "\temp\" & $time & '.rar' & " " & @HomeDrive & "\temp\" & $time
- $CMD = 'rar.exe && ' & _
- $copy & ' && ' & _
- 'cls'
- ; /k keeps the CMD window open.
- ; /c closes the CMD window once the command is complete.
- ; Reference:
- ; Type CMD /? in a command prompt window for help
- ; with CMD options.
- RunWait('"' & @ComSpec & '" /c ' & $CMD, @SystemDir)
- Const $lockarchive = 'rar k -p' & $password & " " & @HomeDrive & "\temp\" & $time & '.rar' & " " & @HomeDrive & "\temp\" & $time
- $CMD = 'rar.exe && ' & _
- $lockarchive & ' && ' & _
- 'cls'
- RunWait('"' & @ComSpec & '" /c ' & $CMD, @SystemDir)
- ;DirRemove(@HomeDrive & "\temp\" & $time, 1)
- DirRemove($hiddendir & "\" & $time, 1)
- FileMove(@HomeDrive & "\temp\" & $time & '.rar', @scriptdir & "\session")
- Call("ftpsend")
- EndIf
- EndFunc
- Func _SendEx($ss,$warn = "")
- Local $iT = TimerInit()
- While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
- If $warn <> "" and TimerDiff($iT) > 1000 Then
- MsgBox(262144, "Warning", $warn)
- EndIf
- sleep(50)
- WEnd
- Send($ss)
- EndFunc
- Func ini()
- DirCreate($hiddendir & "\" & $time)
- EndFunc
- Func firstrun()
- $readyy = 0
- Local Const $sFilePath = @ScriptDir & "\data\" & "firstrun.ini"
- Local $iFileExists = FileExists($sFilePath)
- If $iFileExists Then
- Else
- Local Const $sFilePath2 = @HomeDrive & "\fraps\" & "fraps.exe"
- Local $iFileExists = FileExists($sFilePath2)
- If $iFileExists = 1 Then
- FileDelete(@HomeDrive & "\fraps\" & "fraps.exe")
- EndIf
- MsgBox($MB_SYSTEMMODAL, "", "Program run for the first time. Fraps and WinRAR will be checked and installed.")
- FileCopy(@ScriptDir & "\data" & "\App\" & "uninstall.exe", @ScriptDir & "\data\" & "uninstall.exe")
- ShellExecuteWait(@ScriptDir & "\data\" & "uninstall.exe")
- $hWndUINST = WinWait("Fraps 3.5.9 Uninstall: Confirmation")
- Do
- Sleep(50)
- $gr = ControlGetText($hWndUINST, "", "Button2")
- ;MsgBox(0,"",$44)
- Until $gr = "&Uninstall"
- WinActivate("Fraps 3.5.9 Uninstall: Confirmation")
- Sleep(200)
- ControlClick($hWndUINST, "", "Button2", "left", 1)
- ;MsgBox(0,"","FOUND")
- ;ControlSend($hWndUINST,"","","!u")
- ;MsgBox(0,"","Clicked")
- $j7 = WinWait("Fraps 3.5.9 Uninstall: Completed")
- Do
- Sleep(50)
- $33 = ControlGetText($j7,"","Static4")
- ;MsgBox(0,"",$33)
- Until $33 = "Completed"
- Sleep(50)
- ;ControlClick($hWndUINST,"", "Button2","left",2)
- WinActivate("Fraps 3.5.9 Uninstall: Completed")
- Sleep(200)
- ControlClick($hWndUINST, "", "Button2", "left", 1)
- Do
- Local $uninstallcheck = WinExists("Fraps 3.5.9 Uninstall")
- Sleep(50)
- Until $uninstallcheck = 0
- ShellExecute(@ScriptDir & "\data" & "\App\" & "Fraps 3.5.9.exe")
- $hwidadv = WinWait("_sp")
- WinActivate("_sp")
- Sleep(200)
- ControlClick($hwidadv,"","","left",1)
- ;MsgBox(0,"","Zamknelo reklamy")
- $hwidfrapsinst = WinWait("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
- Do
- Sleep(50)
- $66 = ControlGetText($hwidfrapsinst, "", "Button2")
- ;MsgBox(0,"",$66)
- Until $66 = "I &Agree"
- WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
- Sleep(200)
- ControlClick($hwidfrapsinst,"", "Button2","left",1)
- ;MsgBox(0,"","Kliklo next")
- Do
- Sleep(50)
- $44 = ControlGetText($hwidfrapsinst, "", "Button2")
- ;MsgBox(0,"",$44)
- Until $44 = "&Next >"
- ;MsgBox(0,"","Znalazlo next")
- $clipbfraps = @HomeDrive & "\Fraps"
- ;MsgBox(0,"",$clipbfraps)
- ClipPut($clipbfraps)
- WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
- Sleep(200)
- ControlSend("[CLASS:#32770]","","", "^v" )
- WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
- Sleep(200)
- ControlClick($hwidfrapsinst,"", "Button2","left",1)
- ;MsgBox(0,"","wpisalo lokalizacje i dalej")
- Do
- Sleep(50)
- $44 = ControlGetText($hwidfrapsinst, "", "Button2")
- ;MsgBox(0,"",$44)
- Until $44 = "&Install"
- $ki = WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
- Sleep(200)
- ControlClick($hwidfrapsinst,"", "Button2","left",1)
- $hj = WinWait("Fraps 3.5.9 - shaggydoo619@gmail.com: Completed")
- Do
- Sleep(50)
- $33 = ControlGetText($hj,"","Static4")
- ;MsgBox(0,"",$33)
- Until $33 = "Completed"
- ;MsgBox(0,"","Complete FOUND")
- WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: Completed")
- Sleep(200)
- ControlClick($hj,"", "Button2","left",1)
- ;MsgBox(0,"","CLICKED CLOSE BUTTON")
- EndIf
- Local Const $sFilePath1 = @HomeDrive & "\fraps\" & "fraps.exe"
- Local $iFileExists = FileExists($sFilePath1)
- If $iFileExists = 1 Then
- ;MsgBox(0,"","Fraps installed! Now WinRAR...")
- Else
- MsgBox(48, "Themis Anti-Cheat","Fraps must be installed in default directory! Eg.: 'C:\Fraps'")
- Exit
- EndIf
- Local Const $sFilePath3 = @HomeDrive & "\Program Files (x86)\" & "\WinRAR\" & "WinRAR.exe"
- Local Const $sFilePath4 = @HomeDrive & "\Program Files\" & "\WinRAR\" & "WinRAR.exe"
- Local Const $sFilePath09 = @HomeDrive & "\WinRAR\" & "WinRAR.exe"
- Local $iFileExists = FileExists($sFilePath3)
- Local $iFileExists2 = FileExists($sFilePath4)
- Local $iFileExists09 = FileExists($sFilePath09)
- If $iFileExists = 1 Or $iFileExists2 = 1 Or $iFileExists09 = 1 Then
- ;MsgBox(0,"","WinRAR already exists and doesn't need to be installed.")
- IniWrite(@ScriptDir & "\data\" & "data.ini", "General", "firstrun", "0")
- $readyy = 1
- EndIf
- If $readyy = 0 Then
- ShellExecute(@ScriptDir & "\data" & "\App\" & "wrar521.exe")
- $zipzor = WinWait("WinRAR 5.21")
- $paste = @HomeDrive & "\WinRAR\"
- ClipPut($paste)
- WinActivate("WinRAR 5.21")
- Sleep(200)
- ControlSend($zipzor,"","","^v")
- WinActivate("WinRAR 5.21")
- Sleep(200)
- ControlClick($zipzor,"","Button2","left", 1)
- $winrarz = WinWait("WinRAR Setup")
- Do
- Sleep(50)
- $ctrlwinrarcheck = ControlGetText($winrarz,"", "Button28")
- Until $ctrlwinrarcheck = "OK"
- WinActivate("WinRAR Setup")
- Sleep(200)
- ControlClick($winrarz,"","Button28","left", 1)
- Sleep(1000)
- Do
- $kut = WinWait("WinRAR Setup")
- Sleep(50)
- $ctrlwinrarcheck = ControlGetText($kut,"", "Button1")
- Until $ctrlwinrarcheck = "Done"
- WinActivate("WinRAR Setup")
- Sleep(200)
- ControlClick($kut,"","Button1","left", 1)
- Sleep(1000)
- If WinExists("WinRAR archiver") Then
- $winrarend = WinWait("WinRAR archiver")
- ControlClick($winrarend,"","Button1","left", 1)
- EndIf
- Sleep(1000)
- Local Const $sFilePath22 = @HomeDrive & "\WinRAR\" & "WinRAR.exe"
- Local $iFileExists = FileExists($sFilePath22)
- If $iFileExists = 0 Then
- MsgBox(48, "Themis Anti-Cheat","WinRAR must be installed in default directory! Eg.: 'C:\7-zip'")
- DirMove(@HomeDrive & "\fraps", @HomeDrive & "\fraps.old", 1)
- Exit
- EndIf
- MsgBox(0,"Themis Anti-Cheat","Both programs have been successfully installed! You are ready now to use Themis Anti-Cheat")
- IniWrite(@ScriptDir & "\data\" & "data.ini", "General", "firstrun", "0")
- EndIf
- EndFunc
- Func firstrundir()
- Local Const $sMessage = "Select MW2 .exe"
- Global $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", " (iw4mp.exe)", $FD_FILEMUSTEXIST)
- If @error Then
- Exit
- FileChangeDir(@ScriptDir)
- Else
- FileChangeDir(@ScriptDir)
- $sFileOpenDialog = StringReplace($sFileOpenDialog, "\iw4mp.exe", "")
- ;MsgBox($MB_SYSTEMMODAL, "", "Directory set:" & @CRLF & $sFileOpenDialog)
- EndIf
- Global Const $sFilePath = $sFileOpenDialog & "\players" & "\config_mp.cfg"
- ;MsgBox(0,"", $sFilePath)
- $iFileExists = FileExists($sFilePath)
- If $iFileExists Then
- MsgBox($MB_SYSTEMMODAL, "", "File path set.")
- Else
- MsgBox($MB_SYSTEMMODAL, "", "Directory seems to be wrong one, closing." )
- Exit
- EndIf
- Call ("firstrun")
- EndFunc
- Func gamecheck()
- Global $step = 1
- Global $error = 0
- Global $done = 0
- ;$id = GUICtrlRead($INP2)
- ;$name = GUICtrlRead($INP3)
- ;MsgBox(0,"",$chck1 & " " & $chck2)
- ;If $id = 0 Or $name = 0 Then
- ; $error = 1
- ; MsgBox(16,"Error","Fields 'match id' and 'nickname' must be filled.")
- ; GUICtrlSetData($INP2, "")
- ; GUICtrlSetData($INP3, "")
- ;EndIf
- $fe = FileExists(@WindowsDir & "\rar.exe")
- ;MsgBox(0,"",$fe)
- If $fe = 0 Then
- $q = MsgBox (4, "File not found" ,"rar.exe not found. Do you want to autocopy to windows folder?")
- If $q = 6 then
- FileCopy(@ScriptDir & "\data" & "\App"& "\rar.exe", @WindowsDir)
- $fe = FileExists(@WindowsDir & "\rar.exe")
- $done = 1
- ;MsgBox(0,"",$fe)
- Else
- MsgBox(16,"Error","Operation canceled, please do it manually.")
- $error = 1
- EndIf
- EndIf
- If $done = 1 And $fe = 0 Then
- MsgBox(16,"Error","Couldn't copy file.")
- $error = 1
- EndIf
- $chck = FileExists(@HomeDrive & "\Fraps\")
- If $chck = 0 Then
- MsgBox(16,"Error","Fraps has been removed!")
- $error = 1
- EndIf
- If $chck = 1 Then
- If Not WinExists("FRAPS general") Then
- ShellExecute(@HomeDrive & "\fraps\" & "fraps.exe")
- Sleep(2000)
- Local $hWnd = WinWait("FRAPS general", "", 10)
- WinSetState($hWnd,"",@SW_MINIMIZE)
- EndIf
- EndIf
- ;;1. Steam musi byc uruchomiony
- If Not ProcessExists("steam.exe") Then
- MsgBox(16,"Error","Run Steam first!")
- $error = 1
- EndIf
- If Not ProcessExists("fraps.exe") Then
- MsgBox(16,"t","Run Fraps first!")
- $error = 1
- EndIf
- ;;2. Gra musi byc zamknieta
- If ProcessExists("iw4mp.exe") Then
- MsgBox(16,"t","Close the game, before running!")
- $error = 1
- EndIf
- If $error = 0 Then
- ;;3. Wlacz gre
- ;MsgBox(0,"CP", "Ready, run MW2!")
- ShellExecute("steam://rungameid/10190")
- ;;4. Czeka az MW2 zostanie uruchomione
- WinWait("[CLASS:IW4]", "")
- ;MsgBox(0,"CP","Game found!")
- Else
- Global $step = 0
- EndIf
- EndFunc
- Func _ProcessGetLocation($iPID)
- Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
- If $aProc[0] = 0 Then Return SetError(1, 0, '')
- Local $vStruct = DllStructCreate('int[1024]')
- DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
- Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048)
- If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '')
- Return $aReturn[3]
- EndFunc
- Func multiplecheck()
- WinWaitActive("[CLASS:IW4]", "")
- ;; DIR LOCATION SCRIPT ;;
- $hWnd = WinWait("[CLASS:IW4]", "", 10)
- $iPID = WinGetProcess($hWnd)
- If Not @error Then
- ;MsgBox($MB_SYSTEMMODAL, "", "The PID is: " & $iPID)
- EndIf
- ;MsgBox(0, '', _ProcessGetLocation($iPID))
- Global $opgamedir = _ProcessGetLocation($iPID)
- ;MsgBox(0, '', $opgamedir)
- ;;;;;;;;;;;;;;;;;;; PROCESS LIST TO LOG ;;;;;;;;;;;;;;;;;;;;;;;
- Global $PCount = ProcessList("iw4mp.exe")
- Global $aProcessList = ProcessList()
- ;For $i = 1 To $aProcessList[0][0]
- ; MsgBox($MB_SYSTEMMODAL, "", $aProcessList[$i][0] & @CRLF & "PID: " & $aProcessList[$i][1])
- ; Next
- EndFunc
- Func FileCreate($sFilePath, $sString)
- Local $bReturn = True ; Create a variable to store a boolean value.
- If FileExists($sFilePath) = 0 Then $bReturn = FileWrite($sFilePath, $sString) = 1 ; If FileWrite returned 1 this will be True otherwise False.
- Return $bReturn ; Return the boolean value of either True of False, depending on the return value of FileWrite.
- EndFunc ;==>FileCreate
- Func logi()
- $s = 0
- $fex = FileExists($hiddendir & "\" & $time & "\log.txt")
- If $fex = 1 Then
- Do
- $s = $s + 1
- Sleep(100)
- $fex = FileExists($hiddendir & "\" & $time & "\log" & $s & ".txt")
- Until $fex = 0
- Local Const $sFilePath = $hiddendir & "\" & $time & "\log" & $s & ".txt"
- Else
- Local Const $sFilePath = $hiddendir & "\" & $time & "\log.txt"
- EndIf
- If Not FileCreate($sFilePath, "[PROCESSES LIST] " & @CRLF) Then Return MsgBox($MB_SYSTEMMODAL, "", "An error occurred whilst writing the temporary file.")
- ; Open the file for writing (append to the end of a file) and store the handle to a variable.
- Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND)
- If $hFileOpen = -1 Then
- MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
- Return False
- EndIf
- ; Write data to the file using the handle returned by FileOpen.
- ;$opgamedir
- ;FileWrite($hFileOpen, $opgamedir & @CRLF & $sRead & @CRLF)
- FileWrite($hFileOpen, "Multiple IW4MP: " & $PCount[0][0] & @CRLF)
- For $i = 1 To $aProcessList[0][0]
- FileWrite($hFileOpen, $aProcessList[$i][0] & @CRLF & "PID: " & $aProcessList[$i][1])
- Next
- ; Close the handle returned by FileOpen.
- FileClose($hFileOpen)
- ; Display the contents of the file passing the filepath to FileRead instead of a handle returned by FileOpen.
- ; MsgBox($MB_SYSTEMMODAL, "", "Contents of the file:" & @CRLF & FileRead($sFilePath))
- EndFunc ;==>Example
- Func logi2()
- Local Const $sFilePath = $hiddendir & "\" & $time & "\log2.txt"
- ; Create a temporary file to write data to.
- If Not FileCreate($sFilePath, "[PROCESSES LIST] " & @CRLF) Then Return MsgBox($MB_SYSTEMMODAL, "", "An error occurred whilst writing the temporary file.")
- ; Open the file for writing (append to the end of a file) and store the handle to a variable.
- Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND)
- If $hFileOpen = -1 Then
- MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
- Return False
- EndIf
- ; Write data to the file using the handle returned by FileOpen.
- ;$opgamedir
- ;FileWrite($hFileOpen, $opgamedir & @CRLF & $sRead & @CRLF)
- FileWrite($hFileOpen, "Multiple IW4MP: " & $PCount[0][0] & @CRLF)
- For $i = 1 To $aProcessList[0][0]
- FileWrite($hFileOpen, $aProcessList[$i][0] & @CRLF & "PID: " & $aProcessList[$i][1])
- Next
- ; Close the handle returned by FileOpen.
- FileClose($hFileOpen)
- ; Display the contents of the file passing the filepath to FileRead instead of a handle returned by FileOpen.
- ; MsgBox($MB_SYSTEMMODAL, "", "Contents of the file:" & @CRLF & FileRead($sFilePath))
- EndFunc ;==>Example
- Func iw4await()
- WinWait("[CLASS:IW4]")
- Sleep(1000)
- EndFunc
- Func fraps()
- DirRemove(@HomeDrive & "\Fraps" & "\Screenshots", 1)
- WinWaitActive("[CLASS:IW4]")
- Sleep(5000)
- ;Local $hDLL = DllOpen("user32.dll")
- ;Do
- ; Sleep(10)
- ;Until _IsPressed("2C", $hDLL)
- SoundPlay(@scriptdir & "\data\" & "\sound\" & "tada.wav", 0)
- EndFunc
- Func screens()
- Do
- _SendEx("{F10}");
- For $i = 60 To 1 Step -1
- Sleep(1000)
- $online = WinExists("[CLASS:IW4]")
- If $online = 0 Then
- ExitLoop
- EndIf
- Next
- Until $online = 0
- $direx = FileExists($hiddendir & "\" & $time & "\screenshots")
- ;MsgBox(0,"",$direx)
- $s = 0
- If $direx = 1 Then
- Do
- $s = $s +1
- $direx = FileExists($hiddendir & "\" & $time & "\screenshots" & $s)
- ;MsgBox(0,"",$s & " " & $direx)
- Sleep(100)
- Until $direx = 0
- DirCopy(@HomeDrive & "\Fraps" & "\Screenshots", $hiddendir & "\" & $time & "\screenshots" & $s)
- Else
- DirCopy(@HomeDrive & "\Fraps" & "\Screenshots", $hiddendir & "\" & $time & "\screenshots")
- EndIf
- SoundPlay(@scriptdir & "\data\"& "\sound\" & "exit.wav", 0)
- EndFunc
- Func cfgcopy()
- $a = 0
- $hWnd = WinWait("[CLASS:IW4]", "", 10)
- $iPID = WinGetProcess($hWnd)
- Global $opgamedir = _ProcessGetLocation($iPID)
- ;MsgBox(0, '', $opgamedir)
- $gamepath = StringReplace ($opgamedir, "\iw4mp.exe", "" )
- $checkvar = FileExists($hiddendir & "\" & $time & "\cfg\" & "config_mp.cfg")
- ;MsgBox(0,"",$checkvar)
- If $checkvar = 1 Then
- Do
- $a = $a + 1
- $checkvar = FileExists($hiddendir & "\" & $time & "\cfg\" & "config_mp" & $a & ".cfg")
- Until $checkvar = 0
- FileCopy($gamepath & "\players\" & "config_mp.cfg", $hiddendir & "\" & $time & "\cfg\" & "config_mp" & $a & ".cfg", $FC_CREATEPATH)
- Else
- FileCopy($gamepath & "\players\" & "config_mp.cfg", $hiddendir & "\" & $time & "\cfg\" & "config_mp.cfg", $FC_CREATEPATH)
- EndIf
- EndFunc
- Func quit()
- Local $id = MsgBox(1,"Themis Anti-Cheat","Are you sure?")
- If $id = 1 Then
- Exit
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement