SHARE
TWEET

GTA5Tool

bls000 May 25th, 2020 1,408 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <GUIConstantsEx.au3>
  2. #include <GUIToolTip.au3>
  3. #include <MsgBoxConstants.au3>
  4. #include <WinAPIGdiDC.au3>
  5. #include <FontConstants.au3>
  6. #include <SendMessage.au3>
  7. #include <WindowsConstants.au3>
  8.  
  9. HotKeySet("^{NUMPADMULT}", "DerrubarConexao") ; Shift-Alt-d
  10. HotKeySet("^{NUMPADSUB}", "DerrubarSessao") ; Shift-Alt-d
  11. HotKeySet("^{NUMPAD0}", "Sair") ; Shift-Alt-d
  12.  
  13. While 1
  14.    Sleep(100)
  15. WEnd
  16.  
  17.  
  18. Func DerrubarSessao()
  19. ConsoleWrite('Suspendendo Gta5' & @CRLF)
  20. _ProcessSuspend('gta5.exe')
  21. Sleep(10000)
  22. ;~ For $g = 0 To 7
  23. ;~    $cd = $g - 8
  24. ;~     ConsoleWrite('Retomando a Gta em: ' & $cd & @CRLF)
  25. ;~    Sleep(1000)
  26. ;~ Next
  27. ConsoleWrite('Retomand Gta5 da suspenção' & @CRLF)
  28. _ProcessResume('gta5.exe')
  29. EndFunc
  30.  
  31.  
  32. Func DerrubarConexao()
  33. ConsoleWrite('Iniciando Derrubar Conexão' & @CRLF)
  34. _DosRun('netsh interface set interface name="Ethernet" admin=disabled')
  35.  
  36. ConsoleWrite('3' & @CRLF)
  37. Sleep(10000)
  38.  
  39.  
  40. ConsoleWrite('Retomando Conexão' & @CRLF)
  41. _DosRun('netsh interface set interface name="Ethernet" admin=enable')
  42. EndFunc
  43.  
  44.  
  45. Func Sair()
  46.    _ProcessResume('gta5.exe')
  47.    _DosRun('netsh interface set interface name="Ethernet" admin=enable')
  48.    Exit
  49. EndFunc
  50.  
  51.  
  52.  
  53. ;~ jguinch mod for me
  54. ;~ https://www.autoitscript.com/forum/topic/179865-how-to-change-tooitip-font-size/
  55.  
  56. Func BigToolTip($btt_MSG,$btt_Temp,$btt_Left,$btt_Top,$btt_Size=False)
  57.  
  58.    Local $hToolTip = _GUIToolTip_Create(0), $hDC = _WinAPI_GetDC(0)
  59.    Local $hFont = _WinAPI_CreateFont($btt_Size, 0, 0, 0, 800, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Tahoma')
  60.    Local $hOldFont = _WinAPI_SelectObject($hDC, $hFont)
  61.    _SendMessage($hToolTip, $WM_SETFONT, $hFont, True)
  62.    _GUIToolTip_AddTool($hToolTip, 0, $btt_MSG, 0, 0, 0, 0, 0, BitOR($TTF_TRACK, $TTF_ABSOLUTE)) ; <<<<<<<<<<<<<<<
  63.    _GUIToolTip_TrackPosition($hToolTip, $btt_Left, $btt_Top)
  64.    _GUIToolTip_TrackActivate($hToolTip, True, 0, 0)
  65.    Sleep($btt_Temp)
  66.    _GUIToolTip_Destroy($hToolTip)
  67. EndFunc
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. ;~ VIP
  79. ;~ https://www.autoitscript.com/forum/topic/111184-need-to-execute-cmd-commands/
  80. Func _DosRun($sCommand)
  81.     Local $nResult = Run('"' & @ComSpec & '" /c ' & $sCommand, @SystemDir, @SW_HIDE, 6)
  82.     ProcessWaitClose($nResult)
  83.     Return StdoutRead($nResult)
  84. EndFunc   ;==>_DosRun
  85.  
  86.  
  87. ;~ The Kandie Man
  88. ;~ https://www.autoitscript.com/forum/topic/32975-process-suspendprocess-resume-udf/
  89.  
  90. Func _ProcessSuspend($process)
  91. $processid = ProcessExists($process)
  92. If $processid Then
  93.     $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid)
  94.     $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0])
  95.     DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle)
  96.     If IsArray($i_sucess) Then
  97.         Return 1
  98.     Else
  99.         SetError(1)
  100.         Return 0
  101.     Endif
  102. Else
  103.     SetError(2)
  104.     Return 0
  105. Endif
  106. EndFunc
  107.  
  108. Func _ProcessResume($process)
  109. $processid = ProcessExists($process)
  110. If $processid Then
  111.     $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid)
  112.     $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0])
  113.     DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle)
  114.     If IsArray($i_sucess) Then
  115.         Return 1
  116.     Else
  117.         SetError(1)
  118.         Return 0
  119.     Endif
  120. Else
  121.     SetError(2)
  122.     Return 0
  123. Endif
  124. EndFunc
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top