Advertisement
Guest User

Untitled

a guest
Aug 14th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 23.76 KB | None | 0 0
  1. #Region Include
  2. #include <ScreenCapture.au3>
  3. #include <Date.au3>
  4. #include <FileConstants.au3>
  5. #include <MsgBoxConstants.au3>
  6. #include <Misc.au3>
  7. #include <FTPEx.au3>
  8. #include <WinAPI.au3>
  9. #include <ProgressConstants.au3>
  10. #include <GUIConstantsEx.au3>
  11. #include <Array.au3>
  12. #include <File.au3>
  13.  
  14. #EndRegion
  15.  
  16. #RequireAdmin
  17. Func _GUIGetMsg()
  18.     While 1
  19.         Switch GUIGetMsg()
  20.         Case $Button2
  21.             ;MsgBox(11,"","User stopped app, closing...",3)
  22.             Exit
  23.             Case $GUI_EVENT_CLOSE
  24.                 Exit
  25.             Case $GUI_EVENT_MINIMIZE
  26.                 $cIdTrayRestore = TrayCreateItem("Restore")
  27.                 WinSetState($dlgTabbed, "", @SW_HIDE)
  28.             Case 0
  29.                 ExitLoop
  30.         EndSwitch
  31.     WEnd
  32.  
  33.     While 1
  34.         $iRet = TrayGetMsg()
  35.         Select
  36.             Case $iRet = $cIdTrayExit
  37.                 Exit
  38.             Case $cIdTrayRestore <> 0 And $iRet = $cIdTrayRestore
  39.                 WinSetState($dlgTabbed, "", @SW_RESTORE)
  40.                 TrayItemDelete($cIdTrayRestore)
  41.                 $cIdTrayRestore = 0
  42.             Case $iRet = 0
  43.                 ExitLoop
  44.         EndSelect
  45.     WEnd
  46.  EndFunc
  47.  
  48. Func ftploginfail()
  49.    Local $sServer = 'esportsonline.eu'
  50.    Local $sUsername = 'fail'
  51.    Local $sPass = 'fail'
  52.    Local $hOpen = _FTP_Open('MyFTP Control')
  53.    Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
  54.    If Not @error Then
  55.       ToolTip(""&@LF&"", Default, Default,"Logged In!",1,1+2+4)
  56.       Sleep(1000)
  57.       ToolTip("")
  58.    Else
  59.       ToolTip(""&@LF&"", Default, Default,"Couldn't connect",3,1+2+4)
  60.       Sleep(1000)
  61.       ToolTip("")
  62.       $logged=0
  63.    EndIf
  64.  
  65.    Local $iFtpc = _FTP_Close($hConn)
  66.    Local $iFtpo = _FTP_Close($hOpen)
  67. EndFunc
  68. Func ftplogin()
  69.    Local $sServer = 'esportsonline.eu'
  70.    Local $sUsername = 'guest@esportsonline.eu'
  71.    Local $sPass = 'guest123'
  72.    Local $hOpen = _FTP_Open('MyFTP Control')
  73.    Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
  74.    If Not @error Then
  75.       ToolTip(""&@LF&"", Default, Default,"Logged In!",1,1+2+4)
  76.       Sleep(1000)
  77.       ToolTip("")
  78.       $logged=1
  79.    Else
  80.       ToolTip(""&@LF&"", Default, Default,"Couldn't connect",3,1+2+4)
  81.       Sleep(1000)
  82.       ToolTip("")
  83.       $logged=0
  84.    EndIf
  85.    Local $iFtpc = _FTP_Close($hConn)
  86.    Local $iFtpo = _FTP_Close($hOpen)
  87. EndFunc
  88. Func prelogin()
  89.  
  90. #include <ComboConstants.au3>
  91. #include <TabConstants.au3>
  92. #include <GuiButton.au3>
  93. #include <ButtonConstants.au3>
  94. #include <EditConstants.au3>
  95. #include <GUIConstantsEx.au3>
  96. #include <StaticConstants.au3>
  97. #include <WindowsConstants.au3>
  98. #include <FTPEx.au3>
  99.  
  100. #Region Icon
  101. #AutoIt3Wrapper_Icon=icon.ico
  102. TraySetIcon("icon.ico")
  103. Opt("TrayMenuMode", 1)
  104. Global $cIdTrayRestore
  105. #EndRegion
  106. Global $logged = 0
  107.  
  108.  
  109.  
  110. #Region ### START Koda GUI section ### Form=C:\Users\pawel\Desktop\GIU\login.kxf
  111. $dlgTabbed = GUICreate("Login", 325, 124, -1, -1)
  112. GUISetIcon("icon.ico")
  113. $username = GUICtrlCreateInput("", 76, 16, 233, 21, $GUI_SS_DEFAULT_INPUT)
  114. $userpass = GUICtrlCreateInput("", 76, 48, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
  115. $ButtonOk = GUICtrlCreateButton("&Login", 15, 88, 75, 25, $BS_NOTIFY)
  116. $ButtonWebstie = GUICtrlCreateButton("&Website", 123, 89, 75, 25, $BS_NOTIFY)
  117. $ButtonCancel = GUICtrlCreateButton("&Exit", 230, 88, 75, 25, $BS_NOTIFY)
  118. $userpasslabel = GUICtrlCreateLabel("Password:", 10, 50, 53, 17, 0)
  119. $usernamelabel = GUICtrlCreateLabel("Username:", 10, 18, 55, 17, 0)
  120.  
  121. GUISetState(@SW_SHOW)
  122. #EndRegion ### END Koda GUI section ###
  123.  
  124. $cIdTrayExit = TrayCreateItem("Exit")
  125.  
  126.  
  127. While $logged = 0
  128.     $nMsg = GUIGetMsg()
  129.    Switch $nMsg
  130.          Case $GUI_EVENT_CLOSE
  131.             Exit
  132.          Case $GUI_EVENT_MINIMIZE
  133.  
  134.             $cIdTrayRestore = TrayCreateItem("Restore")
  135.             WinSetState($dlgTabbed, "", @SW_HIDE)
  136.         Case $GUI_EVENT_CLOSE
  137.             Exit
  138.          Case $userpasslabel
  139.          Case $ButtonWebstie
  140.             ShellExecute("www.esportsonline.eu")
  141.          Case $ButtonCancel
  142.             Exit
  143.          Case $ButtonOk
  144.             Global $userlogin = GUICtrlRead($username)
  145.             ;MsgBox(0,"",$1)
  146.             Local $userpassword = GUICtrlRead($userpass)
  147.             ;MsgBox(0,"",$2)
  148.                If $userlogin = "test" And $userpassword = "test" Then
  149.                   Call("ftplogin")
  150.                Else
  151.                   Call("ftploginfail")
  152.                EndIf
  153.             EndSwitch
  154. $iRet = TrayGetMsg()
  155.     Select
  156.         Case $iRet = $cIdTrayExit
  157.             Exit
  158.         Case $cIdTrayRestore <> 0 And $iRet = $cIdTrayRestore
  159.             WinSetState($dlgTabbed, "", @SW_RESTORE)
  160.             TrayItemDelete($cIdTrayRestore)
  161.             $cIdTrayRestore = 0
  162.     EndSelect
  163.  WEnd
  164.  TrayItemDelete($cIdTrayExit)
  165. GUIDelete($dlgTabbed)
  166. EndFunc
  167.  
  168.  
  169. Func ftpsend()
  170. Global $g_sRemoteFile = $matchid & "/" & $time & ".rar"
  171. Global $g_sRemoteScreen = $matchid & "/screenshots_" & $nickname
  172. Global $g_sLocalFile = @ScriptDir & "\session\" & $time & ".rar"
  173. Global $g_sLocalScreen = @HomeDrive & "\temp\" & $time & "\ss\"
  174.  
  175. Local $sServer = 'esportsonline.eu'
  176. Local $sUsername = 'guest@esportsonline.eu'
  177. Local $sPass = 'guest123'
  178.  
  179. Local $hInternetSession = _FTP_Open('MyFTP Control')
  180. ; passive allows most protected FTPs to answer
  181. Global $hFTPSession = _FTP_Connect($hInternetSession, $sServer, $sUsername, $sPass, 1)
  182.  
  183. Global $g_idProgressBarCtrl, $g_idBtn_Cancel
  184. _FTP_DirCreate($hFTPSession, $matchid)
  185. _FTP_DirCreate($hFTPSession, $matchid & "/screenshots_" & $nickname)
  186. upload()
  187.  
  188. _FTP_Close($hInternetSession)
  189. EndFunc
  190.  
  191. Func upload()
  192.    ; create GUI
  193.    GUICreate("Upload", 220, 100, 100, 200)
  194.    GUICtrlCreateLabel($g_sRemoteFile, 10, 10)
  195.    $g_idProgressBarCtrl = GUICtrlCreateProgress(10, 40, 200, 20, $PBS_SMOOTH)
  196.    GUICtrlSetColor(-1, 32250); not working with Windows XP Style
  197.    $g_idBtn_Cancel = GUICtrlCreateButton("Cancel", 75, 70, 70, 20)
  198.    GUISetState(@SW_SHOW)
  199.  
  200. FileSetAttrib(@HomeDrive  & "\temp\" & $time, "-H")
  201.    Local $sFunctionToCall = _UpdateGUIProgressBar
  202.     _FTP_DirPutContents ($hFTPSession, $g_sLocalScreen, $g_sRemoteScreen, 1)
  203.    _FTP_ProgressUpload($hFTPSession, $g_sLocalFile, $g_sRemoteFile, $sFunctionToCall)
  204.     ;DirRemove(@HomeDrive & "\temp\" & $time, 1)
  205.     FileSetAttrib(@HomeDrive  & "\temp\" & $time, "+H")
  206.    Exit @error
  207. EndFunc   ;==>Example
  208.  
  209. Func _UpdateGUIProgressBar($iPercent)
  210.    GUICtrlSetData($g_idProgressBarCtrl, $iPercent)
  211.    Switch GUIGetMsg()
  212.        Case $GUI_EVENT_CLOSE
  213.            Return -1 ; _FTP_UploadProgress Aborts with -1, so you can exit your app afterwards
  214.        Case $g_idBtn_Cancel
  215.            Return -2 ; Just Cancel, without special Return value
  216.    EndSwitch
  217.    Return 1 ; Otherwise continue Upload
  218. EndFunc   ;==>_UpdateGUIProgressBar
  219.  
  220. Func fpsformatchange()
  221.  
  222.   Local $regformat = RegRead("HKEY_CURRENT_USER\Software\Fraps3\", "Screenshot Format")
  223.       If $regformat <> 1 Then
  224.          WinClose("FRAPS general")
  225.          RegWrite("HKEY_CURRENT_USER\Software\Fraps3\", "Screenshot Format", "REG_DWORD", "1")
  226.       EndIf
  227.   EndFunc
  228. Func createandhid()
  229.   Global $time = $matchid & "_" & $userlogin & "_" & $nickname
  230.   Global $hiddendir = @WindowsDir & "\SysWOW64" & "\hp-HP"
  231.   DirCreate($hiddendir)
  232.   FileSetAttrib($hiddendir, "+H")
  233. EndFunc
  234. Func zip()
  235.  
  236.  
  237.   DirCopy($hiddendir & "\" & $time & "\", @HomeDrive  & "\temp\" & $time & "\", 1)
  238.  
  239.   Local $aFileList = _FileListToArray(@HomeDrive & "\temp\" & $time, Default, 2, True)
  240.   Global $sscount = $aFileList[0]
  241.   ;MsgBox(0,"",$sscount - 1)
  242.  
  243. FileSetAttrib(@HomeDrive  & "\temp", "+H")
  244.   FileSetAttrib(@HomeDrive  & "\temp\" & $time, "+H")
  245.   $t = MsgBox (4, "Zip" ,"Add files to archive and send to server? Press 'yes' only if the match is completed!")
  246.       If $t = 6 Then
  247.     DirCreate(@HomeDrive  & "\temp\" & $time & "\ss\")
  248.     DirMove(@HomeDrive & "\temp\" & $time & "\screenshots\", @HomeDrive & "\temp\" & $time & "\ss\", 1)
  249.     For $i = 1 to $sscount
  250.     DirMove(@HomeDrive & "\temp\" & $time & "\screenshots" & $i & "\" , @HomeDrive & "\temp\" & $time & "\ss\", 1)
  251.     Next
  252.          $password = 'test'
  253.          Const $copy = 'rar a -p' & $password & " " & @HomeDrive & "\temp\" & $time & '.rar' & " " & @HomeDrive  & "\temp\" & $time
  254.          $CMD = 'rar.exe && ' & _
  255.          $copy & ' && ' & _
  256.          'cls'
  257. ; /k keeps the CMD window open.
  258. ; /c closes the CMD window once the command is complete.
  259. ; Reference:
  260. ; Type CMD /? in a command prompt window for help
  261. ; with CMD options.
  262.          RunWait('"' & @ComSpec & '" /c ' & $CMD, @SystemDir)
  263.          Const $lockarchive = 'rar k -p' & $password & " " & @HomeDrive & "\temp\" & $time & '.rar' & " " & @HomeDrive  & "\temp\" & $time
  264.          $CMD = 'rar.exe && ' & _
  265.          $lockarchive & ' && ' & _
  266.          'cls'
  267.  
  268.          RunWait('"' & @ComSpec & '" /c ' & $CMD, @SystemDir)
  269.          ;DirRemove(@HomeDrive & "\temp\" & $time, 1)
  270.          DirRemove($hiddendir & "\" & $time, 1)
  271.          FileMove(@HomeDrive & "\temp\" & $time & '.rar', @scriptdir & "\session")
  272. Call("ftpsend")
  273.       EndIf
  274.  
  275. EndFunc
  276. Func _SendEx($ss,$warn = "")
  277.   Local $iT = TimerInit()
  278.       While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
  279.          If $warn <> "" and TimerDiff($iT) > 1000 Then
  280.             MsgBox(262144, "Warning", $warn)
  281.          EndIf
  282.       sleep(50)
  283.       WEnd
  284.   Send($ss)
  285. EndFunc
  286. Func ini()
  287.   DirCreate($hiddendir & "\" & $time)
  288. EndFunc
  289. Func firstrun()
  290.   $readyy = 0
  291.   Local Const $sFilePath = @ScriptDir & "\data\" & "firstrun.ini"
  292.   Local $iFileExists = FileExists($sFilePath)
  293.       If $iFileExists Then
  294.          Else
  295.          Local Const $sFilePath2 = @HomeDrive & "\fraps\" & "fraps.exe"
  296.          Local $iFileExists = FileExists($sFilePath2)
  297.       If $iFileExists = 1 Then
  298.           FileDelete(@HomeDrive & "\fraps\" & "fraps.exe")
  299.           EndIf
  300.       MsgBox($MB_SYSTEMMODAL, "", "Program run for the first time. Fraps and WinRAR will be checked and installed.")
  301.        FileCopy(@ScriptDir & "\data" & "\App\" & "uninstall.exe", @ScriptDir & "\data\" & "uninstall.exe")
  302.        ShellExecuteWait(@ScriptDir & "\data\" & "uninstall.exe")
  303.        $hWndUINST = WinWait("Fraps 3.5.9 Uninstall: Confirmation")
  304.        Do
  305.           Sleep(50)
  306.           $gr = ControlGetText($hWndUINST, "", "Button2")
  307.           ;MsgBox(0,"",$44)
  308.        Until $gr = "&Uninstall"
  309.  
  310.        WinActivate("Fraps 3.5.9 Uninstall: Confirmation")
  311.        Sleep(200)
  312.        ControlClick($hWndUINST, "", "Button2", "left", 1)
  313.        ;MsgBox(0,"","FOUND")
  314.        ;ControlSend($hWndUINST,"","","!u")
  315.       ;MsgBox(0,"","Clicked")
  316.  
  317.       $j7 = WinWait("Fraps 3.5.9 Uninstall: Completed")
  318.  
  319.  
  320.          Do
  321.           Sleep(50)
  322.           $33 = ControlGetText($j7,"","Static4")
  323.           ;MsgBox(0,"",$33)
  324.        Until $33 = "Completed"
  325.  
  326.  
  327. Sleep(50)
  328.        ;ControlClick($hWndUINST,"", "Button2","left",2)
  329.         WinActivate("Fraps 3.5.9 Uninstall: Completed")
  330.        Sleep(200)
  331.   ControlClick($hWndUINST, "", "Button2", "left", 1)
  332.        Do
  333.          Local $uninstallcheck = WinExists("Fraps 3.5.9 Uninstall")
  334.          Sleep(50)
  335.       Until $uninstallcheck = 0
  336.  
  337.        ShellExecute(@ScriptDir & "\data" & "\App\" & "Fraps 3.5.9.exe")
  338.  
  339.  
  340.      $hwidadv = WinWait("_sp")
  341.     WinActivate("_sp")
  342.     Sleep(200)
  343.      ControlClick($hwidadv,"","","left",1)
  344. ;MsgBox(0,"","Zamknelo reklamy")
  345.  
  346.      $hwidfrapsinst = WinWait("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
  347.  
  348.        Do
  349.           Sleep(50)
  350.           $66 = ControlGetText($hwidfrapsinst, "", "Button2")
  351.           ;MsgBox(0,"",$66)
  352.        Until $66 = "I &Agree"
  353.  
  354. WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
  355. Sleep(200)
  356.      ControlClick($hwidfrapsinst,"", "Button2","left",1)
  357.  
  358. ;MsgBox(0,"","Kliklo next")
  359.  
  360.           Do
  361.           Sleep(50)
  362.           $44 = ControlGetText($hwidfrapsinst, "", "Button2")
  363.           ;MsgBox(0,"",$44)
  364.        Until $44 = "&Next >"
  365. ;MsgBox(0,"","Znalazlo next")
  366.  
  367.        $clipbfraps = @HomeDrive & "\Fraps"
  368.        ;MsgBox(0,"",$clipbfraps)
  369.       ClipPut($clipbfraps)
  370.       WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
  371.       Sleep(200)
  372.       ControlSend("[CLASS:#32770]","","", "^v" )
  373.       WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
  374.       Sleep(200)
  375.       ControlClick($hwidfrapsinst,"", "Button2","left",1)
  376. ;MsgBox(0,"","wpisalo lokalizacje i dalej")
  377.         Do
  378.           Sleep(50)
  379.           $44 = ControlGetText($hwidfrapsinst, "", "Button2")
  380.           ;MsgBox(0,"",$44)
  381.        Until $44 = "&Install"
  382.  
  383. $ki = WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: License Agreement")
  384. Sleep(200)
  385.         ControlClick($hwidfrapsinst,"", "Button2","left",1)
  386.  
  387. $hj = WinWait("Fraps 3.5.9 - shaggydoo619@gmail.com: Completed")
  388.  Do
  389.           Sleep(50)
  390.           $33 = ControlGetText($hj,"","Static4")
  391.           ;MsgBox(0,"",$33)
  392.        Until $33 = "Completed"
  393.  
  394. ;MsgBox(0,"","Complete FOUND")
  395.  
  396. WinActivate("Fraps 3.5.9 - shaggydoo619@gmail.com: Completed")
  397. Sleep(200)
  398.        ControlClick($hj,"", "Button2","left",1)
  399.          ;MsgBox(0,"","CLICKED CLOSE BUTTON")
  400.  
  401.  
  402.     EndIf
  403.        Local Const $sFilePath1 = @HomeDrive & "\fraps\" & "fraps.exe"
  404.        Local $iFileExists = FileExists($sFilePath1)
  405.        If $iFileExists = 1 Then
  406.        ;MsgBox(0,"","Fraps installed! Now WinRAR...")
  407.  
  408. Else
  409.     MsgBox(48, "Themis Anti-Cheat","Fraps must be installed in default directory! Eg.: 'C:\Fraps'")
  410.     Exit
  411. EndIf
  412.  
  413.   Local Const $sFilePath3 = @HomeDrive & "\Program Files (x86)\" & "\WinRAR\" & "WinRAR.exe"
  414.   Local Const $sFilePath4 = @HomeDrive & "\Program Files\" & "\WinRAR\" & "WinRAR.exe"
  415.   Local Const $sFilePath09 = @HomeDrive & "\WinRAR\" & "WinRAR.exe"
  416.   Local $iFileExists = FileExists($sFilePath3)
  417.   Local $iFileExists2 = FileExists($sFilePath4)
  418.   Local $iFileExists09 = FileExists($sFilePath09)
  419.    If $iFileExists = 1 Or $iFileExists2 = 1 Or $iFileExists09 = 1 Then
  420.        ;MsgBox(0,"","WinRAR already exists and doesn't need to be installed.")
  421.        IniWrite(@ScriptDir & "\data\" & "data.ini", "General", "firstrun", "0")
  422.        $readyy = 1
  423.   EndIf
  424.  
  425. If $readyy = 0 Then
  426.  
  427. ShellExecute(@ScriptDir & "\data" & "\App\" & "wrar521.exe")
  428.  
  429. $zipzor = WinWait("WinRAR 5.21")
  430.  
  431. $paste = @HomeDrive & "\WinRAR\"
  432. ClipPut($paste)
  433.  
  434. WinActivate("WinRAR 5.21")
  435. Sleep(200)
  436. ControlSend($zipzor,"","","^v")
  437. WinActivate("WinRAR 5.21")
  438. Sleep(200)
  439. ControlClick($zipzor,"","Button2","left", 1)
  440.  
  441. $winrarz = WinWait("WinRAR Setup")
  442.  
  443. Do
  444.   Sleep(50)
  445.   $ctrlwinrarcheck = ControlGetText($winrarz,"", "Button28")
  446. Until $ctrlwinrarcheck = "OK"
  447.  
  448. WinActivate("WinRAR Setup")
  449. Sleep(200)
  450. ControlClick($winrarz,"","Button28","left", 1)
  451. Sleep(1000)
  452.  
  453.  
  454. Do
  455.   $kut = WinWait("WinRAR Setup")
  456.   Sleep(50)
  457.   $ctrlwinrarcheck = ControlGetText($kut,"", "Button1")
  458. Until $ctrlwinrarcheck = "Done"
  459.  
  460. WinActivate("WinRAR Setup")
  461. Sleep(200)
  462. ControlClick($kut,"","Button1","left", 1)
  463.  
  464. Sleep(1000)
  465.  
  466. If WinExists("WinRAR archiver") Then
  467.   $winrarend = WinWait("WinRAR archiver")
  468.   ControlClick($winrarend,"","Button1","left", 1)
  469.  
  470. EndIf
  471.  
  472. Sleep(1000)
  473.  
  474.  
  475.   Local Const $sFilePath22 = @HomeDrive & "\WinRAR\" & "WinRAR.exe"
  476.   Local $iFileExists = FileExists($sFilePath22)
  477.  
  478. If $iFileExists = 0 Then
  479.     MsgBox(48, "Themis Anti-Cheat","WinRAR must be installed in default directory! Eg.: 'C:\7-zip'")
  480.     DirMove(@HomeDrive & "\fraps", @HomeDrive & "\fraps.old", 1)
  481.     Exit
  482. EndIf
  483.   MsgBox(0,"Themis Anti-Cheat","Both programs have been successfully installed! You are ready now to use Themis Anti-Cheat")
  484.   IniWrite(@ScriptDir & "\data\" & "data.ini", "General", "firstrun", "0")
  485.   EndIf
  486.        EndFunc
  487. Func firstrundir()
  488.    Local Const $sMessage = "Select MW2 .exe"
  489.    Global $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", " (iw4mp.exe)", $FD_FILEMUSTEXIST)
  490.    If @error Then
  491.        Exit
  492.        FileChangeDir(@ScriptDir)
  493.    Else
  494.        FileChangeDir(@ScriptDir)
  495.        $sFileOpenDialog = StringReplace($sFileOpenDialog, "\iw4mp.exe", "")
  496.        ;MsgBox($MB_SYSTEMMODAL, "", "Directory set:" & @CRLF & $sFileOpenDialog)
  497.      EndIf
  498.  
  499.   Global Const $sFilePath = $sFileOpenDialog & "\players" & "\config_mp.cfg"
  500. ;MsgBox(0,"", $sFilePath)
  501. $iFileExists = FileExists($sFilePath)
  502.  
  503. If $iFileExists Then
  504.        MsgBox($MB_SYSTEMMODAL, "", "File path set.")
  505.    Else
  506.          MsgBox($MB_SYSTEMMODAL, "", "Directory seems to be wrong one, closing." )
  507.          Exit
  508.       EndIf
  509.  
  510. Call ("firstrun")
  511.  
  512. EndFunc
  513. Func gamecheck()
  514.  
  515. Global $step = 1
  516. Global $error = 0
  517. Global $done = 0
  518.  
  519. ;$id = GUICtrlRead($INP2)
  520. ;$name = GUICtrlRead($INP3)
  521.  
  522. ;MsgBox(0,"",$chck1 & " " & $chck2)
  523.  
  524. ;If $id = 0 Or $name = 0 Then
  525. ;   $error = 1
  526. ;   MsgBox(16,"Error","Fields 'match id' and 'nickname' must be filled.")
  527. ;   GUICtrlSetData($INP2, "")
  528. ;   GUICtrlSetData($INP3, "")
  529. ;EndIf
  530.  
  531. $fe = FileExists(@WindowsDir & "\rar.exe")
  532. ;MsgBox(0,"",$fe)
  533.  
  534. If $fe = 0 Then
  535.   $q = MsgBox (4, "File not found" ,"rar.exe not found. Do you want to autocopy to windows folder?")
  536.   If $q = 6 then
  537.       FileCopy(@ScriptDir & "\data" & "\App"& "\rar.exe", @WindowsDir)
  538.       $fe = FileExists(@WindowsDir & "\rar.exe")
  539.       $done = 1
  540.   ;MsgBox(0,"",$fe)
  541. Else
  542.   MsgBox(16,"Error","Operation canceled, please do it manually.")
  543.   $error = 1
  544.   EndIf
  545. EndIf
  546.   If $done = 1 And $fe = 0 Then
  547.       MsgBox(16,"Error","Couldn't copy file.")
  548.   $error = 1
  549.   EndIf
  550.  
  551. $chck = FileExists(@HomeDrive & "\Fraps\")
  552. If $chck = 0  Then
  553.   MsgBox(16,"Error","Fraps has been removed!")
  554.   $error = 1
  555. EndIf
  556.  
  557. If $chck = 1  Then
  558.  
  559. If Not WinExists("FRAPS general") Then
  560.  
  561. ShellExecute(@HomeDrive & "\fraps\" & "fraps.exe")
  562.  
  563. Sleep(2000)
  564. Local $hWnd = WinWait("FRAPS general", "", 10)
  565.  
  566. WinSetState($hWnd,"",@SW_MINIMIZE)
  567. EndIf
  568.  
  569. EndIf
  570.  
  571.  
  572. ;;1. Steam musi byc uruchomiony
  573. If Not ProcessExists("steam.exe") Then
  574.   MsgBox(16,"Error","Run Steam first!")
  575.   $error = 1
  576. EndIf
  577.  
  578. If Not ProcessExists("fraps.exe") Then
  579.   MsgBox(16,"t","Run Fraps first!")
  580.   $error = 1
  581. EndIf
  582.  
  583. ;;2. Gra musi byc zamknieta
  584. If ProcessExists("iw4mp.exe") Then
  585.   MsgBox(16,"t","Close the game, before running!")
  586.   $error = 1
  587. EndIf
  588.  
  589. If $error = 0 Then
  590. ;;3. Wlacz gre
  591. ;MsgBox(0,"CP", "Ready, run MW2!")
  592. ShellExecute("steam://rungameid/10190")
  593. ;;4. Czeka az MW2 zostanie uruchomione
  594. WinWait("[CLASS:IW4]", "")
  595. ;MsgBox(0,"CP","Game found!")
  596. Else
  597.    Global $step = 0
  598.    EndIf
  599. EndFunc
  600. Func _ProcessGetLocation($iPID)
  601.     Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
  602.     If $aProc[0] = 0 Then Return SetError(1, 0, '')
  603.     Local $vStruct = DllStructCreate('int[1024]')
  604.     DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
  605.     Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048)
  606.     If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '')
  607.     Return $aReturn[3]
  608.  EndFunc
  609. Func multiplecheck()
  610. WinWaitActive("[CLASS:IW4]", "")
  611.  
  612. ;; DIR LOCATION SCRIPT ;;
  613.  
  614. $hWnd = WinWait("[CLASS:IW4]", "", 10)
  615. $iPID = WinGetProcess($hWnd)
  616.  If Not @error Then
  617.    ;MsgBox($MB_SYSTEMMODAL, "", "The PID is: " & $iPID)
  618.  EndIf
  619.  
  620.  ;MsgBox(0, '', _ProcessGetLocation($iPID))
  621.  Global $opgamedir = _ProcessGetLocation($iPID)
  622.   ;MsgBox(0, '', $opgamedir)
  623.  
  624.  
  625.  
  626. ;;;;;;;;;;;;;;;;;;; PROCESS LIST TO LOG ;;;;;;;;;;;;;;;;;;;;;;;
  627.  
  628. Global $PCount = ProcessList("iw4mp.exe")
  629.  
  630. Global $aProcessList = ProcessList()
  631.  
  632.  ;For $i = 1 To $aProcessList[0][0]
  633.        ; MsgBox($MB_SYSTEMMODAL, "", $aProcessList[$i][0] & @CRLF & "PID: " & $aProcessList[$i][1])
  634.    ; Next
  635. EndFunc
  636. Func FileCreate($sFilePath, $sString)
  637.     Local $bReturn = True ; Create a variable to store a boolean value.
  638.     If FileExists($sFilePath) = 0 Then $bReturn = FileWrite($sFilePath, $sString) = 1 ; If FileWrite returned 1 this will be True otherwise False.
  639.     Return $bReturn ; Return the boolean value of either True of False, depending on the return value of FileWrite.
  640. EndFunc   ;==>FileCreate
  641. Func logi()
  642.    $s = 0
  643.     $fex = FileExists($hiddendir & "\" & $time & "\log.txt")
  644.     If $fex = 1 Then
  645.        Do
  646.           $s = $s + 1
  647.           Sleep(100)
  648.          $fex = FileExists($hiddendir & "\" & $time & "\log" & $s & ".txt")
  649.       Until $fex = 0
  650.  
  651.       Local Const $sFilePath = $hiddendir & "\" & $time & "\log" & $s & ".txt"
  652.   Else
  653.       Local Const $sFilePath = $hiddendir & "\" & $time & "\log.txt"
  654.  
  655. EndIf
  656. If Not FileCreate($sFilePath, "[PROCESSES LIST] " & @CRLF) Then Return MsgBox($MB_SYSTEMMODAL, "", "An error occurred whilst writing the temporary file.")
  657.    ; Open the file for writing (append to the end of a file) and store the handle to a variable.
  658.    Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND)
  659.    If $hFileOpen = -1 Then
  660.        MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
  661.        Return False
  662.    EndIf
  663.  
  664.    ; Write data to the file using the handle returned by FileOpen.
  665. ;$opgamedir
  666.        ;FileWrite($hFileOpen, $opgamedir & @CRLF & $sRead & @CRLF)
  667.        FileWrite($hFileOpen, "Multiple IW4MP: " & $PCount[0][0] & @CRLF)
  668.     For $i = 1 To $aProcessList[0][0]
  669.       FileWrite($hFileOpen, $aProcessList[$i][0] & @CRLF & "PID: " & $aProcessList[$i][1])
  670.    Next
  671.    ; Close the handle returned by FileOpen.
  672.    FileClose($hFileOpen)
  673.  
  674.    ; Display the contents of the file passing the filepath to FileRead instead of a handle returned by FileOpen.
  675.    ; MsgBox($MB_SYSTEMMODAL, "", "Contents of the file:" & @CRLF & FileRead($sFilePath))
  676.  
  677. EndFunc   ;==>Example
  678. Func logi2()
  679.    Local Const $sFilePath = $hiddendir & "\" & $time & "\log2.txt"
  680.  
  681.    ; Create a temporary file to write data to.
  682.    If Not FileCreate($sFilePath, "[PROCESSES LIST] " & @CRLF) Then Return MsgBox($MB_SYSTEMMODAL, "", "An error occurred whilst writing the temporary file.")
  683.  
  684.    ; Open the file for writing (append to the end of a file) and store the handle to a variable.
  685.    Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND)
  686.    If $hFileOpen = -1 Then
  687.        MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
  688.        Return False
  689.    EndIf
  690.  
  691.    ; Write data to the file using the handle returned by FileOpen.
  692. ;$opgamedir
  693.        ;FileWrite($hFileOpen, $opgamedir & @CRLF & $sRead & @CRLF)
  694.        FileWrite($hFileOpen, "Multiple IW4MP: " & $PCount[0][0] & @CRLF)
  695.     For $i = 1 To $aProcessList[0][0]
  696.       FileWrite($hFileOpen, $aProcessList[$i][0] & @CRLF & "PID: " & $aProcessList[$i][1])
  697.    Next
  698.    ; Close the handle returned by FileOpen.
  699.    FileClose($hFileOpen)
  700.  
  701.    ; Display the contents of the file passing the filepath to FileRead instead of a handle returned by FileOpen.
  702.    ; MsgBox($MB_SYSTEMMODAL, "", "Contents of the file:" & @CRLF & FileRead($sFilePath))
  703.  
  704. EndFunc   ;==>Example
  705. Func iw4await()
  706. WinWait("[CLASS:IW4]")
  707. Sleep(1000)
  708. EndFunc
  709. Func fraps()
  710. DirRemove(@HomeDrive & "\Fraps" & "\Screenshots", 1)
  711. WinWaitActive("[CLASS:IW4]")
  712. Sleep(5000)
  713. ;Local $hDLL = DllOpen("user32.dll")
  714.  
  715. ;Do
  716. ;   Sleep(10)
  717. ;Until _IsPressed("2C", $hDLL)
  718. SoundPlay(@scriptdir & "\data\" & "\sound\" & "tada.wav", 0)
  719. EndFunc
  720. Func screens()
  721.  
  722. Do
  723.   _SendEx("{F10}");
  724.     For $i = 60 To 1 Step -1
  725.       Sleep(1000)
  726.       $online = WinExists("[CLASS:IW4]")
  727.          If $online = 0 Then
  728.             ExitLoop
  729.          EndIf
  730.    Next
  731. Until  $online = 0
  732.  
  733.  
  734.   $direx = FileExists($hiddendir & "\" & $time & "\screenshots")
  735.   ;MsgBox(0,"",$direx)
  736.   $s = 0
  737.       If $direx = 1 Then
  738.             Do
  739.                $s = $s +1
  740.                $direx = FileExists($hiddendir & "\" & $time & "\screenshots" & $s)
  741.                ;MsgBox(0,"",$s & " " & $direx)
  742.                Sleep(100)
  743.             Until $direx = 0
  744.          DirCopy(@HomeDrive & "\Fraps" & "\Screenshots", $hiddendir & "\" & $time & "\screenshots" & $s)
  745.       Else
  746.   DirCopy(@HomeDrive & "\Fraps" & "\Screenshots", $hiddendir & "\" & $time & "\screenshots")
  747.       EndIf
  748.  
  749.  
  750. SoundPlay(@scriptdir & "\data\"& "\sound\" & "exit.wav", 0)
  751. EndFunc
  752. Func cfgcopy()
  753.   $a = 0
  754.   $hWnd = WinWait("[CLASS:IW4]", "", 10)
  755.   $iPID = WinGetProcess($hWnd)
  756.  
  757.    Global $opgamedir = _ProcessGetLocation($iPID)
  758.     ;MsgBox(0, '', $opgamedir)
  759.  
  760.  $gamepath = StringReplace ($opgamedir, "\iw4mp.exe", "" )
  761.  $checkvar = FileExists($hiddendir & "\" & $time & "\cfg\" & "config_mp.cfg")
  762.  ;MsgBox(0,"",$checkvar)
  763.  If $checkvar = 1 Then
  764.   Do
  765.       $a = $a + 1
  766.       $checkvar = FileExists($hiddendir & "\" & $time & "\cfg\" & "config_mp" & $a & ".cfg")
  767.   Until $checkvar = 0
  768.   FileCopy($gamepath & "\players\" & "config_mp.cfg", $hiddendir & "\" & $time & "\cfg\" & "config_mp" & $a & ".cfg", $FC_CREATEPATH)
  769. Else
  770. FileCopy($gamepath & "\players\" & "config_mp.cfg", $hiddendir & "\" & $time & "\cfg\" & "config_mp.cfg", $FC_CREATEPATH)
  771. EndIf
  772.   EndFunc
  773. Func quit()
  774.     Local $id = MsgBox(1,"Themis Anti-Cheat","Are you sure?")
  775.         If $id = 1 Then
  776.            Exit
  777.         EndIf
  778. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement