Advertisement
TrunghieuTH10

TypeCLick

Aug 24th, 2015
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 8.24 KB | None | 0 0
  1. #cs
  2.     Tổng Hợp Các Hàm Click Ẩn + Send Ẩn By tackesaomai
  3.                     --------------
  4.    _MouseClick_Hy($handle, $tdx, $tdy, $button = "Left", $click = 1)
  5.    _MouseClickPlus($Hand, $X = "", $Y = "", $Button = "left", $Clicks = 1)
  6.    _MouseClick_Sai($GameHandle, $x=0, $y=0, $button = "left")
  7.    _MouseeClick_VL($hwnd, $x, $y, $type = 'left')
  8.    _MouseClick_WinAPI($hwnd, $x=0, $y=0, $button='Left Click')
  9.                     --------------
  10. #ce
  11. ;~ GLOBAL Const $TAGPOINT                   = "struct;long X;long Y;endstruct"
  12. ;~ Global        $Struct                    = DllStructCreate($tagPoint)
  13. Global Const $Hy_MOUSEMOVE              = 0x200
  14. Global Const $Hy_LBUTTONDOWN            = 0x201
  15. Global Const $Hy_LBUTTONUP              = 0x202
  16. Global Const $Hy_MBUTTONDOWN            = 0x207
  17. Global Const $Hy_MBUTTONUP              = 0x208
  18. Global Const $Hy_RBUTTONDOWN            = 0x204
  19. Global Const $Hy_RBUTTONUP              = 0x205
  20. Global Const $Hy_NCLBUTTONDOWN          = 0xA1
  21. Global Const $Hy_LBUTTONDBLCLK          = 0x203
  22. Global Const $Hy_MBUTTONDBLCLK          = 0x209
  23. Global Const $Hy_RBUTTONDBLCLK          = 0x206
  24. Global Const $Hy_LBUTTON                = 0x1
  25. Global Const $Hy_MBUTTON                = 0x10
  26. Global Const $Hy_RBUTTON                = 0x2
  27. Global Const $Hy_SETREDRAW              = 0xB
  28. Global Const $Hy_ERASEBKGND             = 0x14
  29. Const $Hy_CONTROL                       = 0x8
  30. ;~ Func _WinAPI_PostMessage($hWnd, $iMsg, $iwParam, $ilParam)
  31. ;~  Local $aResult = DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hWnd, "uint", $iMsg, "wparam", $iwParam, "lparam", $ilParam)
  32. ;~  If @error Then Return SetError(@error, @extended, False)
  33. ;~  Return $aResult[0]
  34. ;~ EndFunc   ;==>_WinAPI_PostMessage
  35.  
  36.  
  37.  
  38. ;==========================================================
  39.  
  40. ;==========================================================
  41.  
  42. ;==========================================================
  43. ;           MouseClick_Hy($handle, $x, $y)
  44. ;==========================================================
  45. Func _MouseClick_Hy($handle, $tdx, $tdy, $button = "Left", $click = 1)
  46.     $tdx2 = MouseGetPos(0)
  47.     $tdy2 = MouseGetPos(1)
  48.     Local $tpoint = DllStructCreate("int X;int Y")
  49.     DllStructSetData($tpoint, "X", $tdx)
  50.     DllStructSetData($tpoint, "Y", $tdy)
  51.     Local $pPoint = DllStructGetPtr($tPoint)
  52.     DllCall("user32.dll", "bool", "ClientToScreen", "hwnd", $handle, "ptr", $pPoint)
  53.     $tdx = DllStructGetData($tpoint, "X")
  54.     $tdy = DllStructGetData($tpoint, "Y")
  55.     $tpoint=0;~ free $tpoint
  56.     $pPoint=0;~ free $pPoint
  57.     DllCall("user32.dll", "long", "SetCursorPos", "long", $tdx, "long", $tdy)
  58.     For $k = 1 To $click
  59.         MouseClick($button, $tdx, $tdy)
  60.     Next
  61.     DllCall("user32.dll", "long", "SetCursorPos", "long", $tdx2, "long", $tdy2)
  62. EndFunc
  63.  
  64.  
  65. ;==========================================================
  66. ; MouseClick_Sai($GameHandle, $x=0, $y=0, $button = "left")
  67. ;==========================================================
  68. Func _MouseClick_Sai($GameHandle, $x=0, $y=0, $button = "left", $click = 1)
  69.     Local $Compile = 0
  70.     If Not $x Then $x = Random(100,650,1)
  71.     If Not $y Then $y = Random(100,500,1)
  72.     $button = StringLower($button)
  73.     Switch $button
  74.         Case "left"
  75.             Local $Down = 0x0201
  76.             Local $Up = 0x0202
  77.         Case "right"
  78.             Local $Down = 0x0204
  79.             Local $Up = 0x0205
  80.     EndSwitch
  81.     For $k = 1 To $click
  82.         DllCall("user32.dll", "int", "SendMessage", "hwnd", $GameHandle, "int", $Down, "int", $Compile, "int", FMakeLong($x,$y))
  83.         DllCall("user32.dll", "int", "SendMessage", "hwnd", $GameHandle, "int", $Up, "int", $Compile, "int", FMakeLong($x,$y))
  84.     Next
  85. EndFunc
  86.  
  87. Func FMakeLong($LoWord,$HiWord)
  88.     Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
  89. EndFunc
  90.  
  91.  
  92. ;===========================================================
  93. ;    MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1)
  94. ;===========================================================
  95. Func _MouseClickPlus($Hand, $X = "", $Y = "", $Button = "left", $Clicks = 1)
  96.     Local $MK_LBUTTON = 0x0001
  97.     Local $WM_LBUTTONDOWN = 0x0201
  98.     Local $WM_LBUTTONUP = 0x0202
  99.     Local $MK_RBUTTON = 0x0002
  100.     Local $WM_RBUTTONDOWN = 0x0204
  101.     Local $WM_RBUTTONUP = 0x0205
  102.     Local $WM_MOUSEMOVE = 0x0200
  103.     Local $i = 0
  104.     Select
  105.         Case $Button = "left"
  106.             $Button = $MK_LBUTTON
  107.             $ButtonDown = $WM_LBUTTONDOWN
  108.             $ButtonUp = $WM_LBUTTONUP
  109.         Case $Button = "right"
  110.             $Button = $MK_RBUTTON
  111.             $ButtonDown = $WM_RBUTTONDOWN
  112.             $ButtonUp = $WM_RBUTTONUP
  113.     EndSelect
  114.     If $X = "" OR $Y = "" Then
  115.         $MouseCoord = MouseGetPos()
  116.         $X = $MouseCoord[0]
  117.         $Y = $MouseCoord[1]
  118.     EndIf
  119.     For $i = 1 to $Clicks
  120.         DllCall("user32.dll", "int", "SendMessage", "hwnd", $Hand, "int", $WM_MOUSEMOVE, "int", 0, "long", _MakeLong($X, $Y))
  121.         DllCall("user32.dll", "int", "SendMessage", "hwnd", $Hand, "int", $ButtonDown, "int", $Button, "long", _MakeLong($X, $Y))
  122.         DllCall("user32.dll", "int", "SendMessage", "hwnd", $Hand, "int", $ButtonUp, "int", $Button, "long", _MakeLong($X, $Y))
  123.     Next
  124. EndFunc
  125.  
  126. Func _MakeLong($LoWord,$HiWord)
  127.     Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
  128. EndFunc
  129.  
  130.  
  131.  
  132. ;===========================================================
  133. ;       MoveClick_VL($hwnd, $x, $y, $type = 'left')
  134. ;===========================================================
  135. Func SetCursorPos($arg1,$arg2)
  136.     DllCall("user32.dll", "long", "SetCursorPos", "long", $arg1, "long", $arg2)
  137. EndFunc
  138. Func PostMessage($Arg00, $Arg01, $Arg02, $Arg03)
  139.     DllCall("user32.dll", "lresult", "PostMessageA", "hwnd", $Arg00, "uint", $Arg01, "wparam", $Arg02, "lparam", $Arg03)
  140. EndFunc
  141.  
  142. Func _MouseeClick_VL($Lchwnd, $x, $y, $type = 'left', $click = 1)
  143.     $x2 = MouseGetPos(0)
  144.     $y2 = MouseGetPos(1)
  145.     DllStructSetData($Struct, "x", $x)
  146.     DllStructSetData($Struct, "y", $y)
  147.     DllCall('user32.dll', "bool", "ClientToScreen", "hwnd", $lchwnd, "struct*", $Struct)
  148.     $x1=DllStructGetData($Struct,"x")
  149.     $y1=DllStructGetData($Struct,"y")
  150.     SetCursorPos($x1,$y1)
  151.     $pt = $X + $Y * 0x10000
  152.     PostMessage($LcHwnd, $Hy_MOUSEMOVE, 0, $pt)
  153.     For $k = 1 To $click
  154.         Switch $type
  155.             Case 'left'
  156.                 PostMessage($LcHwnd, $Hy_LBUTTONDOWN, $Hy_LBUTTON, $pt)
  157.                 PostMessage($LCHwnd, $Hy_LBUTTONUP, $Hy_LBUTTON, $pt)
  158.             Case 'right'
  159.                 PostMessage($LcHwnd, $Hy_RBUTTONDOWN, $Hy_RBUTTON, $pt)
  160.                 PostMessage($LcHwnd, $Hy_RBUTTONUP, $Hy_RBUTTON, $pt)
  161.             Case 'control'
  162.                 PostMessage($LcHwnd, $Hy_RBUTTONDOWN, $Hy_CONTROL, $pt)
  163.                 PostMessage($LcHwnd, $Hy_RBUTTONUP, $Hy_CONTROL, $pt)
  164.         EndSwitch
  165.     Next
  166.     SetCursorPos($x2,$y2)
  167. EndFunc
  168.  
  169.  
  170. ;============================================================
  171. ;  MoveClick_WinAPI($hwnd, $x=0, $y=0, $button='Left Click')
  172. ;============================================================
  173.  Func _MouseClick_WinAPI($hwnd, $x=0, $y=0, $button='Left', $click = 1)
  174.     $lParam = ($y * 65536) + ($x)
  175.     For $k = 1 To $click
  176.         Switch $button
  177.             Case $button='Left'
  178.                 _WinAPI_PostMessage($hwnd, $Hy_LBUTTONDOWN, $Hy_LBUTTON,$lParam)
  179.                 _WinAPI_PostMessage($hwnd, $Hy_LBUTTONUP, 0,$lParam)
  180.             Case $button='Left Double'
  181.                 _WinAPI_PostMessage($hwnd, $Hy_LBUTTONDOWN, $Hy_LBUTTON,$lParam)
  182.                 _WinAPI_PostMessage($hwnd, $Hy_LBUTTONUP, 0,$lParam)
  183.                 _WinAPI_PostMessage($hwnd, $Hy_LBUTTONDBLCLK, $Hy_LBUTTON,$lParam)
  184.                 _WinAPI_PostMessage($hwnd, $Hy_LBUTTONUP, 0,$lParam)
  185.             Case $button='Middle'
  186.                 _WinAPI_PostMessage($hwnd, $Hy_MBUTTONDOWN, $Hy_MBUTTON,$lParam)
  187.                 _WinAPI_PostMessage($hwnd, $Hy_MBUTTONUP, 0,$lParam)
  188.             Case $button='Middle Double'
  189.                 _WinAPI_PostMessage($hwnd, $Hy_MBUTTONDOWN, $Hy_MBUTTON,$lParam)
  190.                 _WinAPI_PostMessage($hwnd, $Hy_MBUTTONUP, 0,$lParam)
  191.                 _WinAPI_PostMessage($hwnd, $Hy_MBUTTONDBLCLK, $Hy_MBUTTON,$lParam)
  192.                 _WinAPI_PostMessage($hwnd, $Hy_MBUTTONUP, 0,$lParam)
  193.             Case $button='Right'
  194.                 _WinAPI_PostMessage($hwnd, $Hy_RBUTTONDOWN, $Hy_RBUTTON,$lParam)
  195.                 _WinAPI_PostMessage($hwnd, $Hy_RBUTTONUP, 0,$lParam)
  196.             Case $button='Right Double'
  197.                 _WinAPI_PostMessage($hwnd, $Hy_RBUTTONDOWN, $Hy_RBUTTON,$lParam)
  198.                 _WinAPI_PostMessage($hwnd, $Hy_RBUTTONUP, 0,$lParam)
  199.                 _WinAPI_PostMessage($hwnd, $Hy_RBUTTONDBLCLK, $Hy_RBUTTON,$lParam)
  200.                 _WinAPI_PostMessage($hwnd, $Hy_RBUTTONUP, 0,$lParam)
  201.             Case $button='Move'
  202.                 _WinAPI_PostMessage($hwnd, $Hy_MOUSEMOVE, 0,$lParam)
  203.                 _WinAPI_PostMessage($hwnd, $Hy_MOUSEMOVE, 0,$lParam)
  204.         EndSwitch
  205.     Next
  206. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement