Advertisement
snajper23

autoit script

Apr 9th, 2023 (edited)
3,716
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 4.82 KB | Gaming | 1 0
  1. #RequireAdmin
  2. #include <WinAPIProc.au3>
  3. #include <GuiListBox.au3>
  4. $er=0
  5. $path = ("S:\Program Files\SDA-1.0.9\Steam Desktop Authenticator.exe")
  6.  
  7.  
  8. $login = "vasya228"
  9. Run(@ScriptDir & "\" & $login & "_cs.bat")
  10. _checkSDA ()
  11. _steamstart ()
  12. _csname ()
  13. _startgame ()
  14.  
  15.  
  16.  
  17. Func _checkSDA () ;проверка на наличие СДА и если нет то открываем
  18.     if not WinExists("Steam Desktop Authenticator") Then
  19.         Run($path) ; запускаем sda
  20.         Local $iID = ProcessExists('Steam Desktop Authenticator.exe')
  21.         If FileGetVersion(_WinAPI_GetProcessFileName($iID)) <> "1.0.10.0" Then ;если версия старая, то нажимаем "не качать новую версию"
  22.             WinWaitActive("New Version","",5)
  23.             WinActivate("New Version")
  24.             WinWaitActive("New Version")
  25.             Send("{right}")
  26.             Send("{enter}")
  27.         Else
  28.             WinActivate("Steam Desktop Authenticator")
  29.         EndIf
  30.     Else
  31.     WinActivate("Steam Desktop Authenticator")
  32.     EndIf
  33.     WinMove("Steam Desktop Authenticator", "",5,400);передвигаем сда в удобное место, желательно где не будет окон кс и стима, для стабильности работы, можно и не передвигать, но будет больше шанс ошибки
  34.     WinActivate("Steam Desktop Authenticator")
  35. EndFunc
  36.  
  37. Func _steamstart () ;поиск кода сда и вставка в стим
  38.    WinWaitActive("Steam Desktop Authenticator","", 2)
  39.    SendKeepActive("Steam Desktop Authenticator")
  40.    WinActivate("Steam Desktop Authenticator")
  41.    WinWaitActive("Steam Desktop Authenticator","", 10)
  42.    ControlClick("Steam Desktop Authenticator", "", "[NAME:listAccounts]")
  43.    $listboxHandle = ControlGetHandle("Steam Desktop Authenticator", "", "[NAME:listAccounts]")
  44.    $count = _GUICtrlListBox_GetCount($listboxHandle)
  45.    $b = 0
  46.    For $sdai = 0 To $count - 1
  47.       $itemText = _GUICtrlListBox_GetText($listboxHandle, $sdai)
  48.       If $itemText = $login Then
  49.          SendKeepActive($listboxHandle)
  50.          _GUICtrlListBox_SetCurSel($listboxHandle, $sdai)
  51.          _GUICtrlListBox_ClickItem($listboxHandle, $sdai, "left", False)
  52.          SendKeepActive("")
  53.          $b = 1
  54.       EndIf
  55.    Next
  56.    If $b = 0 then
  57.       MsgBox (0, "Ошибка", "Аккаунт '" & $c & "' отсутствует в SDA")
  58.       Exit
  59.    EndIf
  60.    $listboxHandle = ControlGetHandle("Steam Desktop Authenticator", "", "[Text:Copy")
  61.    SendKeepActive($listboxHandle)
  62.    Sleep(1000)
  63.    WinActivate("Steam Desktop Authenticator")
  64.    ControlClick("Steam Desktop Authenticator", "", "[Text:Copy]")
  65.    WinActivate("Steam Desktop Authenticator")
  66.    ControlClick("Steam Desktop Authenticator", "", "[Text:Copy]")
  67.    SendKeepActive("")
  68.    WinSetState("Steam Desktop Authenticator", "", @SW_MINIMIZE)
  69.    Do
  70.       Sleep(300)
  71.    Until WinExists("Вход в Steam")
  72.    $swh=WinGetHandle("Вход в Steam")
  73.    WinSetTitle($swh, "", "Вход_Steam "& $login)
  74.    WinActivate("Вход_Steam "& $login)
  75.    WinWaitActive("Вход_Steam "& $login,"",5)
  76.    SendKeepActive("Вход_Steam "& $login)
  77.    WinActivate("Вход_Steam "& $login)
  78.    WinWaitActive("Вход_Steam "& $login)
  79.    Sleep(100)
  80.    AutoItSetOption("PixelCoordMode",0)
  81.    $ppp=0xE0E1E6
  82.    $pp=0xE0E1E6
  83.    $pppp=0xE0E1E6
  84.    $er=0
  85.    Do
  86.       $sss=WinGetHandle("Вход_Steam "& $login)
  87.       $ppp=PixelGetColor ( 526, 280, $sss)
  88.       $pp=PixelGetColor ( 415, 200, $sss)
  89.       $pppp=PixelGetColor ( 251, 250, $sss)
  90.       $hhh=Hex($ppp,6)
  91.       $hh=Hex($pp,6)
  92.       $hhhh=Hex($pppp,6)
  93.       WinActivate("Вход_Steam "& $login)
  94.       If $pp=0x2B77FF Or $pppp=0x2B78FF Then
  95.          $er=1
  96.       EndIf
  97.    Until $ppp=0x1A99FF Or $pp=0x2B77FF Or $pppp=0x2B78FF
  98.    Sleep(100)
  99.    WinActivate("Вход_Steam "& $login)
  100.    Send('+{INS}')
  101.    SendKeepActive("")
  102. EndFunc
  103.  
  104. Func _csname () ;переименовывание кс
  105.    If $er=0 Then
  106.       WinExists("Counter-Strike: Global Offensive - Direct3D 9")
  107.       WinActivate("Counter-Strike: Global Offensive - Direct3D 9")
  108.       WinWaitActive("Counter-Strike: Global Offensive - Direct3D 9")
  109.       $z = 0
  110.       while $z = 0
  111.          $x = WinGetPos("Counter-Strike: Global Offensive - Direct3D 9")
  112.          if $x[2] < 420 and $x[3] < 420 Then
  113.             $z = 1
  114.          EndIf
  115.       WEnd
  116.       WinSetTitle("Counter-Strike: Global Offensive - Direct3D 9", "", "csgo - " & $login)
  117.       $m = 0
  118.       While $m = 0
  119.          $k = Winlist()
  120.          for $i = 1 to $k[0][0]
  121.             if StringRegExp($k[$i][0], "csgo - " & $login) then
  122.                $m = 1
  123.             EndIf
  124.          Next
  125.       WEnd
  126.    EndIf
  127. EndFunc
  128.  
  129. Func _startgame () ;нажимаем поиск десматча
  130. If $er=0 Then
  131.    WinExists("csgo - "& $login)
  132.    WinWaitActive("csgo - "& $login)
  133.    Sleep (3500)
  134.    $x = WinGetPos("csgo - "& $login)
  135.    MouseClick('primary', $x[0] + 16, $x[1] + 64, 1)
  136.    MouseClick('primary', $x[0] + 169, $x[1] + 79, 1)
  137.    MouseClick('primary', $x[0] + 311, $x[1] + 313, 1)
  138. EndIf
  139. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement